1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-30 08:09:15 +01:00
metamask-extension/ui/pages/settings/advanced-tab/advanced-tab.stories.js
Erik Marks a8c1756816
Remove 3box feature and delete ThreeBoxController (#14571)
* Remove 3box feature and delete ThreeBoxController

Lint locale messages

lavamoat policy updates

* Restore 3Box user trait with value `false`

The 3Box user trait has been restored and hard-coded as `false`. This
ensures that users don't get stuck in our metrics as having this trait.

A deprecation comment has been left in various places for this trait.

* Remove unused state

* Remove additional 3box-related things

* Run `yarn-deduplicate`

* Restore migration that was lost while rebasing

* Remove obsolete override

* Remove additional unused resolutions/dependencies

* Update LavaMoat policies

* Remove obsolete security advisory ignore entries

* Remove 3Box fixture builder method

* Update unit tests

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2022-10-31 13:50:50 -02:30

108 lines
3.1 KiB
JavaScript

import React from 'react';
import { useArgs } from '@storybook/client-api';
import AdvancedTab from './advanced-tab.component';
export default {
title: 'Pages/Settings/AdvancedTab',
id: __filename,
argTypes: {
warning: { control: 'text' },
useNonceField: { control: 'boolean' },
sendHexData: { control: 'boolean' },
advancedInlineGas: { 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',
},
setAdvancedInlineGasFeatureFlag: {
action: 'setAdvancedInlineGasFeatureFlag',
},
},
};
export const DefaultStory = (args) => {
const [
{
useNonceField,
sendHexData,
advancedInlineGas,
showFiatInTestnets,
dismissSeedBackUpReminder,
},
updateArgs,
] = useArgs();
const handleUseNonceField = () => {
updateArgs({
useNonceField: !useNonceField,
});
};
const handleSendHexData = () => {
updateArgs({
sendHexData: !sendHexData,
});
};
const handleAdvancedInlineGas = () => {
updateArgs({
advancedInlineGas: !advancedInlineGas,
});
};
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}
advancedInlineGas={advancedInlineGas}
setAdvancedInlineGasFeatureFlag={handleAdvancedInlineGas}
showFiatInTestnets={showFiatInTestnets}
setShowFiatConversionOnTestnetsPreference={handleShowFiatInTestnets}
dismissSeedBackUpReminder={dismissSeedBackUpReminder}
setDismissSeedBackUpReminder={handleDismissSeedBackUpReminder}
ipfsGateway="ipfs-gateway"
/>
</div>
);
};
DefaultStory.storyName = 'Default';
DefaultStory.args = {
warning: 'Warning Sample',
useNonceField: false,
sendHexData: false,
advancedInlineGas: false,
showFiatInTestnets: false,
useLedgerLive: false,
dismissSeedBackUpReminder: false,
};