-
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: add memo for components \ profile page folders
- Loading branch information
Showing
104 changed files
with
264 additions
and
80 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-54.8 KB
(31%)
.loki/reference/chrome_iphone7_shared_AppLink_Primary_Dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-54.8 KB
(31%)
.loki/reference/chrome_iphone7_shared_AppLink_Secondary_Dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-54.1 KB
(31%)
.loki/reference/chrome_iphone7_shared_Button_Background_Inverted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-54.2 KB
(31%)
.loki/reference/chrome_iphone7_shared_Button_Background_Theme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-54.2 KB
(31%)
.loki/reference/chrome_iphone7_shared_Button_Clear_Inverted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-54.5 KB
(31%)
.loki/reference/chrome_iphone7_shared_Button_Outline_Dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-54 KB
(31%)
.loki/reference/chrome_iphone7_shared_Button_Outline_Size_L.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-54 KB
(31%)
.loki/reference/chrome_iphone7_shared_Button_Outline_Size_XL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
-54.5 KB
(32%)
.loki/reference/chrome_iphone7_shared_ThemeSwitcher_Dark.png
Oops, something went wrong.
Binary file modified
BIN
-53.9 KB
(32%)
.loki/reference/chrome_iphone7_shared_ThemeSwitcher_Normal.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
-28.5 KB
(36%)
.loki/reference/chrome_laptop_shared_AppLink_Primary_Dark.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
-28.5 KB
(36%)
.loki/reference/chrome_laptop_shared_AppLink_Secondary_Dark.png
Oops, something went wrong.
Binary file modified
BIN
-28.6 KB
(36%)
.loki/reference/chrome_laptop_shared_Button_Background_Inverted.png
Oops, something went wrong.
Binary file modified
BIN
-28.6 KB
(36%)
.loki/reference/chrome_laptop_shared_Button_Background_Theme.png
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
-28.6 KB
(36%)
.loki/reference/chrome_laptop_shared_Button_Clear_Inverted.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
-28.4 KB
(36%)
.loki/reference/chrome_laptop_shared_Button_Outline_Dark.png
Oops, something went wrong.
Binary file modified
BIN
-28.6 KB
(36%)
.loki/reference/chrome_laptop_shared_Button_Outline_Size_L.png
Oops, something went wrong.
Binary file modified
BIN
-28.6 KB
(36%)
.loki/reference/chrome_laptop_shared_Button_Outline_Size_XL.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
-28.7 KB
(37%)
.loki/reference/chrome_laptop_shared_ThemeSwitcher_Normal.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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,4 +1,5 @@ | ||
{ | ||
"PROFILE PAGE": "", | ||
"auth_form": "", | ||
"auth_password": "", | ||
"auth_username": "", | ||
|
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,3 @@ | ||
export { Profile, ProfileSchema } from './model/types/profile'; | ||
|
||
export { profileActions, profileReducer } from './model/slice/profileSlice'; |
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,18 @@ | ||
import { createSlice } from '@reduxjs/toolkit'; | ||
import { ProfileSchema } from '../types/profile'; | ||
|
||
const initialState: ProfileSchema = { | ||
readonly: true, | ||
data: undefined, | ||
error: undefined, | ||
isLoading: false, | ||
}; | ||
|
||
export const profileSlice = createSlice({ | ||
name: 'profile', | ||
initialState, | ||
reducers: {}, | ||
}); | ||
|
||
export const { actions: profileActions } = profileSlice; | ||
export const { reducer: profileReducer } = profileSlice; |
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,19 @@ | ||
import { Country, Currency } from 'shared/const/common'; | ||
|
||
export interface Profile { | ||
'first': string, | ||
'lastname': string, | ||
'age': number, | ||
'currency': Currency, | ||
'country': Country, | ||
'city': string, | ||
'username': string, | ||
'avatar': string | ||
} | ||
|
||
export interface ProfileSchema { | ||
data?: Profile; | ||
isLoading: boolean; | ||
error?: string; | ||
readonly: boolean; | ||
} |
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import React from 'react'; | ||
import React, { memo } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
const AboutPage = (props: any) => { | ||
const AboutPage = memo((props: any) => { | ||
const { t } = useTranslation('about'); | ||
|
||
return ( | ||
<div> | ||
{t('О сайте')} | ||
</div> | ||
); | ||
}; | ||
}); | ||
|
||
export default AboutPage; |
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import React from 'react'; | ||
import React, { memo } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
const MainPage = (props: any) => { | ||
const MainPage = memo((props: any) => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<div> | ||
{t('Главная страница')} | ||
</div> | ||
); | ||
}; | ||
}); | ||
|
||
export default MainPage; |
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,16 +1,17 @@ | ||
import { classNames } from 'shared/lib/classNames/classNames'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { memo } from 'react'; | ||
import cls from './NotFoundPage.module.scss'; | ||
|
||
interface NotFoundPageProps { | ||
className?: string; | ||
} | ||
|
||
export const NotFoundPage = ({ className }: NotFoundPageProps) => { | ||
export const NotFoundPage = memo(({ className }: NotFoundPageProps) => { | ||
const { t } = useTranslation(); | ||
return ( | ||
<div className={classNames(cls.NotFoundPage, {}, [className])}> | ||
{t('Страница не найдена')} | ||
</div> | ||
); | ||
}; | ||
}); |
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 { ProfilePageAsync as ProfilePage } from './ui/ProfilePage.async'; |
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,7 @@ | ||
import { lazy } from 'react'; | ||
|
||
export const ProfilePageAsync = lazy(() => new Promise((resolve) => { | ||
// @ts-ignore | ||
// ТАК В РЕАЛЬНЫХ ПРОЕКТАХ НЕ ДЕЛАТЬ!!!!! ДЕЛАЕМ ДЛЯ КУРСА! | ||
setTimeout(() => resolve(import('./ProfilePage')), 1500); | ||
})); |
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,24 @@ | ||
import React from 'react'; | ||
import { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
import { ThemeDecorator } from 'shared/config/storybook/ThemeDecorator/ThemeDecorator'; | ||
import { Theme } from 'app/providers/ThemeProvider'; | ||
import ProfilePage from 'pages/ProfilePage/ui/ProfilePage'; | ||
|
||
export default { | ||
title: 'pages/ProfilePage', | ||
component: ProfilePage, | ||
argTypes: { | ||
backgroundColor: { control: 'color' }, | ||
}, | ||
} as ComponentMeta<typeof ProfilePage>; | ||
|
||
const Template: ComponentStory<typeof ProfilePage> = (args) => <ProfilePage {...args} />; | ||
|
||
export const Normal = Template.bind({}); | ||
Normal.args = {}; | ||
// Normal.decorators = [StoreDecorator({})]; | ||
|
||
export const Dark = Template.bind({}); | ||
Dark.args = {}; | ||
// Dark.decorators = [ThemeDecorator(Theme.DARK), StoreDecorator({})]; | ||
Dark.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,27 @@ | ||
import { classNames } from 'shared/lib/classNames/classNames'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { memo } from 'react'; | ||
import { DynamicModuleLoader, ReducersList } from 'shared/lib/components/DynamicModuleLoared/DynamicModuleLoared'; | ||
import { profileReducer } from 'entities/Profile'; | ||
|
||
const reducers: ReducersList = { | ||
profile: profileReducer, | ||
}; | ||
|
||
interface ProfilePageProps { | ||
className?: string; | ||
} | ||
|
||
const ProfilePage = memo(({ className }: ProfilePageProps) => { | ||
const { t } = useTranslation(); | ||
return ( | ||
<DynamicModuleLoader reducers={reducers} removeAfterUnmount> | ||
<div className={classNames('', {}, [className])}> | ||
{t('PROFILE PAGE')} | ||
</div> | ||
</DynamicModuleLoader> | ||
|
||
); | ||
}); | ||
|
||
export default ProfilePage; |
Oops, something went wrong.
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,13 @@ | ||
export enum Currency { | ||
"RUB" = "RUB", | ||
"EUR" = "EUR", | ||
"USD" = "USD", | ||
} | ||
|
||
export enum Country { | ||
Russia = 'Russia', | ||
Belarus = 'Belarus', | ||
Ukraine = 'Ukraine', | ||
Kazakhstan = 'Kazahstan', | ||
Armenia = 'Armenia', | ||
} |
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
Oops, something went wrong.