-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change sidebar, icons, buttons, links
- Loading branch information
Showing
23 changed files
with
645 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.primary { | ||
color: var(--text-redesigned); | ||
|
||
&:hover { | ||
color: var(--accent-redesigned); | ||
} | ||
} | ||
|
||
.red { | ||
color: var(--cancel-redesigned); | ||
|
||
&:hover { | ||
opacity: 0.8; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from 'react'; | ||
import { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
import { ThemeDecorator } from '@/shared/config/storybook/ThemeDecorator/ThemeDecorator'; | ||
import { AppLink } from './AppLink'; | ||
import { Theme } from '@/shared/const/theme'; | ||
|
||
export default { | ||
title: 'shared/AppLink', | ||
component: AppLink, | ||
argTypes: { | ||
backgroundColor: { control: 'color' }, | ||
}, | ||
args: { | ||
to: '/', | ||
}, | ||
} as ComponentMeta<typeof AppLink>; | ||
|
||
const Template: ComponentStory<typeof AppLink> = (args) => ( | ||
<AppLink {...args} /> | ||
); | ||
|
||
export const Primary = Template.bind({}); | ||
Primary.args = { | ||
children: 'Text', | ||
variant: 'primary', | ||
}; | ||
|
||
export const Red = Template.bind({}); | ||
Red.args = { | ||
children: 'Text', | ||
variant: 'red', | ||
}; | ||
|
||
export const PrimaryDark = Template.bind({}); | ||
PrimaryDark.args = { | ||
children: 'Text', | ||
variant: 'primary', | ||
}; | ||
PrimaryDark.decorators = [ThemeDecorator(Theme.DARK)]; | ||
|
||
export const RedDark = Template.bind({}); | ||
RedDark.args = { | ||
children: 'Text', | ||
variant: 'red', | ||
}; | ||
RedDark.decorators = [ThemeDecorator(Theme.DARK)]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { LinkProps, NavLink } from 'react-router-dom'; | ||
import { memo, ReactNode } from 'react'; | ||
import { classNames } from '@/shared/lib/classNames/classNames'; | ||
import cls from './AppLink.module.scss'; | ||
|
||
export type AppLinkVariant = 'primary' | 'red'; | ||
|
||
interface AppLinkProps extends LinkProps { | ||
className?: string; | ||
variant?: AppLinkVariant; | ||
children?: ReactNode; | ||
activeClassName?: string; | ||
} | ||
|
||
export const AppLink = memo((props: AppLinkProps) => { | ||
const { | ||
to, | ||
className, | ||
children, | ||
variant = 'primary', | ||
activeClassName = '', | ||
...otherProps | ||
} = props; | ||
|
||
return ( | ||
<NavLink | ||
to={to} | ||
className={({ isActive }) => | ||
classNames(cls.AppLink, { [activeClassName]: isActive }, [ | ||
className, | ||
cls[variant], | ||
]) | ||
} | ||
{...otherProps} | ||
> | ||
{children} | ||
</NavLink> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './AppLink'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 9 additions & 7 deletions
16
src/shared/ui/deprecated/AppLogo/AppLogo.tsx → src/shared/ui/redesigned/AppLogo/AppLogo.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
import React, { memo } from 'react'; | ||
import cls from './AppLogo.module.scss'; | ||
import { HStack } from '../Stack'; | ||
import { HStack } from '../../deprecated/Stack'; | ||
import AppSvg from '@/shared/assets/icons/app-image.svg'; | ||
import { classNames } from '@/shared/lib/classNames/classNames'; | ||
|
||
interface AppLogoProps { | ||
className?: string; | ||
size?: number; | ||
} | ||
/** | ||
* Устарел, используем новые компоненты из папки redesigned | ||
* @deprecated | ||
*/ | ||
|
||
export const AppLogo = memo(({ className }: AppLogoProps) => ( | ||
export const AppLogo = memo(({ className, size = 50 }: AppLogoProps) => ( | ||
<HStack | ||
max | ||
justify="center" | ||
className={classNames(cls.appLogoWrapper, {}, [className])} | ||
> | ||
<div className={cls.gradientBig} /> | ||
<div className={cls.gradientSmall} /> | ||
<AppSvg className={cls.appLogo} /> | ||
<AppSvg | ||
width={size} | ||
height={size} | ||
color="black" | ||
className={cls.appLogo} | ||
/> | ||
</HStack> | ||
)); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
.Button { | ||
cursor: pointer; | ||
color: var(--text-redesigned); | ||
padding: 6px 15px; | ||
|
||
&:hover { | ||
color: var(--accent-redesigned); | ||
} | ||
} | ||
|
||
.clear { | ||
padding: 0; | ||
border: none; | ||
background: none; | ||
outline: none; | ||
} | ||
|
||
.square { | ||
padding: 0; | ||
} | ||
|
||
.square.m { | ||
width: var(--font-line-m); | ||
height: var(--font-line-m); | ||
} | ||
|
||
.square.l { | ||
width: var(--font-line-l); | ||
height: var(--font-line-l); | ||
} | ||
|
||
.square.xl { | ||
width: var(--font-line-xl); | ||
height: var(--font-line-xl); | ||
} | ||
|
||
.m { | ||
font: var(--font-m-redesigned); | ||
} | ||
|
||
.l { | ||
font: var(--font-l-redesigned); | ||
} | ||
|
||
.xl { | ||
font: var(--font-xl-redesigned); | ||
} | ||
|
||
.disabled { | ||
opacity: 0.5; | ||
} | ||
|
||
.fullWidth { | ||
width: 100%; | ||
} |
Oops, something went wrong.