From d9a0fb49aeddd2c2e7c64f7ad1c3b05a36c94133 Mon Sep 17 00:00:00 2001 From: Pavel Prichodko <14926950+prichodko@users.noreply.github.com> Date: Mon, 11 Apr 2022 21:36:31 +0200 Subject: [PATCH] refactor(react): unify imports from system --- .../components/channels/channel-group.tsx | 3 +-- .../components/channels/channel-item.tsx | 2 +- .../components/community-info/index.tsx | 4 +-- .../components/messages/index.tsx | 5 +--- .../src/components/member-sidebar/index.tsx | 3 +-- .../src/routes/chat/chat-input.tsx | 5 +--- .../src/routes/chat/chat-message.tsx | 26 ++++++++++++------- .../routes/chat/components/navbar/index.tsx | 5 +--- .../status-react/src/routes/chat/index.tsx | 5 +--- 9 files changed, 25 insertions(+), 33 deletions(-) diff --git a/packages/status-react/src/components/main-sidebar/components/channels/channel-group.tsx b/packages/status-react/src/components/main-sidebar/components/channels/channel-group.tsx index 6103d189..4168fb57 100644 --- a/packages/status-react/src/components/main-sidebar/components/channels/channel-group.tsx +++ b/packages/status-react/src/components/main-sidebar/components/channels/channel-group.tsx @@ -5,8 +5,7 @@ import * as Collapsible from '@radix-ui/react-collapsible' import { BellIcon } from '~/src/icons/bell-icon' import { ChevronDownIcon } from '~/src/icons/chevron-down-icon' import { styled } from '~/src/styles/config' -import { ContextMenu, ContextMenuTrigger } from '~/src/system/context-menu' -import { Text } from '~/src/system/text' +import { ContextMenu, ContextMenuTrigger, Text } from '~/src/system' interface Props { name: string diff --git a/packages/status-react/src/components/main-sidebar/components/channels/channel-item.tsx b/packages/status-react/src/components/main-sidebar/components/channels/channel-item.tsx index 0f465278..4fd2887e 100644 --- a/packages/status-react/src/components/main-sidebar/components/channels/channel-item.tsx +++ b/packages/status-react/src/components/main-sidebar/components/channels/channel-item.tsx @@ -1,7 +1,7 @@ import React from 'react' import { ChatMenu } from '~/src/components/chat-menu' -import { ContextMenuTrigger } from '~/src/system/context-menu' +import { ContextMenuTrigger } from '~/src/system' import { SidebarItem } from '../sidebar-item' diff --git a/packages/status-react/src/components/main-sidebar/components/community-info/index.tsx b/packages/status-react/src/components/main-sidebar/components/community-info/index.tsx index 804c6560..57f9b6b5 100644 --- a/packages/status-react/src/components/main-sidebar/components/community-info/index.tsx +++ b/packages/status-react/src/components/main-sidebar/components/community-info/index.tsx @@ -2,9 +2,7 @@ import React from 'react' import { useCommunity } from '~/src/protocol/use-community' import { styled } from '~/src/styles/config' -import { Avatar } from '~/src/system/avatar' -import { DialogTrigger } from '~/src/system/dialog' -import { Text } from '~/src/system/text' +import { Avatar, DialogTrigger, Text } from '~/src/system' import { CommunityDialog } from './community-dialog' diff --git a/packages/status-react/src/components/main-sidebar/components/messages/index.tsx b/packages/status-react/src/components/main-sidebar/components/messages/index.tsx index 297e1c85..12c2bd84 100644 --- a/packages/status-react/src/components/main-sidebar/components/messages/index.tsx +++ b/packages/status-react/src/components/main-sidebar/components/messages/index.tsx @@ -1,10 +1,7 @@ import React from 'react' import { EditIcon } from '~/src/icons/edit-icon' -import { Box } from '~/src/system' -import { Grid } from '~/src/system/grid' -import { Heading } from '~/src/system/heading' -import { IconButton } from '~/src/system/icon-button' +import { Box, Grid, Heading, IconButton } from '~/src/system' import { ChatItem } from './chat-item' diff --git a/packages/status-react/src/components/member-sidebar/index.tsx b/packages/status-react/src/components/member-sidebar/index.tsx index b287119c..70a36893 100644 --- a/packages/status-react/src/components/member-sidebar/index.tsx +++ b/packages/status-react/src/components/member-sidebar/index.tsx @@ -1,8 +1,7 @@ import React from 'react' import { styled } from '~/src/styles/config' -import { Grid } from '~/src/system' -import { Heading } from '~/src/system/heading' +import { Grid, Heading } from '~/src/system' import { MemberGroup } from './member-group' import { MemberItem } from './member-item' diff --git a/packages/status-react/src/routes/chat/chat-input.tsx b/packages/status-react/src/routes/chat/chat-input.tsx index 2265555d..a9b873f7 100644 --- a/packages/status-react/src/routes/chat/chat-input.tsx +++ b/packages/status-react/src/routes/chat/chat-input.tsx @@ -8,10 +8,7 @@ import { ImageIcon } from '~/src/icons/image-icon' import { ReplyIcon } from '~/src/icons/reply-icon' import { StickerIcon } from '~/src/icons/sticker-icon' import { styled } from '~/src/styles/config' -import { Icon, Image } from '~/src/system' -import { Flex } from '~/src/system/flex' -import { IconButton } from '~/src/system/icon-button' -import { Text } from '~/src/system/text' +import { Flex, Icon, IconButton, Image, Text } from '~/src/system' import type { Message } from '~/src/contexts/chat-context' diff --git a/packages/status-react/src/routes/chat/chat-message.tsx b/packages/status-react/src/routes/chat/chat-message.tsx index ce53f79c..0492b9e1 100644 --- a/packages/status-react/src/routes/chat/chat-message.tsx +++ b/packages/status-react/src/routes/chat/chat-message.tsx @@ -8,15 +8,23 @@ import { ReactionIcon } from '~/src/icons/reaction-icon' import { ReplyIcon } from '~/src/icons/reply-icon' import { TrashIcon } from '~/src/icons/trash-icon' import { styled } from '~/src/styles/config' -import { AlertDialog, AlertDialogTrigger, Box } from '~/src/system' -import { Avatar } from '~/src/system/avatar' -import { ContextMenu, ContextMenuTrigger } from '~/src/system/context-menu' -import { DropdownMenu, DropdownMenuTrigger } from '~/src/system/dropdown-menu' -import { Flex } from '~/src/system/flex' -import { IconButton } from '~/src/system/icon-button' -import { Image } from '~/src/system/image' -import { Text } from '~/src/system/text' -import { Tooltip } from '~/src/system/tooltip' +import { + AlertDialog, + AlertDialogTrigger, + Avatar, + Box, + Button, + ContextMenu, + ContextMenuTrigger, + DropdownMenu, + DropdownMenuTrigger, + EmojiHash, + Flex, + IconButton, + Image, + Text, + Tooltip, +} from '~/src/system' interface Props { reply?: 'text' | 'image' | 'image-text' diff --git a/packages/status-react/src/routes/chat/components/navbar/index.tsx b/packages/status-react/src/routes/chat/components/navbar/index.tsx index 2a747f65..fa060c31 100644 --- a/packages/status-react/src/routes/chat/components/navbar/index.tsx +++ b/packages/status-react/src/routes/chat/components/navbar/index.tsx @@ -9,10 +9,7 @@ import { DotsIcon } from '~/src/icons/dots-icon' import { GroupIcon } from '~/src/icons/group-icon' import { useChat } from '~/src/protocol/use-chat' import { styled } from '~/src/styles/config' -import { Separator } from '~/src/system' -import { DropdownMenuTrigger } from '~/src/system/dropdown-menu' -import { Flex } from '~/src/system/flex' -import { IconButton } from '~/src/system/icon-button' +import { DropdownMenuTrigger, Flex, IconButton, Separator } from '~/src/system' import { ChatInfo } from '../chat-info' diff --git a/packages/status-react/src/routes/chat/index.tsx b/packages/status-react/src/routes/chat/index.tsx index a71bef4b..341dc128 100644 --- a/packages/status-react/src/routes/chat/index.tsx +++ b/packages/status-react/src/routes/chat/index.tsx @@ -4,10 +4,7 @@ import { MemberSidebar } from '~/src/components/member-sidebar' import { useAppState } from '~/src/contexts/app-context' import { ChatProvider } from '~/src/contexts/chat-context' import { styled } from '~/src/styles/config' -import { Avatar } from '~/src/system/avatar' -import { Flex } from '~/src/system/flex' -import { Heading } from '~/src/system/heading' -import { Text } from '~/src/system/text' +import { Avatar, Flex, Heading, Text } from '~/src/system' import { ChatInput } from './chat-input' import { ChatMessage } from './chat-message'