From a9627951fc342fee7188f37acf0ebfc42d226b76 Mon Sep 17 00:00:00 2001 From: Binij Shrestha Date: Thu, 25 May 2023 16:35:06 +0545 Subject: [PATCH] replace deprecated and fix lint --- shared/constants/network.ts | 8 +++---- .../avatar-network/avatar-network.stories.tsx | 22 +++++++++---------- .../avatar-network/avatar-network.tsx | 4 ++-- ui/components/ui/box/box.d.ts | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/shared/constants/network.ts b/shared/constants/network.ts index b9b55d58f01d..1a1251d286f2 100644 --- a/shared/constants/network.ts +++ b/shared/constants/network.ts @@ -3,14 +3,14 @@ import { capitalize, pick } from 'lodash'; * A type representing any valid value for 'type' for setProviderType and other * methods that add or manipulate networks in MetaMask state. */ -export type NetworkType = typeof NETWORK_TYPES[keyof typeof NETWORK_TYPES]; +export type NetworkType = (typeof NETWORK_TYPES)[keyof typeof NETWORK_TYPES]; /** * A union type of all possible hard-coded chain ids. This type is not * exhaustive and cannot be used for typing chainId in areas where the user or * dapp may specify any chainId. */ -export type ChainId = typeof CHAIN_IDS[keyof typeof CHAIN_IDS]; +export type ChainId = (typeof CHAIN_IDS)[keyof typeof CHAIN_IDS]; /** * A type that is a union type of all possible hardcoded currency symbols. @@ -18,13 +18,13 @@ export type ChainId = typeof CHAIN_IDS[keyof typeof CHAIN_IDS]; * or dapp may supply their own symbol. */ export type CurrencySymbol = - typeof CURRENCY_SYMBOLS[keyof typeof CURRENCY_SYMBOLS]; + (typeof CURRENCY_SYMBOLS)[keyof typeof CURRENCY_SYMBOLS]; /** * Test networks have special symbols that combine the network name and 'ETH' * so that they are distinct from mainnet and other networks that use 'ETH'. */ export type TestNetworkCurrencySymbol = - typeof TEST_NETWORK_TICKER_MAP[keyof typeof TEST_NETWORK_TICKER_MAP]; + (typeof TEST_NETWORK_TICKER_MAP)[keyof typeof TEST_NETWORK_TICKER_MAP]; /** * An object containing preferences for an RPC definition diff --git a/ui/components/component-library/avatar-network/avatar-network.stories.tsx b/ui/components/component-library/avatar-network/avatar-network.stories.tsx index d5947c2a981a..36b5eee12d28 100644 --- a/ui/components/component-library/avatar-network/avatar-network.stories.tsx +++ b/ui/components/component-library/avatar-network/avatar-network.stories.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; +import { StoryFn, Meta } from '@storybook/react'; import { - DISPLAY, + Display, TextColor, BackgroundColor, BorderColor, @@ -56,19 +56,19 @@ export default { size: AvatarNetworkSize.Md, showHalo: false, }, -} as ComponentMeta; +} as Meta; -const Template: ComponentStory = (args) => { +const Template: StoryFn = (args) => { return ; }; export const DefaultStory = Template.bind({}); DefaultStory.storyName = 'Default'; -export const SizeStory: ComponentStory = (args) => ( +export const SizeStory: StoryFn = (args) => ( <> = (args) => ( - + @@ -95,8 +95,8 @@ Name.args = { src: '', }; -export const Src: ComponentStory = (args) => ( - +export const Src: StoryFn = (args) => ( + @@ -114,10 +114,10 @@ ShowHalo.args = { showHalo: true, }; -export const ColorBackgroundColorAndBorderColor: ComponentStory< +export const ColorBackgroundColorAndBorderColor: StoryFn< typeof AvatarNetwork > = (args) => ( - + { } declare const Box: React.FC; -export default Box; \ No newline at end of file +export default Box;