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={}
+ content={}
+ />
+
+
+ );
+
return (
-
- }
- aside={}
- content={}
- // toolbar={asdasdasd
}
- />
-
-
- )}
- off={(
-
- )}
+ on={AppRedesigned}
+ off={AppDeprecated}
/>
);
};
diff --git a/src/app/providers/ThemeProvider/ui/ThemeProvider.tsx b/src/app/providers/ThemeProvider/ui/ThemeProvider.tsx
index c3439a5..bb1c859 100644
--- a/src/app/providers/ThemeProvider/ui/ThemeProvider.tsx
+++ b/src/app/providers/ThemeProvider/ui/ThemeProvider.tsx
@@ -11,7 +11,7 @@ interface ThemeProviderProps {
const ThemeProvider: FC = ({ children, initialTheme }) => {
const { theme: defaultTheme } = useJsonSettings();
const [themeInited, setThemeInited] = useState(false);
- const [theme, setTheme] = useState(initialTheme || defaultTheme || Theme.BLUE);
+ const [theme, setTheme] = useState(initialTheme || defaultTheme || Theme.DARK);
useEffect(() => {
if (!themeInited && defaultTheme) {
diff --git a/src/entities/Profile/ui/ProfileCardRedesigned/ProfileCard.redesigned.tsx b/src/entities/Profile/ui/ProfileCardRedesigned/ProfileCard.redesigned.tsx
index 6a88732..f2fc9f3 100644
--- a/src/entities/Profile/ui/ProfileCardRedesigned/ProfileCard.redesigned.tsx
+++ b/src/entities/Profile/ui/ProfileCardRedesigned/ProfileCard.redesigned.tsx
@@ -75,7 +75,7 @@ export const ProfileCardRedesigned: FC = (props) => {
{data?.avatar && (
-
+
)}
diff --git a/src/entities/Rating/ui/RatingCard/RatingCard.tsx b/src/entities/Rating/ui/RatingCard/RatingCard.tsx
index 63ae554..1367ab0 100644
--- a/src/entities/Rating/ui/RatingCard/RatingCard.tsx
+++ b/src/entities/Rating/ui/RatingCard/RatingCard.tsx
@@ -6,10 +6,10 @@ import { Card } from '@/shared/ui/deprecated/Card';
import { HStack, VStack } from '@/shared/ui/redesigned/Stack';
import { Text } from '@/shared/ui/deprecated/Text';
import { StarRating } from '@/shared/ui/deprecated/StarRating';
-import { Modal } from '@/shared/ui/deprecated/Modal';
+import { Modal } from '@/shared/ui/redesigned/Modal';
import { Input } from '@/shared/ui/deprecated/Input';
import { Button, ButtonTheme } from '@/shared/ui/deprecated/Button';
-import { Drawer } from '@/shared/ui/deprecated/Drawer';
+import { Drawer } from '@/shared/ui/redesigned/Drawer';
import cls from './RatingCard.module.scss';
interface RatingCardProps {
diff --git a/src/features/ArticlePageGreetings/ui/ArticlePageGreetings/ArticlePageGreetings.tsx b/src/features/ArticlePageGreetings/ui/ArticlePageGreetings/ArticlePageGreetings.tsx
index d41a7c6..69319f8 100644
--- a/src/features/ArticlePageGreetings/ui/ArticlePageGreetings/ArticlePageGreetings.tsx
+++ b/src/features/ArticlePageGreetings/ui/ArticlePageGreetings/ArticlePageGreetings.tsx
@@ -1,6 +1,6 @@
import { FC, memo, useEffect, useState } from 'react';
import { useAppTranslation } from '@/shared/lib/hooks/useAppTranslation';
-import { Modal } from '@/shared/ui/deprecated/Modal';
+import { Modal } from '@/shared/ui/redesigned/Modal';
import { VStack } from '@/shared/ui/redesigned/Stack';
import { Text } from '@/shared/ui/deprecated/Text';
import { useAppDispatch } from '@/shared/lib/hooks/useAppDispatch';
diff --git a/src/features/AuthByUserName/ui/LoginModal/LoginModal.tsx b/src/features/AuthByUserName/ui/LoginModal/LoginModal.tsx
index 8a0cf4b..43783e9 100644
--- a/src/features/AuthByUserName/ui/LoginModal/LoginModal.tsx
+++ b/src/features/AuthByUserName/ui/LoginModal/LoginModal.tsx
@@ -1,7 +1,7 @@
import { Dispatch, FC, SetStateAction, Suspense } from 'react';
import { classNames } from '@/shared/lib/classNames/classNames';
import { Loader } from '@/shared/ui/deprecated/Loader';
-import { Modal } from '@/shared/ui/deprecated/Modal';
+import { Modal } from '@/shared/ui/redesigned/Modal';
import { LoginFormLazy } from '../LoginForm/LoginForm.lazy';
interface LoginModalProps {
diff --git a/src/features/AvatarDropdown/ui/AvatarDropdown.tsx b/src/features/AvatarDropdown/ui/AvatarDropdown.tsx
index 136505a..2b3836e 100644
--- a/src/features/AvatarDropdown/ui/AvatarDropdown.tsx
+++ b/src/features/AvatarDropdown/ui/AvatarDropdown.tsx
@@ -12,6 +12,7 @@ import { Text as TextDeprecated, TextTheme as TextThemeDeprecated } from '@/shar
import { getUserAuthData, isUserAdmin, isUserManager, userActions } from '@/entities/User';
import { ToggleFeatures } from '@/shared/lib/features';
import { Avatar } from '@/shared/ui/redesigned/Avatar';
+import { Text } from '@/shared/ui/redesigned/Text';
interface AvatarDropdownProps {
className?: string;
@@ -71,7 +72,7 @@ export const AvatarDropdown: FC = memo(({ className, transl
position="bottom right"
component={(
-
+
)}
diff --git a/src/features/OpenNotificationsList/ui/OpenNotificationsList.tsx b/src/features/OpenNotificationsList/ui/OpenNotificationsList.tsx
index 0ad8655..d7424d0 100644
--- a/src/features/OpenNotificationsList/ui/OpenNotificationsList.tsx
+++ b/src/features/OpenNotificationsList/ui/OpenNotificationsList.tsx
@@ -5,7 +5,7 @@ import { NotificationIcon as NotificationIconDeprecated } from '@/shared/assets/
import { classNames } from '@/shared/lib/classNames/classNames';
import { Icon as IconDeprecated } from '@/shared/ui/deprecated/Icon';
import { Popover as PopoverDeprecated } from '@/shared/ui/deprecated/Popups';
-import { Drawer } from '@/shared/ui/deprecated/Drawer';
+import { Drawer } from '@/shared/ui/redesigned/Drawer';
import { Button as ButtonDeprecated, ButtonTheme as ButtonThemeDeprecated } from '@/shared/ui/deprecated/Button';
import { ToggleFeatures } from '@/shared/lib/features';
import { Icon } from '@/shared/ui/redesigned/Icon';
diff --git a/src/shared/lib/features/service/updateFeatureFlags.ts b/src/shared/lib/features/service/updateFeatureFlags.ts
index c739c58..916d2f0 100644
--- a/src/shared/lib/features/service/updateFeatureFlags.ts
+++ b/src/shared/lib/features/service/updateFeatureFlags.ts
@@ -24,6 +24,8 @@ export const updateFeatureFlags = createAsyncThunk = ({ className, children, onClose, c
}
}, [root, onCloseDrawer]);
+ const rootClasses = [className, theme, 'app_drawer', toggleFeatures({
+ name: 'isAppRedesigned',
+ on: () => cls['drawer-new'],
+ off: () => cls['drawer-old'],
+ })];
+
return (
<>
{clonedTrigger}
-
+
= (props) => {
return ;
};
-/**
- * Deprecated component. Please use updated version in `@/shared/ui/redesigned`
- * @deprecated
- */
+
export const Drawer: FC = (props) => {
return (
diff --git a/src/shared/ui/deprecated/Drawer/index.ts b/src/shared/ui/redesigned/Drawer/index.ts
similarity index 100%
rename from src/shared/ui/deprecated/Drawer/index.ts
rename to src/shared/ui/redesigned/Drawer/index.ts
diff --git a/src/shared/ui/deprecated/Modal/Modal.module.scss b/src/shared/ui/redesigned/Modal/Modal.module.scss
similarity index 71%
rename from src/shared/ui/deprecated/Modal/Modal.module.scss
rename to src/shared/ui/redesigned/Modal/Modal.module.scss
index cf5590e..ab7c00f 100644
--- a/src/shared/ui/deprecated/Modal/Modal.module.scss
+++ b/src/shared/ui/redesigned/Modal/Modal.module.scss
@@ -18,6 +18,20 @@
max-width: 50%;
}
+.modal-old {
+ .content {
+ color: var(--primary-color);
+ background: var(--bg-color);
+ }
+}
+
+.modal-new {
+ .content {
+ color: var(--primary-color);
+ background: var(--light-bg);
+ }
+}
+
.opened {
pointer-events: all;
transition: var(--app-transition);
diff --git a/src/shared/ui/deprecated/Modal/Modal.stories.tsx b/src/shared/ui/redesigned/Modal/Modal.stories.tsx
similarity index 100%
rename from src/shared/ui/deprecated/Modal/Modal.stories.tsx
rename to src/shared/ui/redesigned/Modal/Modal.stories.tsx
diff --git a/src/shared/ui/deprecated/Modal/Modal.tsx b/src/shared/ui/redesigned/Modal/Modal.tsx
similarity index 78%
rename from src/shared/ui/deprecated/Modal/Modal.tsx
rename to src/shared/ui/redesigned/Modal/Modal.tsx
index 26521c0..35f7881 100644
--- a/src/shared/ui/deprecated/Modal/Modal.tsx
+++ b/src/shared/ui/redesigned/Modal/Modal.tsx
@@ -1,7 +1,8 @@
import { Dispatch, FC, ReactNode, SetStateAction, useCallback, useEffect, useState } from 'react';
import { classNames, Mods } from '@/shared/lib/classNames/classNames';
-import { Overlay } from '../../redesigned/Overlay';
-import { Portal } from '../../redesigned/Portal/Portal';
+import { toggleFeatures } from '@/shared/lib/features';
+import { Overlay } from '../Overlay';
+import { Portal } from '../Portal/Portal';
import cls from './Modal.module.scss';
interface ModalProps {
@@ -12,10 +13,7 @@ interface ModalProps {
onCloseCallback?: () => void;
lazy?: boolean;
}
-/**
- * Deprecated component. Please use updated version in `@/shared/ui/redesigned`
- * @deprecated
- */
+
export const Modal: FC = ({ children, className, isOpen, onClose, onCloseCallback, lazy }) => {
const [isMounted, setIsMounted] = useState(false);
@@ -54,9 +52,18 @@ export const Modal: FC = ({ children, className, isOpen, onClose, on
return null;
}
+ const modalRootClasses = classNames(cls.Modal, mods, [
+ className,
+ toggleFeatures({
+ name: 'isAppRedesigned',
+ on: () => cls['modal-new'],
+ off: () => cls['modal-old'],
+ }),
+ ]);
+
return (
-
+
{children}
diff --git a/src/shared/ui/deprecated/Modal/index.ts b/src/shared/ui/redesigned/Modal/index.ts
similarity index 100%
rename from src/shared/ui/deprecated/Modal/index.ts
rename to src/shared/ui/redesigned/Modal/index.ts
diff --git a/src/shared/ui/redesigned/Portal/Portal.tsx b/src/shared/ui/redesigned/Portal/Portal.tsx
index a243be6..1caad20 100644
--- a/src/shared/ui/redesigned/Portal/Portal.tsx
+++ b/src/shared/ui/redesigned/Portal/Portal.tsx
@@ -2,10 +2,12 @@ import { FC, ReactNode } from 'react';
import { createPortal } from 'react-dom';
interface PortalProps {
- children: ReactNode;
- element?: HTMLElement;
+ children: ReactNode;
+ element?: HTMLElement;
}
-export const Portal: FC
= ({ children, element = document.body }) => (
- createPortal(children, element)
-);
+export const Portal: FC = ({ children, element = document.getElementById('App') ?? document.body }) => {
+ return (
+ createPortal(children, element)
+ );
+};
diff --git a/src/shared/ui/redesigned/Skeleton/Skeleton.tsx b/src/shared/ui/redesigned/Skeleton/Skeleton.tsx
index 7352785..dd61552 100644
--- a/src/shared/ui/redesigned/Skeleton/Skeleton.tsx
+++ b/src/shared/ui/redesigned/Skeleton/Skeleton.tsx
@@ -7,10 +7,11 @@ interface SkeletonProps {
height?: string | number;
width?: string | number;
borderRadius?: string | number;
+ margin?: string;
}
-export const Skeleton: FC = memo(({ className, height, width, borderRadius }) => {
- const styles: CSSProperties = { borderRadius, width, height };
+export const Skeleton: FC = memo(({ className, height, width, borderRadius, margin }) => {
+ const styles: CSSProperties = { borderRadius, width, height, margin };
return (
diff --git a/src/widgets/Navbar/ui/Navbar/Navbar.tsx b/src/widgets/Navbar/ui/Navbar/Navbar.tsx
index 923b49d..dc70fe5 100644
--- a/src/widgets/Navbar/ui/Navbar/Navbar.tsx
+++ b/src/widgets/Navbar/ui/Navbar/Navbar.tsx
@@ -5,11 +5,13 @@ import { AvatarDropdown } from '@/features/AvatarDropdown';
import { useAppTranslation } from '@/shared/lib/hooks/useAppTranslation';
import { classNames } from '@/shared/lib/classNames/classNames';
import { useAppSelector } from '@/shared/lib/hooks/useAppSelector';
-import { Button, ButtonTheme } from '@/shared/ui/deprecated/Button';
+import { Button as ButtonDeprecated, ButtonTheme as ButtonThemeDeprecated } from '@/shared/ui/deprecated/Button';
import { Text, TextTheme } from '@/shared/ui/deprecated/Text';
import { getUserAuthData } from '@/entities/User';
import { HStack } from '@/shared/ui/redesigned/Stack';
+import { Button } from '@/shared/ui/redesigned/Button';
import { ToggleFeatures } from '@/shared/lib/features';
+
import cls from './Navbar.module.scss';
interface NavbarProps {
@@ -43,7 +45,7 @@ export const Navbar: FC = memo(({ className }) => {
);
- const AuthDataNavbar = (
+ const AuthDataNavbarRedesigned = (
@@ -57,16 +59,39 @@ export const Navbar: FC = memo(({ className }) => {
);
}
- return (
-
+ /**
+ * @deprecated
+ */
+ const NonAuthDataNavbarDeprecated = (
+
+ );
+
+ const NonAuthDataNavbarRedesigned = (
+
);
+
+ return (
+
+ );
});