2021-09-13 23:02:24 +02:00
|
|
|
import React from 'react';
|
2022-01-17 19:58:12 +01:00
|
|
|
import { useArgs } from '@storybook/client-api';
|
2021-09-13 23:02:24 +02:00
|
|
|
import AdvancedTab from './advanced-tab.component';
|
|
|
|
|
|
|
|
export default {
|
2021-12-01 20:27:57 +01:00
|
|
|
title: 'Pages/Settings/AdvancedTab',
|
2021-09-15 20:55:48 +02:00
|
|
|
id: __filename,
|
2022-01-17 19:58:12 +01:00
|
|
|
argTypes: {
|
|
|
|
warning: { control: 'text' },
|
|
|
|
useNonceField: { control: 'boolean' },
|
|
|
|
sendHexData: { control: 'boolean' },
|
|
|
|
advancedInlineGas: { control: 'boolean' },
|
|
|
|
showFiatInTestnets: { control: 'boolean' },
|
|
|
|
threeBoxSyncingAllowed: { control: 'boolean' },
|
|
|
|
threeBoxDisabled: { control: 'boolean' },
|
|
|
|
useLedgerLive: { control: 'boolean' },
|
|
|
|
dismissSeedBackUpReminder: { control: 'boolean' },
|
|
|
|
setAutoLockTimeLimit: { action: 'setAutoLockTimeLimit' },
|
|
|
|
setShowFiatConversionOnTestnetsPreference: {
|
|
|
|
action: 'setShowFiatConversionOnTestnetsPreference',
|
|
|
|
},
|
|
|
|
setShowTestNetworks: { action: 'setShowTestNetworks' },
|
|
|
|
setThreeBoxSyncingPermission: { action: 'setThreeBoxSyncingPermission' },
|
|
|
|
setIpfsGateway: { action: 'setIpfsGateway' },
|
|
|
|
setLedgerTransportPreference: { action: 'setLedgerTransportPreference' },
|
|
|
|
setDismissSeedBackUpReminder: { action: 'setDismissSeedBackUpReminder' },
|
|
|
|
setUseNonceField: { action: 'setUseNonceField' },
|
|
|
|
setHexDataFeatureFlag: { action: 'setHexDataFeatureFlag' },
|
|
|
|
displayWarning: { action: 'displayWarning' },
|
|
|
|
history: { action: 'history' },
|
|
|
|
showResetAccountConfirmationModal: {
|
|
|
|
action: 'showResetAccountConfirmationModal',
|
|
|
|
},
|
|
|
|
setAdvancedInlineGasFeatureFlag: {
|
|
|
|
action: 'setAdvancedInlineGasFeatureFlag',
|
|
|
|
},
|
|
|
|
},
|
2021-09-13 23:02:24 +02:00
|
|
|
};
|
|
|
|
|
2022-01-17 19:58:12 +01:00
|
|
|
export const DefaultStory = (args) => {
|
|
|
|
const [
|
|
|
|
{
|
|
|
|
useNonceField,
|
|
|
|
sendHexData,
|
|
|
|
advancedInlineGas,
|
|
|
|
showFiatInTestnets,
|
|
|
|
threeBoxSyncingAllowed,
|
|
|
|
dismissSeedBackUpReminder,
|
|
|
|
},
|
|
|
|
updateArgs,
|
|
|
|
] = useArgs();
|
|
|
|
|
|
|
|
const handleUseNonceField = () => {
|
|
|
|
updateArgs({
|
|
|
|
useNonceField: !useNonceField,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
const handleSendHexData = () => {
|
|
|
|
updateArgs({
|
|
|
|
sendHexData: !sendHexData,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
const handleAdvancedInlineGas = () => {
|
|
|
|
updateArgs({
|
|
|
|
advancedInlineGas: !advancedInlineGas,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
const handleShowFiatInTestnets = () => {
|
|
|
|
updateArgs({
|
|
|
|
showFiatInTestnets: !showFiatInTestnets,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
const handleThreeBoxSyncingAllowed = () => {
|
|
|
|
updateArgs({
|
|
|
|
threeBoxSyncingAllowed: !threeBoxSyncingAllowed,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
const handleDismissSeedBackUpReminder = () => {
|
|
|
|
updateArgs({
|
|
|
|
dismissSeedBackUpReminder: !dismissSeedBackUpReminder,
|
|
|
|
});
|
|
|
|
};
|
2021-09-13 23:02:24 +02:00
|
|
|
return (
|
|
|
|
<div style={{ flex: 1, height: 500 }}>
|
|
|
|
<AdvancedTab
|
2022-01-17 19:58:12 +01:00
|
|
|
{...args}
|
|
|
|
useNonceField={useNonceField}
|
|
|
|
setUseNonceField={handleUseNonceField}
|
|
|
|
sendHexData={sendHexData}
|
|
|
|
setHexDataFeatureFlag={handleSendHexData}
|
|
|
|
advancedInlineGas={advancedInlineGas}
|
|
|
|
setAdvancedInlineGasFeatureFlag={handleAdvancedInlineGas}
|
|
|
|
showFiatInTestnets={showFiatInTestnets}
|
|
|
|
setShowFiatConversionOnTestnetsPreference={handleShowFiatInTestnets}
|
|
|
|
threeBoxSyncingAllowed={threeBoxSyncingAllowed}
|
|
|
|
setThreeBoxSyncingPermission={handleThreeBoxSyncingAllowed}
|
|
|
|
dismissSeedBackUpReminder={dismissSeedBackUpReminder}
|
|
|
|
setDismissSeedBackUpReminder={handleDismissSeedBackUpReminder}
|
2021-09-13 23:02:24 +02:00
|
|
|
ipfsGateway="ipfs-gateway"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
2021-12-01 20:27:57 +01:00
|
|
|
|
|
|
|
DefaultStory.storyName = 'Default';
|
2022-01-17 19:58:12 +01:00
|
|
|
DefaultStory.args = {
|
|
|
|
warning: 'Warning Sample',
|
|
|
|
useNonceField: false,
|
|
|
|
sendHexData: false,
|
|
|
|
advancedInlineGas: false,
|
|
|
|
showFiatInTestnets: false,
|
|
|
|
threeBoxSyncingAllowed: false,
|
|
|
|
threeBoxDisabled: false,
|
|
|
|
useLedgerLive: false,
|
|
|
|
dismissSeedBackUpReminder: false,
|
|
|
|
};
|