Skip to content

Commit

Permalink
Redesigned sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
vladislav0sidorov committed Oct 15, 2023
1 parent 71979a1 commit ff4176f
Show file tree
Hide file tree
Showing 91 changed files with 1,380 additions and 122 deletions.
Binary file modified .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = {
'border',
'flexAling',
'featureName',
'variant',
],
},
],
Expand Down
3 changes: 2 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"rules": {
"indentation": [2],
"selector-class-pattern": null,
"no-missing-end-of-source-newline": null
"no-missing-end-of-source-newline": null,
"max-line-length": 300
}
}
2 changes: 1 addition & 1 deletion src/app/styles/themes/dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
--bg-redesigned: #0c1214;
--light-bg-redesigned: #151c1f;
--text-redesigned: #dbdbdb;
--hint-redesigned: #555555;
--hint-redesigned: #555;
--cancel-redesigned: #d95757;
--save-redesigned: #6cd98b;
--icon-redesigned: #74a2b2;
Expand Down
4 changes: 2 additions & 2 deletions src/app/styles/themes/light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
--inverted-third-color: #161313;

// redesigned
--dark-bg-redesigned: #ffffff;
--dark-bg-redesigned: #fff;
--bg-redesigned: #eff5f6;
--light-bg-redesigned: #e2eef1;
--text-redesigned: #141c1f;
--hint-redesigned: #adbcc0;
--cancel-redesigned: #ff7777;
--cancel-redesigned: #f77;
--save-redesigned: #62de85;
--icon-redesigned: #5ed3f3;
--accent-redesigned: #00c8ff;
Expand Down
9 changes: 6 additions & 3 deletions src/app/styles/variables/global.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:root {
--font-family-main: 'Raleway', sans-serif;
--font-family-main: "Raleway", sans-serif;

// S
--font-size-s: 10px;
Expand Down Expand Up @@ -42,8 +42,8 @@
--red-dark: #c90000;

// *Redesigned variavles
--font-family-text-redesigned: 'Nunito Sans', sans-serif;
--font-family-title-redesigned: font-family: 'Roboto', sans-serif;
--font-family-text-redesigned: "Nunito Sans", sans-serif;
--font-family-title-redesigned: font-family: "Roboto", sans-serif;

// S
--font-s-redesigned: var(--font-size-s) / var(--font-line-s) var(--font-family-text-redesigned);
Expand All @@ -56,4 +56,7 @@

// XL
--font-xl-redesigned: var(--font-size-xl) / var(--font-line-xl) var(--font-family-title-redesigned);

// Sidebar
--sidebar-width-collapsed-redesigned: 50px;
}
2 changes: 1 addition & 1 deletion src/entities/Article/ui/ArticleDetails/ArticleDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useAppDispatch } from '@/shared/lib/hooks/useAppDispatch/useAppDispatch
import EyeIcon from '@/shared/assets/icons/eye.svg'
import CalendarIcon from '@/shared/assets/icons/calendar.svg'
import { useInitialEffect } from '@/shared/lib/hooks/useInitialEffect/useInitialEffect'
import { HStack, VStack } from '@/shared/ui/Stack'
import { HStack, VStack } from '@/shared/ui/redesigned/Stack'
import { Avatar } from '@/shared/ui/deprecated/Avatar'
import { Icon } from '@/shared/ui/deprecated/Icon'
import { Skeleton } from '@/shared/ui/deprecated/Skeleton'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import EyeIcon from '@/shared/assets/icons/eye.svg'
import { getRouteArticleDetails } from '@/shared/const/router'
import { Icon } from '@/shared/ui/deprecated/Icon'
import { Text, TextSize } from '@/shared/ui/deprecated/Text'
import { VStack } from '@/shared/ui/Stack'
import { VStack } from '@/shared/ui/redesigned/Stack'
import { AppImage } from '@/shared/ui/deprecated/AppImage'
import { AppLink } from '@/shared/ui/deprecated/AppLink'
import { Avatar } from '@/shared/ui/deprecated/Avatar'
Expand Down
2 changes: 1 addition & 1 deletion src/entities/Comment/ui/CommentCard/CommentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import cls from './CommentCard.module.scss'

import { classNames } from '@/shared/lib/ClassNames/ClassNames'
import { getRouteProfile } from '@/shared/const/router'
import { VStack } from '@/shared/ui/Stack'
import { VStack } from '@/shared/ui/redesigned/Stack'
import { AppLink } from '@/shared/ui/deprecated/AppLink'
import { Avatar } from '@/shared/ui/deprecated/Avatar'
import { Skeleton } from '@/shared/ui/deprecated/Skeleton'
Expand Down
2 changes: 1 addition & 1 deletion src/entities/Comment/ui/CommentList/CommentList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Comment } from '../../model/types/comment'
import { CommentCard } from '../CommentCard/CommentCard'

import { classNames } from '@/shared/lib/ClassNames/ClassNames'
import { VStack } from '@/shared/ui/Stack'
import { VStack } from '@/shared/ui/redesigned/Stack'
import { Text } from '@/shared/ui/deprecated/Text'

interface CommentListProps {
Expand Down
2 changes: 1 addition & 1 deletion src/entities/Country/ui/CountrySelect/CountrySelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { memo } from 'react'
import { Country } from '../../model/types/country'

import { classNames } from '@/shared/lib/ClassNames/ClassNames'
import { ListBox } from '@/shared/ui/Popups/ui/ListBox/ListBox'
import { ListBox } from '@/shared/ui/redesigned/Popups/ui/ListBox/ListBox'

interface CountrySelectProps {
className?: string
Expand Down
2 changes: 1 addition & 1 deletion src/entities/Currency/ui/CurrencySelect/CurrencySelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { memo } from 'react'
import { Currency } from '../../model/types/currency'

import { classNames } from '@/shared/lib/ClassNames/ClassNames'
import { ListBox } from '@/shared/ui/Popups/ui/ListBox/ListBox'
import { ListBox } from '@/shared/ui/redesigned/Popups/ui/ListBox/ListBox'

interface CurrencySelectProps {
className?: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { NotificationItem } from '../NotificationItem/NotificationItem'

import { classNames } from '@/shared/lib/ClassNames/ClassNames'
import { Skeleton } from '@/shared/ui/deprecated/Skeleton'
import { VStack } from '@/shared/ui/Stack'
import { VStack } from '@/shared/ui/redesigned/Stack'
// import cls from './NotificationList.module.scss';

interface NotificationListProps {
Expand Down
2 changes: 1 addition & 1 deletion src/entities/Profile/ui/ProfileCard/ProfileCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Profile } from '../../model/types/profile'
import { classNames, Mods } from '@/shared/lib/ClassNames/ClassNames'
import { Currency, CurrencySelect } from '@/entities/Currency'
import { Country, CountrySelect } from '@/entities/Country'
import { HStack, VStack } from '@/shared/ui/Stack'
import { HStack, VStack } from '@/shared/ui/redesigned/Stack'
import { Avatar } from '@/shared/ui/deprecated/Avatar'
import { Input } from '@/shared/ui/deprecated/Input'
import { TextTheme, TextAling, Text } from '@/shared/ui/deprecated/Text/ui/Text'
Expand Down
2 changes: 1 addition & 1 deletion src/entities/Rating/ui/RatingCart/RatingCart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BrowserView, MobileView } from 'react-device-detect'
import { classNames } from '@/shared/lib/ClassNames/ClassNames'
import { Text } from '@/shared/ui/deprecated/Text'
import { Input } from '@/shared/ui/deprecated/Input'
import { VStack, HStack } from '@/shared/ui/Stack'
import { VStack, HStack } from '@/shared/ui/redesigned/Stack'
import { Button, ButtonVariables } from '@/shared/ui/deprecated/Button'
import { ButtonSizes } from '@/shared/ui/deprecated/Button/ui/Button'
import { Card } from '@/shared/ui/deprecated/Card'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getArticleRecomendationsList } from '../../api/ArticleRecomendationsLis
import { classNames } from '@/shared/lib/ClassNames/ClassNames'
import { ArticleList } from '@/entities/Article'
import { Text, TextSize } from '@/shared/ui/deprecated/Text'
import { VStack } from '@/shared/ui/Stack'
import { VStack } from '@/shared/ui/redesigned/Stack'

// import cls from './ArticleRecomendationsList.module.scss';

Expand Down
2 changes: 1 addition & 1 deletion src/features/AvatarDropdown/ui/AvatarDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useDispatch, useSelector } from 'react-redux'

import { getUserAuthData, isUserAdmin, isUserManager, userActions } from '@/entities/User'
import { getRouteAdminPanel, getRouteProfile } from '@/shared/const/router'
import { Dropdown } from '@/shared/ui/Popups'
import { Dropdown } from '@/shared/ui/redesigned/Popups'
import { Avatar } from '@/shared/ui/deprecated/Avatar'

interface AvatarDropdownProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { updateProfileData } from '../../model/services/updateProfileData/update
import { classNames } from '@/shared/lib/ClassNames/ClassNames'
import { useAppDispatch } from '@/shared/lib/hooks/useAppDispatch/useAppDispatch'
import { getUserAuthData } from '@/entities/User'
import { HStack } from '@/shared/ui/Stack'
import { HStack } from '@/shared/ui/redesigned/Stack'
import { Button, ButtonVariables } from '@/shared/ui/deprecated/Button'
import { Text } from '@/shared/ui/deprecated/Text'

Expand Down
20 changes: 17 additions & 3 deletions src/features/LangSwitcher/ui/LangSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { memo } from 'react'
import { useTranslation } from 'react-i18next'

import { classNames } from '@/shared/lib/ClassNames/ClassNames'
import { Button, ButtonVariables } from '@/shared/ui/deprecated/Button'
import { Button as ButtonDeprecated, ButtonVariables } from '@/shared/ui/deprecated/Button'
import { ToggleFeaturesComponent } from '@/shared/lib/features'
import { Button } from '@/shared/ui/redesigned/Button'

interface LangSwitcherProps {
className?: string
Expand All @@ -18,9 +20,21 @@ export const LangSwitcher: React.FC<LangSwitcherProps> = memo((props) => {
i18n.changeLanguage(i18n.language === 'ru' ? 'en' : 'ru')
}

return (
<Button theme={ButtonVariables.CLEAR_THIRD} onClick={switchLanguage} className={classNames('', {}, [className])}>
const deprecatedContent = (
<ButtonDeprecated
theme={ButtonVariables.CLEAR_THIRD}
onClick={switchLanguage}
className={classNames('', {}, [className])}
>
{t(short ? 'Короткий язык' : 'Русский')}
</ButtonDeprecated>
)

const redesignedContent = (
<Button variant="clear" onClick={switchLanguage} className={classNames('', {}, [className])}>
{t(short ? 'Короткий язык' : 'Русский')}
</Button>
)

return <ToggleFeaturesComponent featureName="isAppRedesigned" on={redesignedContent} off={deprecatedContent} />
})
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BrowserView, MobileView } from 'react-device-detect'
import cls from './NotificationButton.module.scss'

import { NotificationList } from '@/entities/Notification'
import { Popover } from '@/shared/ui/Popups'
import { Popover } from '@/shared/ui/redesigned/Popups'
import Notification from '@/shared/assets/icons/notification.svg'
import { Button, ButtonVariables } from '@/shared/ui/deprecated/Button'
import { Drawer } from '@/shared/ui/deprecated/Drawer'
Expand Down
30 changes: 23 additions & 7 deletions src/features/ThemeSwitcher/ui/ThemeSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ import { memo, useCallback } from 'react'

import { Theme, useTheme } from '@/app/providers/ThemeProvider'
import { classNames } from '@/shared/lib/ClassNames/ClassNames'
import LightIcon from '@/shared/assets/icons/white.svg'
import DarkIcon from '@/shared/assets/icons/orange.svg'
import LightIconDeprecated from '@/shared/assets/icons/white.svg'
import DarkIconDeprecated from '@/shared/assets/icons/orange.svg'
import ThemeSwitcherIcon from '@/shared/assets/icons/redesign/theme-switcher.svg'
import { useAppDispatch } from '@/shared/lib/hooks/useAppDispatch/useAppDispatch'
import { saveJsonSettings } from '@/entities/User'
import { Button, ButtonVariables } from '@/shared/ui/deprecated/Button'
import { Icon } from '@/shared/ui/deprecated/Icon'
import { Button as ButtonDeprecated, ButtonVariables } from '@/shared/ui/deprecated/Button'
import { Icon as IconDeprecated } from '@/shared/ui/deprecated/Icon'
import { ToggleFeaturesComponent } from '@/shared/lib/features'
import { Button } from '@/shared/ui/redesigned/Button'
import { Icon } from '@/shared/ui/redesigned/Icon'

interface ThemeSwitcherProps {
className?: string
Expand All @@ -24,9 +28,21 @@ export const ThemeSwitcher: React.FC<ThemeSwitcherProps> = memo((props) => {
})
}, [dispatch, toggleTheme])

return (
<Button theme={ButtonVariables.CLEAR_THIRD} onClick={onToggleHandler} className={classNames('', {}, [className])}>
<Icon height={24} width={24} Svg={theme === Theme.DARK ? DarkIcon : LightIcon} />
const deprecatedContent = (
<ButtonDeprecated
theme={ButtonVariables.CLEAR_THIRD}
onClick={onToggleHandler}
className={classNames('', {}, [className])}
>
<IconDeprecated height={24} width={24} Svg={theme === Theme.DARK ? DarkIconDeprecated : LightIconDeprecated} />
</ButtonDeprecated>
)

const redesignedContent = (
<Button variant="clear" onClick={onToggleHandler} className={classNames('', {}, [className])}>
<Icon Svg={ThemeSwitcherIcon} />
</Button>
)

return <ToggleFeaturesComponent featureName="isAppRedesigned" on={redesignedContent} off={deprecatedContent} />
})
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import cls from './AddCommentForm.module.scss'
import { classNames } from '@/shared/lib/ClassNames/ClassNames'
import { useAppDispatch } from '@/shared/lib/hooks/useAppDispatch/useAppDispatch'
import { DynamicModuleLoader, ReducersList } from '@/shared/lib/components/DynamicModuleLoader/DynamicModuleLoader'
import { HStack } from '@/shared/ui/Stack'
import { HStack } from '@/shared/ui/redesigned/Stack'
import { Input } from '@/shared/ui/deprecated/Input'
import { Button, ButtonVariables } from '@/shared/ui/deprecated/Button'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { getArticleCommentsLoading } from '../../model/selectors/getArticleComme
import { AddCommentForm } from '@/features/addCommentForm'
import { CommentList } from '@/entities/Comment'
import { useInitialEffect } from '@/shared/lib/hooks/useInitialEffect/useInitialEffect'
import { VStack } from '@/shared/ui/Stack'
import { VStack } from '@/shared/ui/redesigned/Stack'
import { Text, TextSize } from '@/shared/ui/deprecated/Text'

// import cls from './ArticleDetailsComments.module.scss';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ArticleRecomendationsList } from '@/features/ArticleRecomendationsList'
import { ArticleRating } from '@/features/ArticleRating'
import { toggleFeatures } from '@/shared/lib/features'
import { Card } from '@/shared/ui/deprecated/Card'
import { VStack } from '@/shared/ui/Stack'
import { VStack } from '@/shared/ui/redesigned/Stack'

interface ArticleDetailsPageProps {
className?: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getCanEditArticle } from '../../model/selectors/getCanEditArticle/getCa
import { classNames } from '@/shared/lib/ClassNames/ClassNames'
import { getArticleDetailsData } from '@/entities/Article'
import { getRouteArticleEdit, getRouteArticles } from '@/shared/const/router'
import { HStack } from '@/shared/ui/Stack'
import { HStack } from '@/shared/ui/redesigned/Stack'
import { Button, ButtonVariables } from '@/shared/ui/deprecated/Button'

interface ArticleDetailsPageHeaderProps {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ProfilePage/ui/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useParams } from 'react-router-dom'
import { useTranslation } from 'react-i18next'

import { Page } from '@/widgets/Page'
import { VStack } from '@/shared/ui/Stack'
import { VStack } from '@/shared/ui/redesigned/Stack'
import { EditableProfileCard } from '@/features/EditableProfileCard'

interface ProfilePageProps {
Expand Down
4 changes: 2 additions & 2 deletions src/shared/assets/icons/redesign/arrow-to-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions src/shared/layouts/MainLayout/ui/MainLayout.module.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
.MainLayout {
min-width: 100%;
display: grid;
grid-template-areas: 'sidebar content rightbar';
grid-template-columns: 284px 1fr 176px;
grid-template-areas: "sidebar content rightbar";
grid-template-columns: 284px 1fr 100px;
}

.sidebar {
grid-area: sidebar;
justify-self: center;
padding: 32px;
}

.content {
grid-area: content;
justify-self: center;
max-width: 1200px;
width: 100%;
padding: 32px;
}

Expand All @@ -23,6 +24,7 @@
top: 0;
height: 100vh;
}

.rightbar {
display: flex;
flex-direction: column;
Expand Down
Binary file added src/shared/ui/.DS_Store
Binary file not shown.
21 changes: 0 additions & 21 deletions src/shared/ui/deprecated/AppLogo/ui/AppLogo.module.scss

This file was deleted.

2 changes: 1 addition & 1 deletion src/shared/ui/deprecated/Modal/ui/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { ReactNode } from 'react'

import { Portal } from '../../../Portal'
import { Portal } from '../../../redesigned/Portal'
import cls from './Modal.module.scss'
import { Overlay } from '../../Overlay'

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ComponentStory, ComponentMeta } from '@storybook/react'

// eslint-disable-next-line ulbi-tv-plugin/path-checker
import { Dropdown } from './Dropdown'
import { Button } from '../../../deprecated/Button'
import { Button } from '../../../../deprecated/Button'

export default {
title: 'shared/Popups/Dropdown',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Menu } from '@headlessui/react'
import cls from './Dropdown.module.scss'
import popupCls from '../../styles/Popups.module.scss'
import { mapDirectionClass } from '../../styles/const'
import { AppLink } from '../../../deprecated/AppLink'
import { AppLink } from '../../../../deprecated/AppLink'

import { DropdownDirection } from '@/shared/types/ui'
import { classNames } from '@/shared/lib/ClassNames/ClassNames'
Expand Down
Loading

0 comments on commit ff4176f

Please sign in to comment.