From 6739198591701c839b163fe9183a0f18cd9086dd Mon Sep 17 00:00:00 2001 From: Nothingg Date: Mon, 30 Oct 2023 10:30:28 -0500 Subject: [PATCH] Modal, Drawer, Portal fix and redesign --- src/app/App.tsx | 100 ++++++++++++------ .../ThemeProvider/ui/ThemeProvider.tsx | 2 +- .../ProfileCard.redesigned.tsx | 2 +- .../Rating/ui/RatingCard/RatingCard.tsx | 4 +- .../ArticlePageGreetings.tsx | 2 +- .../ui/LoginModal/LoginModal.tsx | 2 +- .../AvatarDropdown/ui/AvatarDropdown.tsx | 3 +- .../ui/OpenNotificationsList.tsx | 2 +- .../features/service/updateFeatureFlags.ts | 2 + .../Drawer/Drawer.module.scss | 13 ++- .../Drawer/Drawer.stories.tsx | 6 +- .../Drawer/Drawer.tsx | 21 ++-- .../Drawer/index.ts | 0 .../Modal/Modal.module.scss | 14 +++ .../Modal/Modal.stories.tsx | 0 .../Modal/Modal.tsx | 21 ++-- .../{deprecated => redesigned}/Modal/index.ts | 0 src/shared/ui/redesigned/Portal/Portal.tsx | 12 ++- .../ui/redesigned/Skeleton/Skeleton.tsx | 5 +- src/widgets/Navbar/ui/Navbar/Navbar.tsx | 45 ++++++-- 20 files changed, 183 insertions(+), 73 deletions(-) rename src/shared/ui/{deprecated => redesigned}/Drawer/Drawer.module.scss (75%) rename src/shared/ui/{deprecated => redesigned}/Drawer/Drawer.stories.tsx (88%) rename src/shared/ui/{deprecated => redesigned}/Drawer/Drawer.tsx (87%) rename src/shared/ui/{deprecated => redesigned}/Drawer/index.ts (100%) rename src/shared/ui/{deprecated => redesigned}/Modal/Modal.module.scss (71%) rename src/shared/ui/{deprecated => redesigned}/Modal/Modal.stories.tsx (100%) rename src/shared/ui/{deprecated => redesigned}/Modal/Modal.tsx (78%) rename src/shared/ui/{deprecated => redesigned}/Modal/index.ts (100%) diff --git a/src/app/App.tsx b/src/app/App.tsx index 0fb6b5b..afcfa81 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -1,14 +1,15 @@ import { FC, Suspense, useEffect } from 'react'; import { classNames } from '@/shared/lib/classNames/classNames'; import { useAppDispatch } from '@/shared/lib/hooks/useAppDispatch'; -import { Navbar } from '@/widgets/Navbar'; -import { Aside } from '@/widgets/Aside'; import { useAppSelector } from '@/shared/lib/hooks/useAppSelector'; -import { getUserMounted, initAuthData } from '@/entities/User'; +import { Skeleton } from '@/shared/ui/redesigned/Skeleton'; +// import { Skeleton as SkeletonDeprecatedLoading } from '@/shared/ui/deprecated/Skeleton'; +import { MainLayout } from '@/shared/layouts/MainLayout'; import { useTheme } from '@/shared/lib/hooks/useTheme'; import { ToggleFeatures } from '@/shared/lib/features'; -import { Skeleton } from '@/shared/ui/deprecated/Skeleton'; -import { MainLayout } from '@/shared/layouts/MainLayout'; +import { getUserMounted, initAuthData } from '@/entities/User'; +import { Navbar } from '@/widgets/Navbar'; +import { Aside } from '@/widgets/Aside'; import { AppRouter } from './providers/RouterProvider'; const App: FC = () => { @@ -21,43 +22,74 @@ const App: FC = () => { dispatch(initAuthData()); }, [dispatch, theme]); + /** + * @deprecated + */ + // const SkeletonDeprecated = ( + //
+ // + //
+ // + //
+ //
+ // ); + + const SkeletonRedesigned = ( +
+
+ + } + aside={} + content={} + /> + +
+
+ ); + if (!_mounted) { return ( -
- -
- -
-
+ ); } + /** + * @deprecated + */ + const AppDeprecated = ( +
+ + +
+
+
+
+ ); + + const AppRedesigned = ( +
+ + } + aside={
+ ); + return ( - - } - aside={