1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-02 06:07:06 +01:00
metamask-extension/ui/components/app/network-display/network-display.stories.js
ryanml 0bc1eeaf37
Deprecating the Rinkeby, Ropsten, and Kovan test networks (#15989)
* Deprecating Rinkeby, setting default debug network to Goerli

* Deprecating Ropsten and Kovan

* Conflict fix

* Remove unused localization, test fixes

* Add migration for moving used deprecated testnets to custom networks

* Fix migrator test

* Add more unit tests

* Migration updates provider type to rpc if deprecated network is selected

* Migration fully and correctly updates the provider if selected network is a deprecated testnet

* Continue to show deprecation warning on each of rinkeby, ropsten and kovan

* Add rpcUrl deprecation message to loading screen

* Removing mayBeFauceting prop

Co-authored-by: Dan Miller <danjm.com@gmail.com>
2022-09-28 20:26:01 -07:00

94 lines
2.0 KiB
JavaScript

import React from 'react';
import {
BUILT_IN_NETWORKS,
NETWORK_TYPES,
} from '../../../../shared/constants/network';
import { SIZES } from '../../../helpers/constants/design-system';
import NetworkDisplay from '.';
export default {
title: 'Components/App/NetworkDisplay',
id: __filename,
argTypes: {
indicatorSize: {
control: 'select',
options: Object.values(SIZES),
},
labelProps: {
control: 'object',
},
targetNetwork: {
control: 'select',
options: [...Object.keys(BUILT_IN_NETWORKS), NETWORK_TYPES.RPC],
},
disabled: {
control: 'boolean',
},
onClick: {
action: 'onClick',
description:
'The onClick event handler of the NetworkDisplay. If it is not passed it is assumed that the NetworkDisplay SHOULD NOT be interactive and removes the caret and changes the border color of the NetworkDisplay to border-muted',
},
},
args: {
targetNetwork: 'goerli',
},
};
export const DefaultStory = (args) => (
<NetworkDisplay
{...args}
targetNetwork={{
type: args.targetNetwork,
nickname: args.targetNetwork,
}}
/>
);
DefaultStory.storyName = 'Default';
export const TargetNetwork = (args) => {
const targetNetworkArr = [
...Object.keys(BUILT_IN_NETWORKS),
NETWORK_TYPES.RPC,
];
return (
<>
{Object.values(targetNetworkArr).map((variant) => (
<NetworkDisplay
{...args}
key={variant}
targetNetwork={{
type: variant,
nickname: variant,
}}
/>
))}
</>
);
};
export const DisplayOnly = (args) => {
const targetNetworkArr = [
...Object.keys(BUILT_IN_NETWORKS),
NETWORK_TYPES.RPC,
];
return (
<>
{Object.values(targetNetworkArr).map((variant) => (
<NetworkDisplay
{...args}
key={variant}
targetNetwork={{
type: variant,
nickname: variant,
}}
onClick={undefined}
/>
))}
</>
);
};