From dcc8c34b051b04356c9d5dfece393a9598bef5fc Mon Sep 17 00:00:00 2001 From: Victoria Borovskaya <110840305+VictoriaBorovskaya@users.noreply.github.com> Date: Wed, 27 Dec 2023 20:40:06 +0600 Subject: [PATCH] =?UTF-8?q?=D1=80=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D0=B3=20=D0=B8=20=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B1=D0=B0=D0=B3=D0=BE=D0=B2=20(#91)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/providers/router/router.paths.ts | 5 ++++- .../notifications/DummyNotifications.tsx | 4 ++-- src/entities/dummy/position/DummyPosition.tsx | 4 ++-- src/entities/notification/Notification.tsx | 4 ++-- src/entities/user/index.ts | 2 +- src/entities/user/info/index.ts | 1 - .../profile-card/ProfileCard.desktop.tsx | 6 +++--- .../user}/profile-card/ProfileCard.tsx | 2 +- .../user}/profile-card/ProfileCardNotAuth.tsx | 5 ++--- .../user}/profile-card/ProfileCardUser.tsx | 8 +++++--- src/entities/user/profile-card/index.ts | 3 +++ .../user}/profile-card/notAuth.png | Bin .../statistic/Statistic.tsx} | 4 ++-- .../user/profile-card/statistic/index.ts | 1 + src/features/chat/create/CreateMessage.tsx | 9 ++------- .../NotificationButton.tsx} | 2 +- src/features/notifications/button/index.ts | 1 + src/features/notifications/index.ts | 2 +- .../notification-settings/SettingsList.tsx | 18 +++++++++--------- .../notifications/notification/index.ts | 1 - src/features/project/search/SearchProject.tsx | 5 +++-- src/pages/chats/ChatsPage.desktop.tsx | 6 +++++- src/pages/chats/ChatsPageBase.tsx | 4 ++-- src/pages/profile/ProfileMePage.tsx | 4 ++-- src/pages/profile/ProfilePage.desktop.tsx | 3 +-- src/pages/profile/ProfileUserPageBase.tsx | 2 +- src/pages/search/ui/SearchPage.desktop.tsx | 2 +- src/pages/search/ui/SearchPage.tsx | 2 +- src/pages/setting/settings/SettingsPage.tsx | 18 +++++++++--------- src/shared/ui/DummyImage/DummyImage.tsx | 7 +++++++ .../image.svg} | 0 src/shared/ui/DummyImage/index.ts | 1 + .../NotificationImage/NotificationImage.tsx | 7 ------- src/shared/ui/NotificationImage/index.ts | 1 - src/shared/ui/STag/STag.tsx | 4 ++-- src/shared/ui/STextarea/STextarea.tsx | 13 ++++++++----- src/shared/ui/SearchInput/SearchInput.tsx | 5 +++-- src/shared/ui/SettingsItem/index.ts | 1 - .../SettingItem.tsx => Switcher/Switcher.tsx} | 4 ++-- src/shared/ui/Switcher/index.ts | 1 + src/widgets/chats-list/ChatsList.tsx | 4 ++-- src/widgets/profile-card/index.ts | 3 --- 42 files changed, 93 insertions(+), 86 deletions(-) delete mode 100644 src/entities/user/info/index.ts rename src/{widgets => entities/user}/profile-card/ProfileCard.desktop.tsx (97%) rename src/{widgets => entities/user}/profile-card/ProfileCard.tsx (88%) rename src/{widgets => entities/user}/profile-card/ProfileCardNotAuth.tsx (89%) rename src/{widgets => entities/user}/profile-card/ProfileCardUser.tsx (88%) create mode 100644 src/entities/user/profile-card/index.ts rename src/{widgets => entities/user}/profile-card/notAuth.png (100%) rename src/entities/user/{info/Info.tsx => profile-card/statistic/Statistic.tsx} (91%) create mode 100644 src/entities/user/profile-card/statistic/index.ts rename src/features/notifications/{notification/Notification.tsx => button/NotificationButton.tsx} (95%) create mode 100644 src/features/notifications/button/index.ts delete mode 100644 src/features/notifications/notification/index.ts create mode 100644 src/shared/ui/DummyImage/DummyImage.tsx rename src/shared/ui/{NotificationImage/notifications.svg => DummyImage/image.svg} (100%) create mode 100644 src/shared/ui/DummyImage/index.ts delete mode 100644 src/shared/ui/NotificationImage/NotificationImage.tsx delete mode 100644 src/shared/ui/NotificationImage/index.ts delete mode 100644 src/shared/ui/SettingsItem/index.ts rename src/shared/ui/{SettingsItem/SettingItem.tsx => Switcher/Switcher.tsx} (90%) create mode 100644 src/shared/ui/Switcher/index.ts delete mode 100644 src/widgets/profile-card/index.ts diff --git a/src/app/providers/router/router.paths.ts b/src/app/providers/router/router.paths.ts index 34be13e6..7fa0e601 100644 --- a/src/app/providers/router/router.paths.ts +++ b/src/app/providers/router/router.paths.ts @@ -84,7 +84,10 @@ export const routerPaths = [ path: PATHS.addProject, Component: AddProjectPage, }, - // { path: PATHS.dialog, Component: DialogPage } + // { + // path: PATHS.dialog, + // Component: DialogPage, + // }, { path: PATHS.dialog, Component: NotFoundPage, diff --git a/src/entities/dummy/notifications/DummyNotifications.tsx b/src/entities/dummy/notifications/DummyNotifications.tsx index 221132fd..ff52694d 100644 --- a/src/entities/dummy/notifications/DummyNotifications.tsx +++ b/src/entities/dummy/notifications/DummyNotifications.tsx @@ -1,13 +1,13 @@ import { Text } from '@chakra-ui/react'; -import { NotificationImage } from '~/shared/ui/NotificationImage'; +import { DummyImage } from '~/shared/ui/DummyImage'; import { DummyWrapper } from '../base'; export function DummyNotifications() { return ( - + Нет уведомлений diff --git a/src/entities/dummy/position/DummyPosition.tsx b/src/entities/dummy/position/DummyPosition.tsx index 9c5b45b8..40a2b447 100644 --- a/src/entities/dummy/position/DummyPosition.tsx +++ b/src/entities/dummy/position/DummyPosition.tsx @@ -1,13 +1,13 @@ import { Text } from '@chakra-ui/react'; -import { NotificationImage } from '~/shared/ui/NotificationImage'; +import { DummyImage } from '~/shared/ui/DummyImage'; import { DummyWrapper } from '../base'; export function DummyPosition() { return ( - + Нет заявок diff --git a/src/entities/notification/Notification.tsx b/src/entities/notification/Notification.tsx index a7b062fd..c6fef24f 100644 --- a/src/entities/notification/Notification.tsx +++ b/src/entities/notification/Notification.tsx @@ -6,7 +6,7 @@ import { generatePath, Link } from 'react-router-dom'; import type { GetNotificationResponse } from '~/shared/api'; import { useAuth, useIsMobile } from '~/shared/hooks'; import { PATHS } from '~/shared/lib/router'; -import { NotificationImage } from '~/shared/ui/NotificationImage'; +import { DummyImage } from '~/shared/ui/DummyImage'; import { useGetNotification } from './api'; import { NOTIFICATIONS_MESSAGE, NOTIFICATIONS } from './Notification.constants'; @@ -50,7 +50,7 @@ export function Notification({ notificationId, read }: NotificationProps) { grow={1} > - + {notification && ( diff --git a/src/entities/user/index.ts b/src/entities/user/index.ts index 6d8a2f57..ffaa060e 100644 --- a/src/entities/user/index.ts +++ b/src/entities/user/index.ts @@ -1,4 +1,4 @@ export * from './reviews'; export * from './avatar'; -export * from './info'; export * from './api'; +export * from './profile-card'; diff --git a/src/entities/user/info/index.ts b/src/entities/user/info/index.ts deleted file mode 100644 index 3d93d87e..00000000 --- a/src/entities/user/info/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Info'; diff --git a/src/widgets/profile-card/ProfileCard.desktop.tsx b/src/entities/user/profile-card/ProfileCard.desktop.tsx similarity index 97% rename from src/widgets/profile-card/ProfileCard.desktop.tsx rename to src/entities/user/profile-card/ProfileCard.desktop.tsx index 87bb2fd3..52108f47 100644 --- a/src/widgets/profile-card/ProfileCard.desktop.tsx +++ b/src/entities/user/profile-card/ProfileCard.desktop.tsx @@ -9,11 +9,11 @@ import { CircularProgressLabel, } from '@chakra-ui/react'; -import { Info } from '~/entities/user'; - import { useIsMobile } from '~/shared/hooks'; import { STag } from '~/shared/ui/STag'; +import { Statistic } from './statistic'; + export function ProfileCardDesktop() { const isMobile = useIsMobile(); const dummyFillProfile = 60; @@ -48,7 +48,7 @@ export function ProfileCardDesktop() { - + Специализация и навыки diff --git a/src/widgets/profile-card/ProfileCard.tsx b/src/entities/user/profile-card/ProfileCard.tsx similarity index 88% rename from src/widgets/profile-card/ProfileCard.tsx rename to src/entities/user/profile-card/ProfileCard.tsx index 836d5f24..5e873f2e 100644 --- a/src/widgets/profile-card/ProfileCard.tsx +++ b/src/entities/user/profile-card/ProfileCard.tsx @@ -1,6 +1,6 @@ import { Skeleton } from '@chakra-ui/react'; -import { useGetProfile } from '~/entities/user'; +import { useGetProfile } from '../api'; import { ProfileCardUser } from './ProfileCardUser'; diff --git a/src/widgets/profile-card/ProfileCardNotAuth.tsx b/src/entities/user/profile-card/ProfileCardNotAuth.tsx similarity index 89% rename from src/widgets/profile-card/ProfileCardNotAuth.tsx rename to src/entities/user/profile-card/ProfileCardNotAuth.tsx index 812250cc..f0f4fdee 100644 --- a/src/widgets/profile-card/ProfileCardNotAuth.tsx +++ b/src/entities/user/profile-card/ProfileCardNotAuth.tsx @@ -1,8 +1,7 @@ import { Text, Flex, Image, Center } from '@chakra-ui/react'; -import { Info } from '~/entities/user'; - import NotAuth from './notAuth.png'; +import { Statistic } from './statistic'; const defaultName = 'Гость'; @@ -32,7 +31,7 @@ export function ProfileCardNotAuth() { {defaultName} - + ); } diff --git a/src/widgets/profile-card/ProfileCardUser.tsx b/src/entities/user/profile-card/ProfileCardUser.tsx similarity index 88% rename from src/widgets/profile-card/ProfileCardUser.tsx rename to src/entities/user/profile-card/ProfileCardUser.tsx index 2a6b691b..58a8a804 100644 --- a/src/widgets/profile-card/ProfileCardUser.tsx +++ b/src/entities/user/profile-card/ProfileCardUser.tsx @@ -1,12 +1,14 @@ import { Text, Flex, Center, SkeletonText, Button, Avatar } from '@chakra-ui/react'; import { Link } from 'react-router-dom'; -import { Info, useGetAvatar, useIsAvatarExist, useUserStatistic } from '~/entities/user'; - import type { GetUserResponse } from '~/shared/api/model'; import { useAuth } from '~/shared/hooks'; import { PATHS } from '~/shared/lib/router'; +import { useGetAvatar, useIsAvatarExist, useUserStatistic } from '../api'; + +import { Statistic } from './statistic'; + interface ProfileCardProps { user: GetUserResponse; } @@ -61,7 +63,7 @@ export function ProfileCardUser({ user }: ProfileCardProps) { {name} )} - + {userId === user.id && (