From 103a031bb22c07b8480d57ff75ae9e8f28f45a64 Mon Sep 17 00:00:00 2001 From: "Leon.kov" Date: Sat, 27 Apr 2024 20:10:29 +0300 Subject: [PATCH] fix: remove deprecated, fix styles errors --- extractedTranslations/en/profile.json | 56 ++-- extractedTranslations/en/translation.json | 244 +++++++++--------- package.json | 2 +- .../providers/ErrorBoundary/ui/BugButton.tsx | 2 +- .../Comment/ui/CommentCard/CommentCard.tsx | 2 +- src/entities/Counter/ui/Counter.tsx | 2 +- .../ArticleTypeTabs/ui/ArticleTypeTabs.tsx | 3 +- .../ui/ArticleSortSelector.tsx | 6 +- .../PageLoader/ui/PageLoader/PageLoader.tsx | 2 +- .../ArticlePageGreeting.tsx | 2 +- .../ui/ArticleRating/ArticleRating.async.tsx | 2 +- .../EditableProfileCard.tsx | 4 +- .../ArticleDetailsComments.tsx | 2 +- .../ArticlesDetailsPageHeader.tsx | 10 +- .../ArticleInfiniteList.tsx | 2 +- .../ArticlesPageFilters.tsx | 4 +- .../ui/deprecated/AppLink/AppLink.module.scss | 19 -- .../ui/deprecated/AppLink/AppLink.stories.tsx | 59 ----- src/shared/ui/deprecated/AppLink/AppLink.tsx | 42 --- src/shared/ui/deprecated/AppLink/index.ts | 1 - .../ui/deprecated/Avatar/Avatar.module.scss | 5 - .../ui/deprecated/Avatar/Avatar.stories.tsx | 30 --- src/shared/ui/deprecated/Avatar/Avatar.tsx | 53 ---- src/shared/ui/deprecated/Avatar/index.ts | 1 - .../ui/deprecated/Button/Button.module.scss | 91 ------- .../ui/deprecated/Button/Button.stories.tsx | 110 -------- .../ui/deprecated/Button/Button.test.tsx | 15 -- src/shared/ui/deprecated/Button/Button.tsx | 63 ----- src/shared/ui/deprecated/Button/index.ts | 1 - .../ui/deprecated/Card/Card.module.scss | 16 -- .../ui/deprecated/Card/Card.stories.tsx | 20 -- src/shared/ui/deprecated/Card/Card.tsx | 42 --- src/shared/ui/deprecated/Card/index.ts | 1 - .../ui/deprecated/Icon/Icon.module.scss | 9 - src/shared/ui/deprecated/Icon/Icon.tsx | 25 -- src/shared/ui/deprecated/Icon/index.ts | 1 - .../ui/deprecated/Input/Input.module.scss | 54 ---- .../ui/deprecated/Input/Input.stories.tsx | 19 -- src/shared/ui/deprecated/Input/Input.tsx | 100 ------- src/shared/ui/deprecated/Input/index.ts | 1 - src/shared/ui/deprecated/Popups/index.ts | 3 - .../ui/deprecated/Popups/styles/consts.ts | 9 - .../Popups/styles/popup.module.scss | 40 --- .../Popups/ui/Dropdown/Dropdown.module.scss | 19 -- .../Popups/ui/Dropdown/Dropdown.stories.tsx | 36 --- .../Popups/ui/Dropdown/Dropdown.tsx | 82 ------ .../Popups/ui/ListBox/ListBox.module.scss | 24 -- .../Popups/ui/ListBox/ListBox.stories.tsx | 75 ------ .../deprecated/Popups/ui/ListBox/ListBox.tsx | 91 ------- .../Popups/ui/Popover/Popover.module.scss | 7 - .../Popups/ui/Popover/Popover.stories.tsx | 22 -- .../deprecated/Popups/ui/Popover/Popover.tsx | 37 --- .../ui/deprecated/Select/Select.module.scss | 21 -- .../ui/deprecated/Select/Select.stories.tsx | 22 -- src/shared/ui/deprecated/Select/Select.tsx | 54 ---- src/shared/ui/deprecated/Select/index.ts | 1 - .../deprecated/Skeleton/Skeleton.module.scss | 29 --- .../deprecated/Skeleton/Skeleton.stories.tsx | 43 --- .../ui/deprecated/Skeleton/Skeleton.tsx | 30 --- src/shared/ui/deprecated/Skeleton/index.ts | 1 - .../ui/deprecated/Tabs/Tabs.module.scss | 6 - .../ui/deprecated/Tabs/Tabs.stories.tsx | 35 --- src/shared/ui/deprecated/Tabs/Tabs.tsx | 49 ---- src/shared/ui/deprecated/Tabs/index.ts | 1 - .../ui/deprecated/Text/Text.module.scss | 69 ----- .../ui/deprecated/Text/Text.stories.tsx | 66 ----- src/shared/ui/deprecated/Text/Text.tsx | 76 ------ src/shared/ui/deprecated/Text/index.ts | 1 - src/shared/ui/redesigned/Avatar/Avatar.tsx | 2 +- .../Loader/Loader.scss | 0 .../Loader/Loader.stories.tsx | 0 .../Loader/Loader.tsx | 0 .../Loader/index.ts | 0 src/widgets/ErrorPage/ui/ErrorPage.tsx | 2 +- .../PageError/ui/PageError/PageError.tsx | 2 +- 75 files changed, 175 insertions(+), 1903 deletions(-) delete mode 100644 src/shared/ui/deprecated/AppLink/AppLink.module.scss delete mode 100644 src/shared/ui/deprecated/AppLink/AppLink.stories.tsx delete mode 100644 src/shared/ui/deprecated/AppLink/AppLink.tsx delete mode 100644 src/shared/ui/deprecated/AppLink/index.ts delete mode 100644 src/shared/ui/deprecated/Avatar/Avatar.module.scss delete mode 100644 src/shared/ui/deprecated/Avatar/Avatar.stories.tsx delete mode 100644 src/shared/ui/deprecated/Avatar/Avatar.tsx delete mode 100644 src/shared/ui/deprecated/Avatar/index.ts delete mode 100644 src/shared/ui/deprecated/Button/Button.module.scss delete mode 100644 src/shared/ui/deprecated/Button/Button.stories.tsx delete mode 100644 src/shared/ui/deprecated/Button/Button.test.tsx delete mode 100644 src/shared/ui/deprecated/Button/Button.tsx delete mode 100644 src/shared/ui/deprecated/Button/index.ts delete mode 100644 src/shared/ui/deprecated/Card/Card.module.scss delete mode 100644 src/shared/ui/deprecated/Card/Card.stories.tsx delete mode 100644 src/shared/ui/deprecated/Card/Card.tsx delete mode 100644 src/shared/ui/deprecated/Card/index.ts delete mode 100644 src/shared/ui/deprecated/Icon/Icon.module.scss delete mode 100644 src/shared/ui/deprecated/Icon/Icon.tsx delete mode 100644 src/shared/ui/deprecated/Icon/index.ts delete mode 100644 src/shared/ui/deprecated/Input/Input.module.scss delete mode 100644 src/shared/ui/deprecated/Input/Input.stories.tsx delete mode 100644 src/shared/ui/deprecated/Input/Input.tsx delete mode 100644 src/shared/ui/deprecated/Input/index.ts delete mode 100644 src/shared/ui/deprecated/Popups/index.ts delete mode 100644 src/shared/ui/deprecated/Popups/styles/consts.ts delete mode 100644 src/shared/ui/deprecated/Popups/styles/popup.module.scss delete mode 100644 src/shared/ui/deprecated/Popups/ui/Dropdown/Dropdown.module.scss delete mode 100644 src/shared/ui/deprecated/Popups/ui/Dropdown/Dropdown.stories.tsx delete mode 100644 src/shared/ui/deprecated/Popups/ui/Dropdown/Dropdown.tsx delete mode 100644 src/shared/ui/deprecated/Popups/ui/ListBox/ListBox.module.scss delete mode 100644 src/shared/ui/deprecated/Popups/ui/ListBox/ListBox.stories.tsx delete mode 100644 src/shared/ui/deprecated/Popups/ui/ListBox/ListBox.tsx delete mode 100644 src/shared/ui/deprecated/Popups/ui/Popover/Popover.module.scss delete mode 100644 src/shared/ui/deprecated/Popups/ui/Popover/Popover.stories.tsx delete mode 100644 src/shared/ui/deprecated/Popups/ui/Popover/Popover.tsx delete mode 100644 src/shared/ui/deprecated/Select/Select.module.scss delete mode 100644 src/shared/ui/deprecated/Select/Select.stories.tsx delete mode 100644 src/shared/ui/deprecated/Select/Select.tsx delete mode 100644 src/shared/ui/deprecated/Select/index.ts delete mode 100644 src/shared/ui/deprecated/Skeleton/Skeleton.module.scss delete mode 100644 src/shared/ui/deprecated/Skeleton/Skeleton.stories.tsx delete mode 100644 src/shared/ui/deprecated/Skeleton/Skeleton.tsx delete mode 100644 src/shared/ui/deprecated/Skeleton/index.ts delete mode 100644 src/shared/ui/deprecated/Tabs/Tabs.module.scss delete mode 100644 src/shared/ui/deprecated/Tabs/Tabs.stories.tsx delete mode 100644 src/shared/ui/deprecated/Tabs/Tabs.tsx delete mode 100644 src/shared/ui/deprecated/Tabs/index.ts delete mode 100644 src/shared/ui/deprecated/Text/Text.module.scss delete mode 100644 src/shared/ui/deprecated/Text/Text.stories.tsx delete mode 100644 src/shared/ui/deprecated/Text/Text.tsx delete mode 100644 src/shared/ui/deprecated/Text/index.ts rename src/shared/ui/{deprecated => redesigned}/Loader/Loader.scss (100%) rename src/shared/ui/{deprecated => redesigned}/Loader/Loader.stories.tsx (100%) rename src/shared/ui/{deprecated => redesigned}/Loader/Loader.tsx (100%) rename src/shared/ui/{deprecated => redesigned}/Loader/index.ts (100%) diff --git a/extractedTranslations/en/profile.json b/extractedTranslations/en/profile.json index 9383768..60ad9a2 100644 --- a/extractedTranslations/en/profile.json +++ b/extractedTranslations/en/profile.json @@ -1,30 +1,30 @@ { - "": "", - "Age": "", - "Avatar": "", - "City": "", - "Edit": "", - "Error": "", - "Error with getting profile data": "", - "Error with profile ": "", - "Incorrect age": "", - "Incorrect country": "", - "Incorrect user data": "", - "Lastname": "", - "Name": "", - "No data": "", - "Profile": "", - "Server error": "", - "Try to reload page": "", - "Username": "", - "Username>": "", - "Your age": "", - "Your avatar": "", - "Your city": "", - "Your lastname": "", - "Your name": "", - "Your surname": "", - "Your username": "", - "Попробуйте обновить страницу": "", - "Произошла ошибка при загрузке профиля": "" + "": "", + "Age": "", + "Avatar": "", + "City": "", + "Edit": "", + "Error": "", + "Error with getting profile data": "", + "Error with profile ": "", + "Incorrect age": "", + "Incorrect country": "", + "Incorrect user data": "", + "Lastname": "", + "Name": "", + "No data": "", + "Profile": "", + "Server error": "", + "Try to reload page": "", + "Username": "", + "Username>": "", + "Your age": "", + "Your avatar": "", + "Your city": "", + "Your lastname": "", + "Your name": "", + "Your surname": "", + "Your username": "", + "Попробуйте обновить страницу": "", + "Произошла ошибка при загрузке профиля": "" } diff --git a/extractedTranslations/en/translation.json b/extractedTranslations/en/translation.json index 8ba05d5..1d5b748 100644 --- a/extractedTranslations/en/translation.json +++ b/extractedTranslations/en/translation.json @@ -1,124 +1,124 @@ { - "": "", - "123": "123", - "About site": "", - "Admin panel": "", - "All": "", - "Article ratings coming soon!": "", - "Articles": "", - "Articles app": "", - "Articles not found": "", - "Ascending": "", - "Back to list": "", - "Cancel": "", - "Choose ": "", - "Choose country": "", - "Choose currency": "", - "Close": "", - "Comments": "", - "Comments is loading": "", - "Create new article": "", - "Creation date": "", - "Descending": "", - "Design options": "", - "Economics": "", - "Edit": "", - "Enter ": "", - "Enter comment text": "", - "Enter cooment text": "", - "Error while loading articles": "", - "Error with getting article data": "", - "Error with getting profile data": "", - "Exit": "", - "Here you can search and view articles on various topics": "", - "IT": "", - "Incorrect age": "", - "Incorrect country": "", - "Incorrect user data": "", - "Leave your feedback on the article, it will help improve the quality": "", - "Main page": "", - "Main_page": "", - "Name": "", - "New": "", - "No data": "", - "Old": "", - "PROFILE PAGE": "", - "Profile": "", - "Rate the article": "", - "Read more": { - "": { - "": { - "": "" - } - } - }, - "Recommend": "", - "Save": "", - "Science": "", - "Search": "", - "Send": "", - "Server error": "", - "Sort by": "", - "Sorting by": "", - "Thanks for review!": "", - "Try to reload page": "", - "User settings": "", - "Views": "", - "Welcome to the articles page!": "", - "You don`t have access to this page!": "", - "Your name": "", - "Your review": "", - "article_not_found": "", - "articles": "", - "articles page": "", - "articles_details": "", - "articles_details page": "", - "articles_detals": "", - "ascending": "", - "auth_form": "", - "auth_password": "", - "auth_username": "", - "by": "", - "comments": "", - "creation date": "", - "decrement": "", - "descending": "", - "exit": "", - "increment": "", - "login": "", - "login_error": "", - "name": "", - "no articles found": "", - "no comments": "", - "no profile found": "", - "read more": "", - "throw error": "throw error", - "views": "", - "{{count}} views": "", - "{{count}} views_plural": "", - "{{count}} просмотров": "", - "{{count}} просмотров_plural": "", - "Айти": "", - "Ваш отзыв": "", - "Все статьи": "", - "Главная страница": "", - "Закрыть": "", - "Наука": "", - "Обновить страницу": "", - "Отправить": "", - "Оценка статей скоро появится!": "", - "Поиск": "", - "Попробуйте обновить страницу": "", - "Произошла непредвиденная ошибка": "", - "Произошла ошибка при загрузке профиля": "", - "Редактировать": "", - "Сортировать ПО": "", - "Статьи не найдены": "", - "Экономика": "", - "возрастанию": "", - "дате создания": "", - "названию": "", - "по": "", - "просмотрам": "", - "убыванию": "" + "": "", + "123": "123", + "About site": "", + "Admin panel": "", + "All": "", + "Article ratings coming soon!": "", + "Articles": "", + "Articles app": "", + "Articles not found": "", + "Ascending": "", + "Back to list": "", + "Cancel": "", + "Choose ": "", + "Choose country": "", + "Choose currency": "", + "Close": "", + "Comments": "", + "Comments is loading": "", + "Create new article": "", + "Creation date": "", + "Descending": "", + "Design options": "", + "Economics": "", + "Edit": "", + "Enter ": "", + "Enter comment text": "", + "Enter cooment text": "", + "Error while loading articles": "", + "Error with getting article data": "", + "Error with getting profile data": "", + "Exit": "", + "Here you can search and view articles on various topics": "", + "IT": "", + "Incorrect age": "", + "Incorrect country": "", + "Incorrect user data": "", + "Leave your feedback on the article, it will help improve the quality": "", + "Main page": "", + "Main_page": "", + "Name": "", + "New": "", + "No data": "", + "Old": "", + "PROFILE PAGE": "", + "Profile": "", + "Rate the article": "", + "Read more": { + "": { + "": { + "": "" + } + } + }, + "Recommend": "", + "Save": "", + "Science": "", + "Search": "", + "Send": "", + "Server error": "", + "Sort by": "", + "Sorting by": "", + "Thanks for review!": "", + "Try to reload page": "", + "User settings": "", + "Views": "", + "Welcome to the articles page!": "", + "You don`t have access to this page!": "", + "Your name": "", + "Your review": "", + "article_not_found": "", + "articles": "", + "articles page": "", + "articles_details": "", + "articles_details page": "", + "articles_detals": "", + "ascending": "", + "auth_form": "", + "auth_password": "", + "auth_username": "", + "by": "", + "comments": "", + "creation date": "", + "decrement": "", + "descending": "", + "exit": "", + "increment": "", + "login": "", + "login_error": "", + "name": "", + "no articles found": "", + "no comments": "", + "no profile found": "", + "read more": "", + "throw error": "throw error", + "views": "", + "{{count}} views": "", + "{{count}} views_plural": "", + "{{count}} просмотров": "", + "{{count}} просмотров_plural": "", + "Айти": "", + "Ваш отзыв": "", + "Все статьи": "", + "Главная страница": "", + "Закрыть": "", + "Наука": "", + "Обновить страницу": "", + "Отправить": "", + "Оценка статей скоро появится!": "", + "Поиск": "", + "Попробуйте обновить страницу": "", + "Произошла непредвиденная ошибка": "", + "Произошла ошибка при загрузке профиля": "", + "Редактировать": "", + "Сортировать ПО": "", + "Статьи не найдены": "", + "Экономика": "", + "возрастанию": "", + "дате создания": "", + "названию": "", + "по": "", + "просмотрам": "", + "убыванию": "" } diff --git a/package.json b/package.json index aa25743..0320fa6 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "build:dev": "webpack --env mode=development", "prettier": "npx prettier --write **/*.{ts,tsx,json}", "lint:ts": "eslint \"./src/**/*.{ts,tsx}\"", - "lint:ts:fix": "eslint \"**/*.{ts,tsx}\" --fix", + "lint:ts:fix": "eslint \"./src/**/*.{ts,tsx}\" --fix", "lint:scss": "npx stylelint \"**/*.scss\"", "lint:scss:fix": "npx stylelint \"**/*.scss\" --fix", "test:unit": "jest --config ./config/jest/jest.config.ts", diff --git a/src/app/providers/ErrorBoundary/ui/BugButton.tsx b/src/app/providers/ErrorBoundary/ui/BugButton.tsx index ccbabbc..2fff8e9 100644 --- a/src/app/providers/ErrorBoundary/ui/BugButton.tsx +++ b/src/app/providers/ErrorBoundary/ui/BugButton.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import { Button } from '@/shared/ui/deprecated/Button'; +import { Button } from '@/shared/ui/redesigned/Button'; // Компонент для тестирования ErrorBoundary export const BugButton = () => { diff --git a/src/entities/Comment/ui/CommentCard/CommentCard.tsx b/src/entities/Comment/ui/CommentCard/CommentCard.tsx index 9c1e7bd..38dacbb 100644 --- a/src/entities/Comment/ui/CommentCard/CommentCard.tsx +++ b/src/entities/Comment/ui/CommentCard/CommentCard.tsx @@ -1,6 +1,5 @@ import { memo } from 'react'; import { HStack, VStack } from '@/shared/ui/redesigned/Stack'; -import { AppLink } from '@/shared/ui/deprecated/AppLink'; import { classNames } from '@/shared/lib/classNames/classNames'; import cls from './CommentCard.module.scss'; import { Comment } from '../../model/types/comment'; @@ -9,6 +8,7 @@ import { Text } from '@/shared/ui/redesigned/Text'; import { Skeleton } from '@/shared/ui/redesigned/Skeleton'; import { getRouteProfile } from '@/shared/const/router'; import { Card } from '@/shared/ui/redesigned/Card'; +import { AppLink } from '@/shared/ui/redesigned/AppLink'; interface CommentCardProps { className?: string; diff --git a/src/entities/Counter/ui/Counter.tsx b/src/entities/Counter/ui/Counter.tsx index 4a0b1ed..175cb32 100644 --- a/src/entities/Counter/ui/Counter.tsx +++ b/src/entities/Counter/ui/Counter.tsx @@ -1,8 +1,8 @@ import { useDispatch, useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; -import { Button } from '@/shared/ui/deprecated/Button'; import { getCounterValue } from '../model/selectors/getCounterValue/getCounterValue'; import { counterActions } from '../model/slice/counterSlice'; +import { Button } from '@/shared/ui/redesigned/Button'; export const Counter = () => { const dispatch = useDispatch(); diff --git a/src/features/ArticleTypeTabs/ui/ArticleTypeTabs.tsx b/src/features/ArticleTypeTabs/ui/ArticleTypeTabs.tsx index 6a55cbc..c108d73 100644 --- a/src/features/ArticleTypeTabs/ui/ArticleTypeTabs.tsx +++ b/src/features/ArticleTypeTabs/ui/ArticleTypeTabs.tsx @@ -1,9 +1,8 @@ import { useTranslation } from 'react-i18next'; import { memo, useCallback, useMemo } from 'react'; import { classNames } from '@/shared/lib/classNames/classNames'; -import { TabItem } from '@/shared/ui/deprecated/Tabs'; import { ArticleType } from '@/entities/Article'; -import { Tabs } from '@/shared/ui/redesigned/Tabs'; +import { TabItem, Tabs } from '@/shared/ui/redesigned/Tabs'; interface ArticleTypeTabsProps { className?: string; diff --git a/src/features/ArtilcleSortSelector/ui/ArticleSortSelector.tsx b/src/features/ArtilcleSortSelector/ui/ArticleSortSelector.tsx index 1fc526a..d496f31 100644 --- a/src/features/ArtilcleSortSelector/ui/ArticleSortSelector.tsx +++ b/src/features/ArtilcleSortSelector/ui/ArticleSortSelector.tsx @@ -1,7 +1,6 @@ import { useTranslation } from 'react-i18next'; import { memo, useMemo } from 'react'; import { classNames } from '@/shared/lib/classNames/classNames'; -import { SelectOption } from '@/shared/ui/deprecated/Select'; import { SortOrder } from '@/shared/types/sort'; import cls from './ArticleSortSelector.module.scss'; import { ArticleSortField } from '@/entities/Article'; @@ -9,6 +8,11 @@ import { ListBox } from '@/shared/ui/redesigned/Popups'; import { VStack } from '@/shared/ui/redesigned/Stack'; import { Text } from '@/shared/ui/redesigned/Text'; +export interface SelectOption { + value: T; + content: string; +} + interface ArticleSortSelectorProps { className?: string; sort: ArticleSortField; diff --git a/src/features/PageLoader/ui/PageLoader/PageLoader.tsx b/src/features/PageLoader/ui/PageLoader/PageLoader.tsx index c478fed..4c2d18e 100644 --- a/src/features/PageLoader/ui/PageLoader/PageLoader.tsx +++ b/src/features/PageLoader/ui/PageLoader/PageLoader.tsx @@ -1,6 +1,6 @@ import { classNames } from '@/shared/lib/classNames/classNames'; import cls from './PageLoader.module.scss'; -import { Loader } from '@/shared/ui/deprecated/Loader'; +import { Loader } from '@/shared/ui/redesigned/Loader'; interface PageLoaderProps { className?: string; diff --git a/src/features/articlePageGreeting/ui/ArticlePageGreeting/ArticlePageGreeting.tsx b/src/features/articlePageGreeting/ui/ArticlePageGreeting/ArticlePageGreeting.tsx index 123c858..b58b27c 100644 --- a/src/features/articlePageGreeting/ui/ArticlePageGreeting/ArticlePageGreeting.tsx +++ b/src/features/articlePageGreeting/ui/ArticlePageGreeting/ArticlePageGreeting.tsx @@ -3,7 +3,7 @@ import { memo, useEffect, useState } from 'react'; import { isMobile } from 'react-device-detect'; import { Drawer } from '@/shared/ui/redesigned/Drawer'; import { Modal } from '@/shared/ui/redesigned/Modal'; -import { Text } from '@/shared/ui/deprecated/Text'; +import { Text } from '@/shared/ui/redesigned/Text'; import { saveJsonSettings, useJsonSettings } from '@/entities/User'; import { useAppDispatch } from '@/shared/lib/hook/useAppDispatch/useAppDispatch'; diff --git a/src/features/articleRating/ui/ArticleRating/ArticleRating.async.tsx b/src/features/articleRating/ui/ArticleRating/ArticleRating.async.tsx index cd8e32a..497cca5 100644 --- a/src/features/articleRating/ui/ArticleRating/ArticleRating.async.tsx +++ b/src/features/articleRating/ui/ArticleRating/ArticleRating.async.tsx @@ -1,6 +1,6 @@ import { lazy, Suspense } from 'react'; -import { Skeleton } from '@/shared/ui/deprecated/Skeleton'; import { ArticleRatingProps } from './ArticleRating'; +import { Skeleton } from '@/shared/ui/redesigned/Skeleton'; const ArticleRatingLazy = lazy(() => import('./ArticleRating')); diff --git a/src/features/editableProfileCard/ui/EditableProfileCard/EditableProfileCard.tsx b/src/features/editableProfileCard/ui/EditableProfileCard/EditableProfileCard.tsx index 9404167..8247cf6 100644 --- a/src/features/editableProfileCard/ui/EditableProfileCard/EditableProfileCard.tsx +++ b/src/features/editableProfileCard/ui/EditableProfileCard/EditableProfileCard.tsx @@ -2,7 +2,7 @@ import { useTranslation } from 'react-i18next'; import { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; import { VStack } from '@/shared/ui/redesigned/Stack'; -import { Text, TextTheme } from '@/shared/ui/deprecated/Text'; +import { Text } from '@/shared/ui/redesigned/Text'; import { useAppDispatch } from '@/shared/lib/hook/useAppDispatch/useAppDispatch'; import { classNames } from '@/shared/lib/classNames/classNames'; import { useInitialEffect } from '@/shared/lib/hook/useInitialEffect/useInitialEffect'; @@ -127,7 +127,7 @@ export const EditableProfileCard = memo((props: EditableProfileCardProps) => { validateErrors.map((err) => ( diff --git a/src/pages/ArticlesDetailsPage/ui/ArticleDetailsComments/ArticleDetailsComments.tsx b/src/pages/ArticlesDetailsPage/ui/ArticleDetailsComments/ArticleDetailsComments.tsx index 1550b69..e03d10f 100644 --- a/src/pages/ArticlesDetailsPage/ui/ArticleDetailsComments/ArticleDetailsComments.tsx +++ b/src/pages/ArticlesDetailsPage/ui/ArticleDetailsComments/ArticleDetailsComments.tsx @@ -11,8 +11,8 @@ import { fetchCommentsByArticleId } from '../../model/services/fetchCommentsByAr import { addCommentForArticle } from '../../model/services/addCommetForArticle/addCommetForArticle'; import { getArticleComments } from '../../model/slices/ArticleDetailsCommentsSlice'; import { getArticleCommentsIsLoading } from '../../model/selectors/comments'; -import { Loader } from '@/shared/ui/deprecated/Loader'; import { VStack } from '@/shared/ui/redesigned/Stack'; +import { Loader } from '@/shared/ui/redesigned/Loader'; interface ArticleDetailsCommentsProps { className?: string; diff --git a/src/pages/ArticlesDetailsPage/ui/ArticlesDetailsPageHeader/ArticlesDetailsPageHeader.tsx b/src/pages/ArticlesDetailsPage/ui/ArticlesDetailsPageHeader/ArticlesDetailsPageHeader.tsx index 88cff88..b62965a 100644 --- a/src/pages/ArticlesDetailsPage/ui/ArticlesDetailsPageHeader/ArticlesDetailsPageHeader.tsx +++ b/src/pages/ArticlesDetailsPage/ui/ArticlesDetailsPageHeader/ArticlesDetailsPageHeader.tsx @@ -3,7 +3,7 @@ import { memo, useCallback } from 'react'; import { useNavigate } from 'react-router-dom'; import { useSelector } from 'react-redux'; import { HStack } from '@/shared/ui/redesigned/Stack'; -import { Button, ButtonTheme } from '@/shared/ui/deprecated/Button'; +import { Button } from '@/shared/ui/redesigned/Button'; import { classNames } from '@/shared/lib/classNames/classNames'; import { getCanEditArticle } from '../../model/selectors/article'; import { getArticlesDetailsData } from '../../../../entities/Article'; @@ -37,13 +37,9 @@ export const ArticlesDetailsPageHeader = memo( max className={classNames('', {}, [className])} > - + {canEdit && ( - + )} ); diff --git a/src/pages/ArticlesPage/ui/ArticleInfiniteList/ArticleInfiniteList.tsx b/src/pages/ArticlesPage/ui/ArticleInfiniteList/ArticleInfiniteList.tsx index fffeb41..d877937 100644 --- a/src/pages/ArticlesPage/ui/ArticleInfiniteList/ArticleInfiniteList.tsx +++ b/src/pages/ArticlesPage/ui/ArticleInfiniteList/ArticleInfiniteList.tsx @@ -1,7 +1,7 @@ import { useTranslation } from 'react-i18next'; import { memo } from 'react'; import { useSelector } from 'react-redux'; -import { Text } from '@/shared/ui/deprecated/Text'; +import { Text } from '@/shared/ui/redesigned/Text'; import { classNames } from '@/shared/lib/classNames/classNames'; import { ArticleList } from '../../../../entities/Article'; import { diff --git a/src/pages/ArticlesPage/ui/ArticlesPageFilters/ArticlesPageFilters.tsx b/src/pages/ArticlesPage/ui/ArticlesPageFilters/ArticlesPageFilters.tsx index 2432132..f82e8e2 100644 --- a/src/pages/ArticlesPage/ui/ArticlesPageFilters/ArticlesPageFilters.tsx +++ b/src/pages/ArticlesPage/ui/ArticlesPageFilters/ArticlesPageFilters.tsx @@ -1,7 +1,7 @@ import { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; -import { Card } from '@/shared/ui/deprecated/Card'; +import { Card } from '@/shared/ui/redesigned/Card'; import { classNames } from '@/shared/lib/classNames/classNames'; import { ArticleViewSelector } from '@/features/ArticleViewSelector'; import { useAppDispatch } from '@/shared/lib/hook/useAppDispatch/useAppDispatch'; @@ -20,7 +20,7 @@ import { } from '../../model/selectors/articlesPageSelectors'; import cls from './ArticlesPageFilters.module.scss'; import { ArticleSortSelector } from '@/features/ArtilcleSortSelector'; -import { Input } from '@/shared/ui/deprecated/Input'; +import { Input } from '@/shared/ui/redesigned/Input'; interface ArticlesPageFiltersProps { className?: string; diff --git a/src/shared/ui/deprecated/AppLink/AppLink.module.scss b/src/shared/ui/deprecated/AppLink/AppLink.module.scss deleted file mode 100644 index 535b8fb..0000000 --- a/src/shared/ui/deprecated/AppLink/AppLink.module.scss +++ /dev/null @@ -1,19 +0,0 @@ -.AppLink { - color: var(--primary-color); - - &:hover { - opacity: 0.8; - } -} - -.primary { - color: var(--primary-color); -} - -.secondary { - color: var(--inverted-primary-color); -} - -.red { - color: red; -} diff --git a/src/shared/ui/deprecated/AppLink/AppLink.stories.tsx b/src/shared/ui/deprecated/AppLink/AppLink.stories.tsx deleted file mode 100644 index 337cea6..0000000 --- a/src/shared/ui/deprecated/AppLink/AppLink.stories.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import React from 'react'; -import { ComponentMeta, ComponentStory } from '@storybook/react'; -import { ThemeDecorator } from '@/shared/config/storybook/ThemeDecorator/ThemeDecorator'; -import { AppLink, AppLinkTheme } from './AppLink'; -import { Theme } from '@/shared/const/theme'; - -export default { - title: 'shared/AppLink', - component: AppLink, - argTypes: { - backgroundColor: { control: 'color' }, - }, - args: { - to: '/', - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ( - -); - -export const Primary = Template.bind({}); -Primary.args = { - children: 'Text', - theme: AppLinkTheme.PRIMARY, -}; - -export const Secondary = Template.bind({}); -Secondary.args = { - children: 'Text', - theme: AppLinkTheme.SECONDARY, -}; - -export const Red = Template.bind({}); -Red.args = { - children: 'Text', - theme: AppLinkTheme.RED, -}; - -export const PrimaryDark = Template.bind({}); -PrimaryDark.args = { - children: 'Text', - theme: AppLinkTheme.PRIMARY, -}; -PrimaryDark.decorators = [ThemeDecorator(Theme.DARK)]; - -export const SecondaryDark = Template.bind({}); -SecondaryDark.args = { - children: 'Text', - theme: AppLinkTheme.SECONDARY, -}; -SecondaryDark.decorators = [ThemeDecorator(Theme.DARK)]; - -export const RedDark = Template.bind({}); -RedDark.args = { - children: 'Text', - theme: AppLinkTheme.RED, -}; -RedDark.decorators = [ThemeDecorator(Theme.DARK)]; diff --git a/src/shared/ui/deprecated/AppLink/AppLink.tsx b/src/shared/ui/deprecated/AppLink/AppLink.tsx deleted file mode 100644 index f0c3c92..0000000 --- a/src/shared/ui/deprecated/AppLink/AppLink.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { Link, LinkProps } from 'react-router-dom'; -import { memo, ReactNode } from 'react'; -import { classNames } from '@/shared/lib/classNames/classNames'; -import cls from './AppLink.module.scss'; - -export enum AppLinkTheme { - PRIMARY = 'primary', - SECONDARY = 'secondary', - RED = 'red', -} - -interface AppLinkProps extends LinkProps { - className?: string; - theme?: AppLinkTheme; - children?: ReactNode; -} - -export const AppLink = memo((props: AppLinkProps) => { - const { - to, - className, - children, - theme = AppLinkTheme.PRIMARY, - ...otherProps - } = props; - /** - * Устарел, используем новые компоненты из папки redesigned - * @deprecated - */ - - return ( - - {children} - - ); -}); diff --git a/src/shared/ui/deprecated/AppLink/index.ts b/src/shared/ui/deprecated/AppLink/index.ts deleted file mode 100644 index 4ffed22..0000000 --- a/src/shared/ui/deprecated/AppLink/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './AppLink'; diff --git a/src/shared/ui/deprecated/Avatar/Avatar.module.scss b/src/shared/ui/deprecated/Avatar/Avatar.module.scss deleted file mode 100644 index e7fcb2a..0000000 --- a/src/shared/ui/deprecated/Avatar/Avatar.module.scss +++ /dev/null @@ -1,5 +0,0 @@ -.Avatar { - border-radius: 50%; - width: 100px; - height: 100px; -} diff --git a/src/shared/ui/deprecated/Avatar/Avatar.stories.tsx b/src/shared/ui/deprecated/Avatar/Avatar.stories.tsx deleted file mode 100644 index f07f84e..0000000 --- a/src/shared/ui/deprecated/Avatar/Avatar.stories.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { ComponentMeta, ComponentStory } from '@storybook/react'; -import { Avatar } from './Avatar'; - -export default { - title: 'shared/Avatar', - component: Avatar, - argTypes: { - backgroundColor: { control: 'color' }, - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ; - -export const Primary = Template.bind({}); -Primary.args = { - size: 150, - src: 'https://pic.rutubelist.ru/user/3b/27/3b2758ad5492a76b578f7ee072e4e894.jpg', -}; - -export const Small = Template.bind({}); -Small.args = { - size: 50, - src: 'https://pic.rutubelist.ru/user/3b/27/3b2758ad5492a76b578f7ee072e4e894.jpg', -}; - -export const ImageEmpty = Template.bind({}); -ImageEmpty.args = { - size: 50, - alt: 'image', -}; diff --git a/src/shared/ui/deprecated/Avatar/Avatar.tsx b/src/shared/ui/deprecated/Avatar/Avatar.tsx deleted file mode 100644 index 1050c68..0000000 --- a/src/shared/ui/deprecated/Avatar/Avatar.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { CSSProperties, useMemo } from 'react'; -import { classNames, Mods } from '@/shared/lib/classNames/classNames'; -import cls from './Avatar.module.scss'; -import { AppImage } from '../../redesigned/AppImage'; -import UserIcon from '../../../assets/icons/user-filled.svg'; -import { Skeleton } from '../Skeleton'; -import { Icon } from '../Icon'; - -export interface AvatarProps { - className?: string; - src?: string; - size?: number; - alt?: string; - fallbackInverted?: boolean; -} - -export const Avatar = (props: AvatarProps) => { - const { className, src, size = 100, alt, fallbackInverted } = props; - const mods: Mods = {}; - - const styles = useMemo( - () => ({ - width: size, - height: size, - }), - [size], - ); - - const fallback = ; - const errorFallback = ( - - ); - /** - * Устарел, используем новые компоненты из папки redesigned - * @deprecated - */ - - return ( - - ); -}; diff --git a/src/shared/ui/deprecated/Avatar/index.ts b/src/shared/ui/deprecated/Avatar/index.ts deleted file mode 100644 index 27700fe..0000000 --- a/src/shared/ui/deprecated/Avatar/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Avatar'; diff --git a/src/shared/ui/deprecated/Button/Button.module.scss b/src/shared/ui/deprecated/Button/Button.module.scss deleted file mode 100644 index 64fd107..0000000 --- a/src/shared/ui/deprecated/Button/Button.module.scss +++ /dev/null @@ -1,91 +0,0 @@ -.Button { - cursor: pointer; - color: var(--primary-color); - padding: 6px 15px; - - &:hover { - opacity: 0.8; - fill-opacity: 80%; - stroke-opacity: 80%; - } -} - -.clear, -.clearInverted { - padding: 0; - border: none; - background: none; - outline: none; -} - -.clearInverted { - color: var(--inverted-primary-color); -} - -.outline { - padding: 10px 15px; - border: 1px solid var(--primary-color); - color: var(--primary-color); - background: none; -} - -.outline_red { - padding: 10px 15px; - border: 1px solid var(--red-light); - color: var(--red-light); - background: none; -} - -.background { - background: var(--bg-color); - color: var(--primary-color); - border: none; -} - -.backgroundInverted { - background: var(--inverted-bg-color); - color: var(--inverted-primary-color); - border: none; -} - -.square { - padding: 0; -} - -.square.size_m { - width: var(--font-line-m); - height: var(--font-line-m); - font: var(--font-m); -} - -.square.size_l { - width: var(--font-line-l); - height: var(--font-line-l); - font: var(--font-l); -} - -.square.size_xl { - width: var(--font-line-xl); - height: var(--font-line-xl); - font: var(--font-xl); -} - -.size_m { - font: var(--font-m); -} - -.size_l { - font: var(--font-m); -} - -.size_xl { - font: var(--font-m); -} - -.isDisabled { - opacity: 0.5; -} - -.fullWidth { - width: 100%; -} diff --git a/src/shared/ui/deprecated/Button/Button.stories.tsx b/src/shared/ui/deprecated/Button/Button.stories.tsx deleted file mode 100644 index 754eb76..0000000 --- a/src/shared/ui/deprecated/Button/Button.stories.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; - -import { ThemeDecorator } from '@/shared/config/storybook/ThemeDecorator/ThemeDecorator'; -import { Button, ButtonSize, ButtonTheme } from './Button'; -import { Theme } from '@/shared/const/theme'; - -export default { - title: 'shared/Button', - component: Button, - argTypes: { - backgroundColor: { control: 'color' }, - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ); - expect(screen.getByText('TEST')).toBeInTheDocument(); - }); - - test('Test clear theme', () => { - render(); - expect(screen.getByText('TEST')).toHaveClass('clear'); - // screen.debug(); - }); -}); diff --git a/src/shared/ui/deprecated/Button/Button.tsx b/src/shared/ui/deprecated/Button/Button.tsx deleted file mode 100644 index 961eeb2..0000000 --- a/src/shared/ui/deprecated/Button/Button.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { ButtonHTMLAttributes, memo, ReactNode } from 'react'; -import { classNames, Mods } from '@/shared/lib/classNames/classNames'; -import cls from './Button.module.scss'; - -export enum ButtonTheme { - CLEAR = 'clear', - CLEAR_INVERTED = 'clearInverted', - OUTLINE = 'outline', - OUTLINE_RED = 'outline_red', - BACKGROUND = 'background', - BACKGROUND_INVERTED = 'backgroundInverted', -} - -export enum ButtonSize { - M = 'size_m', - L = 'size_l', - XL = 'size_xl', -} - -interface ButtonProps extends ButtonHTMLAttributes { - className?: string; - theme?: ButtonTheme; - square?: boolean; - size?: ButtonSize; - isDisabled?: boolean; - children?: ReactNode; - fullWidth?: boolean; -} - -export const Button = memo((props: ButtonProps) => { - const { - className, - children, - theme = ButtonTheme.OUTLINE, - square, - isDisabled, - size = ButtonSize.M, - fullWidth, - ...otherProps - } = props; - - const mods: Mods = { - [cls.square]: square, - [cls.isDisabled]: isDisabled, - [cls.fullWidth]: fullWidth, - }; - - const additional = [className, cls[theme], cls[size]]; - /** - * Устарел, используем новые компоненты из папки redesigned - * @deprecated - */ - return ( - - ); -}); diff --git a/src/shared/ui/deprecated/Button/index.ts b/src/shared/ui/deprecated/Button/index.ts deleted file mode 100644 index 8b166a8..0000000 --- a/src/shared/ui/deprecated/Button/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Button'; diff --git a/src/shared/ui/deprecated/Card/Card.module.scss b/src/shared/ui/deprecated/Card/Card.module.scss deleted file mode 100644 index c2142bc..0000000 --- a/src/shared/ui/deprecated/Card/Card.module.scss +++ /dev/null @@ -1,16 +0,0 @@ -.Card { - padding: 15px; - border-radius: 12px; -} - -.normal { - background: var(--card-bg); -} - -.outlined { - border: 1px solid var(--primary-color); -} - -.max { - width: 100%; -} diff --git a/src/shared/ui/deprecated/Card/Card.stories.tsx b/src/shared/ui/deprecated/Card/Card.stories.tsx deleted file mode 100644 index 5d9e2f8..0000000 --- a/src/shared/ui/deprecated/Card/Card.stories.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; - -import { Text } from '../Text/Text'; -import { Card } from './Card'; - -export default { - title: 'shared/Card', - component: Card, - argTypes: { - backgroundColor: { control: 'color' }, - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ; - -export const Normal = Template.bind({}); -Normal.args = { - children: , -}; diff --git a/src/shared/ui/deprecated/Card/Card.tsx b/src/shared/ui/deprecated/Card/Card.tsx deleted file mode 100644 index 3899b3b..0000000 --- a/src/shared/ui/deprecated/Card/Card.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { HTMLAttributes, memo, ReactNode } from 'react'; -import { classNames } from '@/shared/lib/classNames/classNames'; -import cls from './Card.module.scss'; - -export enum CardTheme { - NORMAL = 'normal', - OUTLINED = 'outlined', -} - -interface CardProps extends HTMLAttributes { - className?: string; - children: ReactNode; - theme?: CardTheme; - max?: boolean; -} - -export const Card = memo((props: CardProps) => { - const { - className, - children, - theme = CardTheme.NORMAL, - max, - ...otherProps - } = props; - - /** - * Устарел, используем новые компоненты из папки redesigned - * @deprecated - */ - - return ( -
- {children} -
- ); -}); diff --git a/src/shared/ui/deprecated/Card/index.ts b/src/shared/ui/deprecated/Card/index.ts deleted file mode 100644 index ca0b060..0000000 --- a/src/shared/ui/deprecated/Card/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Card'; diff --git a/src/shared/ui/deprecated/Icon/Icon.module.scss b/src/shared/ui/deprecated/Icon/Icon.module.scss deleted file mode 100644 index 25d1988..0000000 --- a/src/shared/ui/deprecated/Icon/Icon.module.scss +++ /dev/null @@ -1,9 +0,0 @@ -.Icon { - fill: var(--primary-color); - color: var(--primary-color); -} - -.inverted { - fill: var(--inverted-primary-color); - color: var(--inverted-primary-color); -} diff --git a/src/shared/ui/deprecated/Icon/Icon.tsx b/src/shared/ui/deprecated/Icon/Icon.tsx deleted file mode 100644 index ccc1d39..0000000 --- a/src/shared/ui/deprecated/Icon/Icon.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import React, { memo } from 'react'; -import { classNames } from '@/shared/lib/classNames/classNames'; -import cls from './Icon.module.scss'; - -interface IconProps extends React.SVGProps { - className?: string; - Svg: React.VFC>; - inverted?: boolean; -} - -export const Icon = memo((props: IconProps) => { - const { className, Svg, inverted, ...otherProps } = props; - /** - * Устарел, используем новые компоненты из папки redesigned - * @deprecated - */ - return ( - - ); -}); diff --git a/src/shared/ui/deprecated/Icon/index.ts b/src/shared/ui/deprecated/Icon/index.ts deleted file mode 100644 index e263cc0..0000000 --- a/src/shared/ui/deprecated/Icon/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Icon'; diff --git a/src/shared/ui/deprecated/Input/Input.module.scss b/src/shared/ui/deprecated/Input/Input.module.scss deleted file mode 100644 index 0b3be07..0000000 --- a/src/shared/ui/deprecated/Input/Input.module.scss +++ /dev/null @@ -1,54 +0,0 @@ -.InputWrapper { - display: flex; - color: var(--primary-color); -} - -.placeholder { - margin-right: 5px; -} - -.input { - background: transparent; - border: none; - outline: none; - width: 100%; - color: transparent; - text-shadow: 0 0 0 var(--primary-color); - - &:focus { - outline: none; - } -} - -.caretWrapper { - flex-grow: 1; - position: relative; -} - -.caret { - height: 3px; - width: 9px; - background: var(--primary-color); - bottom: 0; - left: 0; - position: absolute; - animation: blink 0.7s forwards infinite; -} - -.readonly { - opacity: 0.7; -} - -@keyframes blink { - 0% { - opacity: 0; - } - - 50% { - opacity: 0.01; - } - - 100% { - opacity: 1; - } -} diff --git a/src/shared/ui/deprecated/Input/Input.stories.tsx b/src/shared/ui/deprecated/Input/Input.stories.tsx deleted file mode 100644 index fc4dd92..0000000 --- a/src/shared/ui/deprecated/Input/Input.stories.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; -import { ComponentMeta, ComponentStory } from '@storybook/react'; -import { Input } from './Input'; - -export default { - title: 'shared/Input', - component: Input, - argTypes: { - backgroundColor: { control: 'color' }, - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ; - -export const Primary = Template.bind({}); -Primary.args = { - placeholder: 'type text', - value: '12345', -}; diff --git a/src/shared/ui/deprecated/Input/Input.tsx b/src/shared/ui/deprecated/Input/Input.tsx deleted file mode 100644 index 4abb4a4..0000000 --- a/src/shared/ui/deprecated/Input/Input.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import { - ChangeEvent, - InputHTMLAttributes, - memo, - useEffect, - useRef, - useState, -} from 'react'; -import { classNames, Mods } from '@/shared/lib/classNames/classNames'; -import cls from './Input.module.scss'; - -type HTMLInputProps = Omit< - InputHTMLAttributes, - 'value' | 'onChange' | 'readOnly' ->; - -interface InputProps extends HTMLInputProps { - className?: string; - value?: string | number; - onChange?: (value: string) => void; - autofocus?: boolean; - readonly?: boolean; -} - -export const Input = memo((props: InputProps) => { - const { - className, - value, - onChange, - type = 'text', - placeholder, - autofocus, - readonly, - ...otherProps - } = props; - const ref = useRef(null); - const [isFocused, setIsFocused] = useState(false); - const [caretPosition, setCaretPosition] = useState(0); - - const isCaretVisible = isFocused && !readonly; - - const onChangeHandler = (e: ChangeEvent) => { - onChange?.(e.target.value); - }; - - const onBlur = () => { - setIsFocused(false); - }; - - const onFocus = () => { - setIsFocused(true); - }; - - const onSelect = (e: any) => { - setCaretPosition(e?.target?.selectionStart || 0); - }; - - useEffect(() => { - if (autofocus) { - setIsFocused(true); - ref.current?.focus(); - } - }, [autofocus]); - - const mods: Mods = { - [cls.readOnly]: readonly, - }; - /** - * Устарел, используем новые компоненты из папки redesigned - * @deprecated - */ - return ( -
- {placeholder && ( -
{`${placeholder}>`}
- )} - -
- - {isCaretVisible && ( - - )} -
-
- ); -}); diff --git a/src/shared/ui/deprecated/Input/index.ts b/src/shared/ui/deprecated/Input/index.ts deleted file mode 100644 index ba9fe7e..0000000 --- a/src/shared/ui/deprecated/Input/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Input'; diff --git a/src/shared/ui/deprecated/Popups/index.ts b/src/shared/ui/deprecated/Popups/index.ts deleted file mode 100644 index a6a1ad5..0000000 --- a/src/shared/ui/deprecated/Popups/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { Dropdown } from './ui/Dropdown/Dropdown'; -export { ListBox } from './ui/ListBox/ListBox'; -export { Popover } from './ui/Popover/Popover'; diff --git a/src/shared/ui/deprecated/Popups/styles/consts.ts b/src/shared/ui/deprecated/Popups/styles/consts.ts deleted file mode 100644 index b2922cd..0000000 --- a/src/shared/ui/deprecated/Popups/styles/consts.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { DropDownDirection } from '../../../../types/ui'; -import cls from './popup.module.scss'; - -export const mapDirectionClass: Record = { - 'bottom left': cls.optionsBottomLeft, - 'bottom right': cls.optionsBottomRight, - 'top right': cls.optionsTopRight, - 'top left': cls.optionsTopLeft, -}; diff --git a/src/shared/ui/deprecated/Popups/styles/popup.module.scss b/src/shared/ui/deprecated/Popups/styles/popup.module.scss deleted file mode 100644 index 34876cd..0000000 --- a/src/shared/ui/deprecated/Popups/styles/popup.module.scss +++ /dev/null @@ -1,40 +0,0 @@ -.popup { - position: relative; -} - -.trigger { - background: none; - border: none; - cursor: pointer; - outline: none; - margin: 0; - padding: 0; -} - -.active { - background: var(--inverted-primary-color); -} - -.disabled { - opacity: 0.7; -} - -.optionsBottomLeft { - top: 100%; - right: 0; -} - -.optionsBottomRight { - top: 100%; - left: 0; -} - -.optionsTopLeft { - bottom: 100%; - right: 0; -} - -.optionsTopRight { - bottom: 100%; - left: 0; -} diff --git a/src/shared/ui/deprecated/Popups/ui/Dropdown/Dropdown.module.scss b/src/shared/ui/deprecated/Popups/ui/Dropdown/Dropdown.module.scss deleted file mode 100644 index 731544c..0000000 --- a/src/shared/ui/deprecated/Popups/ui/Dropdown/Dropdown.module.scss +++ /dev/null @@ -1,19 +0,0 @@ -.menu { - background: var(--card-bg); - position: absolute; - z-index: 10000; - border-radius: 8px; - border: 1px solid var(--primary-color); - flex-direction: column; - display: flex; -} - -.item { - padding: 10px 25px; - width: 100%; - border: none; - background: none; - outline: none; - color: var(--primary-color); - cursor: pointer; -} diff --git a/src/shared/ui/deprecated/Popups/ui/Dropdown/Dropdown.stories.tsx b/src/shared/ui/deprecated/Popups/ui/Dropdown/Dropdown.stories.tsx deleted file mode 100644 index 4c8f2ac..0000000 --- a/src/shared/ui/deprecated/Popups/ui/Dropdown/Dropdown.stories.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; - -import { Button } from '../../../Button/Button'; -import { Dropdown } from './Dropdown'; - -export default { - title: 'shared/Dropdown', - component: Dropdown, - argTypes: { - backgroundColor: { control: 'color' }, - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ( - -); - -export const Basic = Template.bind({}); -Basic.args = { - items: [ - { content: 'Option 1', onClick: () => {} }, - { content: 'Option 2', onClick: () => {} }, - { - content: 'Option 3', - onClick: () => {}, - disabled: true, - }, - { - content: 'Option 4', - onClick: () => {}, - href: 'https://google.com', - }, - ], - trigger: , -}; diff --git a/src/shared/ui/deprecated/Popups/ui/Dropdown/Dropdown.tsx b/src/shared/ui/deprecated/Popups/ui/Dropdown/Dropdown.tsx deleted file mode 100644 index 8c7c96d..0000000 --- a/src/shared/ui/deprecated/Popups/ui/Dropdown/Dropdown.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import { Menu } from '@headlessui/react'; -import { Fragment, ReactNode } from 'react'; -import { classNames } from '@/shared/lib/classNames/classNames'; -import { DropDownDirection } from '@/shared/types/ui'; -import { mapDirectionClass } from '../../styles/consts'; -import { AppLink } from '../../../AppLink/AppLink'; -import cls from './Dropdown.module.scss'; -import popupCls from '../../styles/popup.module.scss'; - -export interface DropdownItem { - disabled?: boolean; - content?: ReactNode; - onClick?: () => void; - href?: string; -} - -interface DropdownProps { - className?: string; - items: DropdownItem[]; - direction?: DropDownDirection; - trigger: ReactNode; -} - -export function Dropdown(props: DropdownProps) { - const { className, trigger, items, direction = 'bottom right' } = props; - - const menuClasses = [mapDirectionClass[direction]]; - /** - * Устарел, используем новые компоненты из папки redesigned - * @deprecated - */ - return ( - - {trigger} - - {items.map((item, index) => { - const content = ({ active }: { active: boolean }) => ( - - ); - - if (item.href) { - return ( - - {content} - - ); - } - - return ( - - {content} - - ); - })} - - - ); -} diff --git a/src/shared/ui/deprecated/Popups/ui/ListBox/ListBox.module.scss b/src/shared/ui/deprecated/Popups/ui/ListBox/ListBox.module.scss deleted file mode 100644 index 5f6b8d4..0000000 --- a/src/shared/ui/deprecated/Popups/ui/ListBox/ListBox.module.scss +++ /dev/null @@ -1,24 +0,0 @@ -.options { - background: var(--listbox-bg); - position: absolute; - z-index: 10000; - border-radius: 12px; - box-shadow: 4px 4px 8px var(--listbox-bg); - min-width: 100%; - cursor: pointer; - color: var(--inverted-primary-color); -} - -.item { - padding: 10px 20px; -} - -.optionsTop { - bottom: 100%; -} - -.ArticleTextBlockComponent { - color: var(--primary-color); - padding: 10px 20px; - width: 100%; -} diff --git a/src/shared/ui/deprecated/Popups/ui/ListBox/ListBox.stories.tsx b/src/shared/ui/deprecated/Popups/ui/ListBox/ListBox.stories.tsx deleted file mode 100644 index 9b357cc..0000000 --- a/src/shared/ui/deprecated/Popups/ui/ListBox/ListBox.stories.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; - -import { action } from '@storybook/addon-actions'; -// eslint-disable-next-line paths-fixes/layer-imports -import { Country } from '@/entities/Country'; -import { ListBox } from './ListBox'; - -export default { - title: 'shared/ListBox', - component: ListBox, - argTypes: { - backgroundColor: { control: 'color' }, - }, - decorators: [(story) =>
{story()}
], -} as ComponentMeta; - -const Template: ComponentStory = (args) => ( - -); - -const items = [ - { value: Country.Armenia, content: Country.Armenia }, - { value: Country.Ukraine, content: Country.Ukraine }, - { value: Country.Belarus, content: Country.Belarus }, - { value: Country.Kazakhstan, content: Country.Kazakhstan }, - { value: Country.Russia, content: Country.Russia }, -]; - -export const Default = Template.bind({}); -Default.args = { - items, - onChange: action('onChange'), - defaultValue: 'defaultValues', -}; - -export const ReadOnly = Template.bind({}); -ReadOnly.args = { - items, - value: 'item1', - onChange: action('onChange'), - readonly: true, -}; - -export const TopRightDirection = Template.bind({}); -TopRightDirection.args = { - items, - value: 'item1', - onChange: action('onChange'), - direction: 'top right', -}; - -export const TopLeftDirection = Template.bind({}); -TopLeftDirection.args = { - items, - value: 'item1', - onChange: action('onChange'), - direction: 'top left', -}; - -export const BottomLeftDirection = Template.bind({}); -BottomLeftDirection.args = { - items, - value: 'item1', - onChange: action('onChange'), - direction: 'bottom left', -}; - -export const BottomRightDirection = Template.bind({}); -BottomRightDirection.args = { - items, - value: 'item1', - onChange: action('onChange'), - direction: 'bottom right', -}; diff --git a/src/shared/ui/deprecated/Popups/ui/ListBox/ListBox.tsx b/src/shared/ui/deprecated/Popups/ui/ListBox/ListBox.tsx deleted file mode 100644 index 3f6ddcc..0000000 --- a/src/shared/ui/deprecated/Popups/ui/ListBox/ListBox.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import { Fragment, memo, ReactNode } from 'react'; -import { Listbox as HListBox } from '@headlessui/react'; -import { classNames } from '@/shared/lib/classNames/classNames'; -import { DropDownDirection } from '@/shared/types/ui'; -import popupCls from '../../styles/popup.module.scss'; -import { mapDirectionClass } from '../../styles/consts'; -import { Button } from '../../../Button/Button'; -import cls from './ListBox.module.scss'; -import { HStack } from '../../../../redesigned/Stack'; - -export interface ListBoxItems { - value: string; - content: ReactNode; - disabled?: boolean; -} - -interface ListBoxProps { - items: ListBoxItems[]; - className?: string; - value?: string; - defaultValue?: string; - onChange: (value: T) => void; - readonly?: boolean; - direction?: DropDownDirection; - label?: string; -} - -export const ListBox = memo((props: ListBoxProps) => { - const { - className, - items, - value, - onChange, - defaultValue, - readonly, - direction = 'bottom right', - label, - } = props; - - const optionsClasses = [mapDirectionClass[direction]]; - /** - * Устарел, используем новые компоненты из папки redesigned - * @deprecated - */ - return ( - - {label && {`${label}>`}} - - - - - - {items.map((item) => ( - - {({ active, selected }) => ( -
  • - {item.content} -
  • - )} -
    - ))} -
    -
    -
    - ); -}); diff --git a/src/shared/ui/deprecated/Popups/ui/Popover/Popover.module.scss b/src/shared/ui/deprecated/Popups/ui/Popover/Popover.module.scss deleted file mode 100644 index bb7a8ea..0000000 --- a/src/shared/ui/deprecated/Popups/ui/Popover/Popover.module.scss +++ /dev/null @@ -1,7 +0,0 @@ -.panel { - background: var(--card-bg); - position: absolute; - z-index: 10000; - border-radius: 8px; - padding: 15px; -} diff --git a/src/shared/ui/deprecated/Popups/ui/Popover/Popover.stories.tsx b/src/shared/ui/deprecated/Popups/ui/Popover/Popover.stories.tsx deleted file mode 100644 index e3c2a79..0000000 --- a/src/shared/ui/deprecated/Popups/ui/Popover/Popover.stories.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; - -import { Popover } from './Popover'; - -export default { - title: 'shared/Popover', - component: Popover, - argTypes: { - backgroundColor: { control: 'color' }, - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ( - -); - -export const Normal = Template.bind({}); -Normal.args = { - trigger: , - children:
    Popover content
    , -}; diff --git a/src/shared/ui/deprecated/Popups/ui/Popover/Popover.tsx b/src/shared/ui/deprecated/Popups/ui/Popover/Popover.tsx deleted file mode 100644 index f47e23b..0000000 --- a/src/shared/ui/deprecated/Popups/ui/Popover/Popover.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { memo, ReactNode } from 'react'; -import { Popover as HPopover } from '@headlessui/react'; -import { classNames } from '@/shared/lib/classNames/classNames'; -import { mapDirectionClass } from '../../styles/consts'; -import popupCls from '../../styles/popup.module.scss'; -import cls from './Popover.module.scss'; -import { DropDownDirection } from '@/shared/types/ui'; - -interface PopoverProps { - className?: string; - direction?: DropDownDirection; - trigger: ReactNode; - children: ReactNode; -} - -export const Popover = memo((props: PopoverProps) => { - const { className, trigger, direction = 'bottom right', children } = props; - - const menuClasses = [mapDirectionClass[direction]]; - /** - * Устарел, используем новые компоненты из папки redesigned - * @deprecated - */ - return ( - - - {trigger} - - - - {children} - - - ); -}); diff --git a/src/shared/ui/deprecated/Select/Select.module.scss b/src/shared/ui/deprecated/Select/Select.module.scss deleted file mode 100644 index 656bca8..0000000 --- a/src/shared/ui/deprecated/Select/Select.module.scss +++ /dev/null @@ -1,21 +0,0 @@ -.Wrapper { - display: flex; - color: var(--primary-color); -} - -.label { - margin-right: 5px; -} - -.select { - background: none; - outline: none; - color: var(--primary-color); - padding: 2px 10px 2px 2px; - border: 1px solid var(--primary-color); -} - -.option { - color: var(--inverted-primary-color); - background: var(--inverted-bg-color); -} diff --git a/src/shared/ui/deprecated/Select/Select.stories.tsx b/src/shared/ui/deprecated/Select/Select.stories.tsx deleted file mode 100644 index beb2322..0000000 --- a/src/shared/ui/deprecated/Select/Select.stories.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { ComponentMeta, ComponentStory } from '@storybook/react'; -import { Select } from './Select'; - -export default { - title: 'shared/Select', - component: Select, - argTypes: { - backgroundColor: { control: 'color' }, - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => - {optionsList} - - - ); -}; diff --git a/src/shared/ui/deprecated/Select/index.ts b/src/shared/ui/deprecated/Select/index.ts deleted file mode 100644 index 7868ecb..0000000 --- a/src/shared/ui/deprecated/Select/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Select'; diff --git a/src/shared/ui/deprecated/Skeleton/Skeleton.module.scss b/src/shared/ui/deprecated/Skeleton/Skeleton.module.scss deleted file mode 100644 index 41d6076..0000000 --- a/src/shared/ui/deprecated/Skeleton/Skeleton.module.scss +++ /dev/null @@ -1,29 +0,0 @@ -.Skeleton { - width: 100%; - height: 50px; - position: relative; - box-shadow: 0 2px 10px 0 var(--skeleton-shadow); - overflow: hidden; - - &::before { - content: ""; - display: block; - position: absolute; - left: -150px; - top: 0; - height: 100%; - width: 80%; - background: linear-gradient(to right, transparent 0%, var(--skeleton-color) 50%, transparent 100%); - animation: load 1s cubic-bezier(0.4, 0, 0.2, 1) infinite; - } -} - -@keyframes load { - from { - left: -150px; - } - - to { - left: 100%; - } -} diff --git a/src/shared/ui/deprecated/Skeleton/Skeleton.stories.tsx b/src/shared/ui/deprecated/Skeleton/Skeleton.stories.tsx deleted file mode 100644 index df29654..0000000 --- a/src/shared/ui/deprecated/Skeleton/Skeleton.stories.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import React from 'react'; -import { ComponentMeta, ComponentStory } from '@storybook/react'; - -import { ThemeDecorator } from '@/shared/config/storybook/ThemeDecorator/ThemeDecorator'; -import { Skeleton } from './Skeleton'; -import { Theme } from '@/shared/const/theme'; - -export default { - title: 'shared/Skeleton', - component: Skeleton, - argTypes: { - backgroundColor: { control: 'color' }, - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ( - -); - -export const Normal = Template.bind({}); -Normal.args = { - width: '100%', - height: 200, -}; -export const Circle = Template.bind({}); -Circle.args = { - border: '50%', - width: 100, - height: 100, -}; -export const NormalDark = Template.bind({}); -NormalDark.args = { - width: '100%', - height: 200, -}; -NormalDark.decorators = [ThemeDecorator(Theme.DARK)]; -export const CircleDark = Template.bind({}); -CircleDark.args = { - border: '50%', - width: 100, - height: 100, -}; -CircleDark.decorators = [ThemeDecorator(Theme.DARK)]; diff --git a/src/shared/ui/deprecated/Skeleton/Skeleton.tsx b/src/shared/ui/deprecated/Skeleton/Skeleton.tsx deleted file mode 100644 index 1de6540..0000000 --- a/src/shared/ui/deprecated/Skeleton/Skeleton.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { CSSProperties, memo } from 'react'; -import { classNames } from '@/shared/lib/classNames/classNames'; -import cls from './Skeleton.module.scss'; - -interface SkeletonProps { - className?: string; - height?: string | number; - width?: string | number; - border?: string; -} - -export const Skeleton = memo((props: SkeletonProps) => { - const { border, height, width, className } = props; - - const styles: CSSProperties = { - width, - height, - borderRadius: border, - }; - /** - * Устарел, используем новые компоненты из папки redesigned - * @deprecated - */ - return ( -
    - ); -}); diff --git a/src/shared/ui/deprecated/Skeleton/index.ts b/src/shared/ui/deprecated/Skeleton/index.ts deleted file mode 100644 index 66bc08d..0000000 --- a/src/shared/ui/deprecated/Skeleton/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Skeleton'; diff --git a/src/shared/ui/deprecated/Tabs/Tabs.module.scss b/src/shared/ui/deprecated/Tabs/Tabs.module.scss deleted file mode 100644 index 8301141..0000000 --- a/src/shared/ui/deprecated/Tabs/Tabs.module.scss +++ /dev/null @@ -1,6 +0,0 @@ -.Tabs { - display: flex; - gap: 8px; - cursor: pointer; - color: var(--primary-color); -} diff --git a/src/shared/ui/deprecated/Tabs/Tabs.stories.tsx b/src/shared/ui/deprecated/Tabs/Tabs.stories.tsx deleted file mode 100644 index d832741..0000000 --- a/src/shared/ui/deprecated/Tabs/Tabs.stories.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; - -import { action } from '@storybook/addon-actions'; -import { Tabs } from './Tabs'; - -export default { - title: 'shared/Tabs', - component: Tabs, - argTypes: { - backgroundColor: { control: 'color' }, - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ; - -export const Normal = Template.bind({}); -Normal.args = { - tabs: [ - { - value: 'value 1', - content: 'tab 1', - }, - { - value: 'value 2', - content: 'tab 2', - }, - { - value: 'value 3', - content: 'tab 3', - }, - ], - value: 'value 2', - onTabClick: action('onTabClick'), -}; diff --git a/src/shared/ui/deprecated/Tabs/Tabs.tsx b/src/shared/ui/deprecated/Tabs/Tabs.tsx deleted file mode 100644 index 2b4733d..0000000 --- a/src/shared/ui/deprecated/Tabs/Tabs.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { memo, ReactNode, useCallback } from 'react'; -import { classNames } from '@/shared/lib/classNames/classNames'; -import { Card, CardTheme } from '../Card/Card'; -import cls from './Tabs.module.scss'; - -export interface TabItem { - value: string; - content: ReactNode; -} - -interface TabsProps { - className?: string; - tabs: TabItem[]; - value: string; - onTabClick: (tab: TabItem) => void; -} - -export const Tabs = memo((props: TabsProps) => { - const { className, tabs, onTabClick, value } = props; - - const clickHandle = useCallback( - (tab: TabItem) => { - onTabClick(tab); - }, - [onTabClick], - ); - /** - * Устарел, используем новые компоненты из папки redesigned - * @deprecated - */ - return ( -
    - {tabs.map((tab) => ( - clickHandle(tab)} - > - {tab.content} - - ))} -
    - ); -}); diff --git a/src/shared/ui/deprecated/Tabs/index.ts b/src/shared/ui/deprecated/Tabs/index.ts deleted file mode 100644 index 856dbbb..0000000 --- a/src/shared/ui/deprecated/Tabs/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Tabs'; diff --git a/src/shared/ui/deprecated/Text/Text.module.scss b/src/shared/ui/deprecated/Text/Text.module.scss deleted file mode 100644 index d09d984..0000000 --- a/src/shared/ui/deprecated/Text/Text.module.scss +++ /dev/null @@ -1,69 +0,0 @@ -.title { - color: var(--primary-color); -} - -.text { - color: var(--secondary-color); -} - -.error { - .title { - color: var(--red-light); - } - - .text { - color: var(--red-dark); - } -} - -.inverted { - .title { - color: var(--inverted-primary-color); - } - - .text { - color: var(--inverted-secondary-color); - } -} - -.left { - text-align: left; -} - -.right { - text-align: right; -} - -.center { - text-align: center; -} - -.size_s { - .title { - font: var(--font-m); - } - - .text { - font: var(--font-s); - } -} - -.size_m { - .title { - font: var(--font-l); - } - - .text { - font: var(--font-m); - } -} - -.size_l { - .title { - font: var(--font-xl); - } - - .text { - font: var(--font-l); - } -} diff --git a/src/shared/ui/deprecated/Text/Text.stories.tsx b/src/shared/ui/deprecated/Text/Text.stories.tsx deleted file mode 100644 index 712efbc..0000000 --- a/src/shared/ui/deprecated/Text/Text.stories.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import React from 'react'; -import { ComponentMeta, ComponentStory } from '@storybook/react'; -import { ThemeDecorator } from '@/shared/config/storybook/ThemeDecorator/ThemeDecorator'; -import { Text, TextSize, TextTheme } from './Text'; -import { Theme } from '@/shared/const/theme'; - -export default { - title: 'shared/Text', - component: Text, - argTypes: { - backgroundColor: { control: 'color' }, - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ; - -export const Primary = Template.bind({}); -Primary.args = { - title: 'title title title', - text: 'description description description', -}; - -export const PrimaryDark = Template.bind({}); -PrimaryDark.args = { - title: 'title title title', - text: 'description description description', -}; -PrimaryDark.decorators = [ThemeDecorator(Theme.DARK)]; - -export const onlyTitle = Template.bind({}); -onlyTitle.args = { - title: 'onlyTitle', -}; - -export const onlyDescription = Template.bind({}); -onlyDescription.args = { - text: 'onlyDescription', -}; - -export const Error = Template.bind({}); -Error.args = { - title: 'title title title', - text: 'description description description', - theme: TextTheme.ERROR, -}; - -export const sizeL = Template.bind({}); -sizeL.args = { - title: 'title title title', - text: 'description description description', - size: TextSize.L, -}; - -export const sizeM = Template.bind({}); -sizeM.args = { - title: 'title title title', - text: 'description description description', - size: TextSize.M, -}; - -export const sizeS = Template.bind({}); -sizeS.args = { - title: 'title title title', - text: 'description description description', - size: TextSize.S, -}; diff --git a/src/shared/ui/deprecated/Text/Text.tsx b/src/shared/ui/deprecated/Text/Text.tsx deleted file mode 100644 index a6aca9e..0000000 --- a/src/shared/ui/deprecated/Text/Text.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import { memo } from 'react'; -import { classNames } from '@/shared/lib/classNames/classNames'; -import cls from './Text.module.scss'; - -export enum TextTheme { - PRIMARY = 'primary', - INVERTED = 'inverted', - ERROR = 'error', -} - -export enum TextAlign { - RIGHT = 'right', - LEFT = 'left', - CENTER = 'center', -} -export enum TextSize { - S = 'size_s', - M = 'size_m', - L = 'size_l', -} - -interface TextProps { - className?: string; - title?: string; - text?: string; - theme?: TextTheme; - align?: TextAlign; - size?: TextSize; - - 'data-testid'?: string; -} - -type HeaderTagType = 'h1' | 'h2' | 'h3'; - -const mapSizeToHeaderTag: Record = { - [TextSize.S]: 'h3', - [TextSize.M]: 'h2', - [TextSize.L]: 'h1', -}; - -export const Text = memo((props: TextProps) => { - const { - className, - text, - title, - theme = TextTheme.PRIMARY, - align = TextAlign.LEFT, - size = TextSize.M, - 'data-testid': dataTestId = 'Text', - } = props; - - const additional = [className, cls[theme], cls[align], cls[size]]; - - const HeaderTag = mapSizeToHeaderTag[size]; - /** - * Устарел, используем новые компоненты из папки redesigned - * @deprecated - */ - return ( -
    - {title && ( - - {title} - - )} - {text && ( -

    - {text} -

    - )} -
    - ); -}); diff --git a/src/shared/ui/deprecated/Text/index.ts b/src/shared/ui/deprecated/Text/index.ts deleted file mode 100644 index b0c76af..0000000 --- a/src/shared/ui/deprecated/Text/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Text'; diff --git a/src/shared/ui/redesigned/Avatar/Avatar.tsx b/src/shared/ui/redesigned/Avatar/Avatar.tsx index 6bac335..96b0642 100644 --- a/src/shared/ui/redesigned/Avatar/Avatar.tsx +++ b/src/shared/ui/redesigned/Avatar/Avatar.tsx @@ -4,7 +4,7 @@ import cls from './Avatar.module.scss'; import { AppImage } from '../../redesigned/AppImage'; import UserIcon from '../../../assets/icons/user-filled.svg'; import { Icon } from '../Icon'; -import { Skeleton } from '../../deprecated/Skeleton'; +import { Skeleton } from '../Skeleton'; export interface AvatarProps { className?: string; diff --git a/src/shared/ui/deprecated/Loader/Loader.scss b/src/shared/ui/redesigned/Loader/Loader.scss similarity index 100% rename from src/shared/ui/deprecated/Loader/Loader.scss rename to src/shared/ui/redesigned/Loader/Loader.scss diff --git a/src/shared/ui/deprecated/Loader/Loader.stories.tsx b/src/shared/ui/redesigned/Loader/Loader.stories.tsx similarity index 100% rename from src/shared/ui/deprecated/Loader/Loader.stories.tsx rename to src/shared/ui/redesigned/Loader/Loader.stories.tsx diff --git a/src/shared/ui/deprecated/Loader/Loader.tsx b/src/shared/ui/redesigned/Loader/Loader.tsx similarity index 100% rename from src/shared/ui/deprecated/Loader/Loader.tsx rename to src/shared/ui/redesigned/Loader/Loader.tsx diff --git a/src/shared/ui/deprecated/Loader/index.ts b/src/shared/ui/redesigned/Loader/index.ts similarity index 100% rename from src/shared/ui/deprecated/Loader/index.ts rename to src/shared/ui/redesigned/Loader/index.ts diff --git a/src/widgets/ErrorPage/ui/ErrorPage.tsx b/src/widgets/ErrorPage/ui/ErrorPage.tsx index 85ce32c..e5715cc 100644 --- a/src/widgets/ErrorPage/ui/ErrorPage.tsx +++ b/src/widgets/ErrorPage/ui/ErrorPage.tsx @@ -1,5 +1,5 @@ import { useTranslation } from 'react-i18next'; -import { Button } from '@/shared/ui/deprecated/Button'; +import { Button } from '@/shared/ui/redesigned/Button'; import { classNames } from '@/shared/lib/classNames/classNames'; import cls from './ErrorPage.module.scss'; diff --git a/src/widgets/PageError/ui/PageError/PageError.tsx b/src/widgets/PageError/ui/PageError/PageError.tsx index 439c97a..194cd81 100644 --- a/src/widgets/PageError/ui/PageError/PageError.tsx +++ b/src/widgets/PageError/ui/PageError/PageError.tsx @@ -1,5 +1,5 @@ import { useTranslation } from 'react-i18next'; -import { Button } from '@/shared/ui/deprecated/Button'; +import { Button } from '@/shared/ui/redesigned/Button'; import { classNames } from '@/shared/lib/classNames/classNames'; import cls from './PageError.module.scss';