1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/ui/pages/settings/advanced-tab/advanced-tab.stories.js
Nidhi Kumari cfc653ada6
eth_sign toggle Update in advanced settings (#18848)
* added eth sign first step

* added modal

* added validation for form

* updated width with block

* added state trigger for toggle

* updated Eth sign modal text changes

* added eth sign toggle tex

* removed unnecessary code

* fixed form validation text

* updated eth toggle text

* added test

* added analytics

* updated design changes

* lint fix

* updated error text

* updated changes
2023-05-04 16:44:07 +05:30

97 lines
2.7 KiB
JavaScript

import React from 'react';
import { useArgs } from '@storybook/client-api';
import AdvancedTab from './advanced-tab.component';
export default {
title: 'Pages/Settings/AdvancedTab',
argTypes: {
warning: { control: 'text' },
useNonceField: { control: 'boolean' },
sendHexData: { control: 'boolean' },
showFiatInTestnets: { control: 'boolean' },
useLedgerLive: { control: 'boolean' },
dismissSeedBackUpReminder: { control: 'boolean' },
setAutoLockTimeLimit: { action: 'setAutoLockTimeLimit' },
setShowFiatConversionOnTestnetsPreference: {
action: 'setShowFiatConversionOnTestnetsPreference',
},
setShowTestNetworks: { action: 'setShowTestNetworks' },
setIpfsGateway: { action: 'setIpfsGateway' },
setLedgerTransportPreference: { action: 'setLedgerTransportPreference' },
setDismissSeedBackUpReminder: { action: 'setDismissSeedBackUpReminder' },
setUseNonceField: { action: 'setUseNonceField' },
setHexDataFeatureFlag: { action: 'setHexDataFeatureFlag' },
displayWarning: { action: 'displayWarning' },
history: { action: 'history' },
showResetAccountConfirmationModal: {
action: 'showResetAccountConfirmationModal',
},
showEthSignModal: {
action: 'showEthSignModal',
},
},
};
export const DefaultStory = (args) => {
const [
{
useNonceField,
sendHexData,
showFiatInTestnets,
dismissSeedBackUpReminder,
},
updateArgs,
] = useArgs();
const handleUseNonceField = () => {
updateArgs({
useNonceField: !useNonceField,
});
};
const handleSendHexData = () => {
updateArgs({
sendHexData: !sendHexData,
});
};
const handleShowFiatInTestnets = () => {
updateArgs({
showFiatInTestnets: !showFiatInTestnets,
});
};
const handleDismissSeedBackUpReminder = () => {
updateArgs({
dismissSeedBackUpReminder: !dismissSeedBackUpReminder,
});
};
return (
<div style={{ flex: 1, height: 500 }}>
<AdvancedTab
{...args}
useNonceField={useNonceField}
setUseNonceField={handleUseNonceField}
sendHexData={sendHexData}
setHexDataFeatureFlag={handleSendHexData}
showFiatInTestnets={showFiatInTestnets}
setShowFiatConversionOnTestnetsPreference={handleShowFiatInTestnets}
dismissSeedBackUpReminder={dismissSeedBackUpReminder}
setDismissSeedBackUpReminder={handleDismissSeedBackUpReminder}
ipfsGateway="ipfs-gateway"
/>
</div>
);
};
DefaultStory.storyName = 'Default';
DefaultStory.args = {
warning: 'Warning Sample',
useNonceField: false,
sendHexData: false,
showFiatInTestnets: false,
useLedgerLive: false,
dismissSeedBackUpReminder: false,
};