mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-24 19:10:22 +01:00
deprecating NetworkDisplay in favour of PickerNetwork (#20619)
This commit is contained in:
parent
a455b6ddc1
commit
b6ad074b9a
@ -22,6 +22,15 @@ import { Icon, IconName, IconSize } from '../../component-library';
|
||||
import { getProviderConfig } from '../../../ducks/metamask/metamask';
|
||||
import { getNetworkLabelKey } from '../../../helpers/utils/i18n-helper';
|
||||
|
||||
/**
|
||||
* @deprecated The `<NetworkDisplay />` component has been deprecated in favor of the new `<PickerNetwork>` component from the component-library.
|
||||
* Please update your code to use the new `<PickerNetwork>` component instead, which can be found at ui/components/component-library/picker-network/picker-network.tsx.
|
||||
* You can find documentation for the new `PickerNetwork` component in the MetaMask Storybook:
|
||||
* {@link https://metamask.github.io/metamask-storybook/?path=/docs/components-componentlibrary-pickernetwork--docs}
|
||||
* If you would like to help with the replacement of the old `NetworkDisplay` component, please submit a pull request against this GitHub issue:
|
||||
* {@link https://github.com/MetaMask/metamask-extension/issues/20485}
|
||||
*/
|
||||
|
||||
export default function NetworkDisplay({
|
||||
indicatorSize,
|
||||
disabled,
|
||||
|
@ -4,8 +4,9 @@ import {
|
||||
BUILT_IN_NETWORKS,
|
||||
NETWORK_TYPES,
|
||||
} from '../../../../shared/constants/network';
|
||||
import { Size } from '../../../helpers/constants/design-system';
|
||||
import { Severity, Size } from '../../../helpers/constants/design-system';
|
||||
|
||||
import { BannerAlert } from '../../component-library/banner-alert';
|
||||
import NetworkDisplay from '.';
|
||||
|
||||
export default {
|
||||
@ -38,13 +39,26 @@ export default {
|
||||
};
|
||||
|
||||
export const DefaultStory = (args) => (
|
||||
<NetworkDisplay
|
||||
{...args}
|
||||
targetNetwork={{
|
||||
type: args.targetNetwork,
|
||||
nickname: args.targetNetwork,
|
||||
}}
|
||||
/>
|
||||
<>
|
||||
<BannerAlert
|
||||
severity={Severity.Warning}
|
||||
title="Deprecated"
|
||||
description="The <NetworkDisplay> component has been deprecated in favor of the new <PickerNetwork> component from the component-library.
|
||||
Please update your code to use the new <PickerNetwork> component instead, which can be found at ui/components/component-library/picker-network/picker-network.tsx."
|
||||
actionButtonLabel="See details"
|
||||
actionButtonProps={{
|
||||
href: 'https://github.com/MetaMask/metamask-extension/issues/20485',
|
||||
}}
|
||||
marginBottom={4}
|
||||
/>
|
||||
<NetworkDisplay
|
||||
{...args}
|
||||
targetNetwork={{
|
||||
type: args.targetNetwork,
|
||||
nickname: args.targetNetwork,
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
DefaultStory.storyName = 'Default';
|
||||
|
Loading…
Reference in New Issue
Block a user