From 98db83fb1809f4d63acd54a3257dd8fd576752b9 Mon Sep 17 00:00:00 2001 From: Pavel Prichodko <14926950+prichodko@users.noreply.github.com> Date: Fri, 20 Jan 2023 15:46:44 +0100 Subject: [PATCH] fix icons import --- .../components/src/accordion/accordion.tsx | 4 +- .../src/accordion/accordionItem.tsx | 6 +- packages/components/src/composer/composer.tsx | 15 +-- .../src/icon-button/icon-button.stories.tsx | 4 +- .../components/src/icons/icons.stories.tsx | 92 +++++++++++++++---- 5 files changed, 85 insertions(+), 36 deletions(-) diff --git a/packages/components/src/accordion/accordion.tsx b/packages/components/src/accordion/accordion.tsx index e8a73067..e1fd7f88 100644 --- a/packages/components/src/accordion/accordion.tsx +++ b/packages/components/src/accordion/accordion.tsx @@ -1,6 +1,6 @@ import React from 'react' -import { ChevronIcon } from '@status-im/icons' +import { ChevronDown } from '@status-im/icons/20' import { Stack } from '@tamagui/core' import { AnimatePresence } from 'tamagui' @@ -58,7 +58,7 @@ const Accordion = ({ }, ]} > - + )} - {channelStatus === 'muted' && ( - - )} + {channelStatus === 'muted' && } )} diff --git a/packages/components/src/composer/composer.tsx b/packages/components/src/composer/composer.tsx index 45cb8b8b..8f2b99c7 100644 --- a/packages/components/src/composer/composer.tsx +++ b/packages/components/src/composer/composer.tsx @@ -1,9 +1,4 @@ -import { - AudioIcon, - FormatIcon, - ImageIcon, - ReactionIcon, -} from '@status-im/icons' +import { Audio, Format, Image, Reaction } from '@status-im/icons/20' import { Stack, XStack, YStack } from 'tamagui' import { IconButton } from '../icon-button' @@ -39,11 +34,11 @@ const Composer = (props: BaseProps) => { - } /> - } /> - } /> + } /> + } /> + } /> - } /> + } /> ) diff --git a/packages/components/src/icon-button/icon-button.stories.tsx b/packages/components/src/icon-button/icon-button.stories.tsx index cd5ee552..6fa7028e 100644 --- a/packages/components/src/icon-button/icon-button.stories.tsx +++ b/packages/components/src/icon-button/icon-button.stories.tsx @@ -1,4 +1,4 @@ -import { OptionsIcon } from '@status-im/icons' +import { Options } from '@status-im/icons/20' import { IconButton } from './icon-button' @@ -15,7 +15,7 @@ type Story = StoryObj // More on writing stories with args: https://storybook.js.org/docs/7.0/react/writing-stories/args export const Default: Story = { args: { - icon: , + icon: , }, } diff --git a/packages/components/src/icons/icons.stories.tsx b/packages/components/src/icons/icons.stories.tsx index d2c18596..3f8f5b24 100644 --- a/packages/components/src/icons/icons.stories.tsx +++ b/packages/components/src/icons/icons.stories.tsx @@ -1,10 +1,13 @@ /* eslint-disable eslint-comments/disable-enable-pair */ /* eslint-disable @typescript-eslint/ban-ts-comment */ -import * as icons from '@status-im/icons' +import * as icons12 from '@status-im/icons/12' +import * as icons16 from '@status-im/icons/16' +import * as icons20 from '@status-im/icons/20' +import * as reactions from '@status-im/icons/reactions' import { Paragraph } from '../typography' -import type { IconProps } from '@status-im/icons' +import type { IconProps } from '@status-im/icons/types' import type { Meta, StoryObj } from '@storybook/react' import type React from 'react' @@ -26,23 +29,76 @@ export const All: Story = { args: {}, render: () => { return ( -
- {Object.keys(icons).map(name => { - // @ts-ignore - // eslint-disable-next-line import/namespace - const Icon = icons[name] as React.FunctionComponent + <> +
+ {Object.keys(icons12).map(name => { + // @ts-ignore + // eslint-disable-next-line import/namespace + const Icon = icons[name] as React.FunctionComponent - return ( -
- - {unpascal(name)} -
- ) - })} -
+ return ( +
+ + {unpascal(name)} +
+ ) + })} +
+
+ {Object.keys(icons16).map(name => { + // @ts-ignore + // eslint-disable-next-line import/namespace + const Icon = icons[name] as React.FunctionComponent + + return ( +
+ + {unpascal(name)} +
+ ) + })} +
+
+ {Object.keys(icons20).map(name => { + // @ts-ignore + // eslint-disable-next-line import/namespace + const Icon = icons[name] as React.FunctionComponent + + return ( +
+ + {unpascal(name)} +
+ ) + })} +
+
+ {Object.keys(reactions).map(name => { + // @ts-ignore + // eslint-disable-next-line import/namespace + const Icon = icons[name] as React.FunctionComponent + + return ( +
+ + {unpascal(name)} +
+ ) + })} +
+ ) }, }