-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review #3
Closed
Closed
Review #3
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,19 +1,36 @@ | ||
import arrow from 'src/images/arrow.svg'; | ||
|
||
import styles from './ArrowButton.module.scss'; | ||
import clsx from 'clsx'; | ||
|
||
/** Функция для обработки открытия/закрытия формы */ | ||
export type OnClick = () => void; | ||
export type OnClick = (isOpenForm: boolean) => void; | ||
|
||
export const ArrowButton = () => { | ||
export type TArrowButton = { | ||
isOpenForm: boolean; | ||
onClick: OnClick; | ||
}; | ||
|
||
export const ArrowButton = ({ isOpenForm, onClick }: TArrowButton) => { | ||
return ( | ||
/* Не забываем указаывать role и aria-label атрибуты для интерактивных элементов */ | ||
<div | ||
role='button' | ||
aria-label='Открыть/Закрыть форму параметров статьи' | ||
tabIndex={0} | ||
className={styles.container}> | ||
<img src={arrow} alt='иконка стрелочки' className={styles.arrow} /> | ||
className={clsx(styles.container, { | ||
[styles.container_open]: isOpenForm, | ||
})} | ||
onClick={() => { | ||
onClick(!isOpenForm); | ||
}}> | ||
<img | ||
src={arrow} | ||
alt='иконка стрелочки' | ||
className={clsx(styles.arrow, { | ||
[styles.arrow_open]: isOpenForm, | ||
})} | ||
/> | ||
</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
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
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,5 +1,5 @@ | ||
.separator { | ||
width: 100%; | ||
height: 1px; | ||
background: #000000; | ||
background: #d7d7d7; | ||
} |
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,10 +1,13 @@ | ||
import { createRoot } from 'react-dom/client'; | ||
import { StrictMode, CSSProperties } from 'react'; | ||
import { StrictMode, CSSProperties, useState } from 'react'; | ||
import clsx from 'clsx'; | ||
|
||
import { Article } from './components/article/Article'; | ||
import { ArticleParamsForm } from './components/article-params-form/ArticleParamsForm'; | ||
import { defaultArticleState } from './constants/articleProps'; | ||
import { | ||
defaultArticleState, | ||
ArticleStateType, | ||
} from './constants/articleProps'; | ||
|
||
import './styles/index.scss'; | ||
import styles from './styles/index.module.scss'; | ||
|
@@ -13,19 +16,25 @@ const domNode = document.getElementById('root') as HTMLDivElement; | |
const root = createRoot(domNode); | ||
|
||
const App = () => { | ||
const [articleState, setArticleState] = | ||
useState<ArticleStateType>(defaultArticleState); | ||
|
||
return ( | ||
<div | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Можно лучше
|
||
className={clsx(styles.main)} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Можно лучше
|
||
style={ | ||
{ | ||
'--font-family': defaultArticleState.fontFamilyOption.value, | ||
'--font-size': defaultArticleState.fontSizeOption.value, | ||
'--font-color': defaultArticleState.fontColor.value, | ||
'--container-width': defaultArticleState.contentWidth.value, | ||
'--bg-color': defaultArticleState.backgroundColor.value, | ||
'--font-family': articleState.fontFamilyOption.value, | ||
'--font-size': articleState.fontSizeOption.value, | ||
'--font-color': articleState.fontColor.value, | ||
'--container-width': articleState.contentWidth.value, | ||
'--bg-color': articleState.backgroundColor.value, | ||
} as CSSProperties | ||
}> | ||
<ArticleParamsForm /> | ||
<ArticleParamsForm | ||
articleState={articleState} | ||
onSubmitState={setArticleState} | ||
/> | ||
<Article /> | ||
</div> | ||
); | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно лучше
App
в отдельный файл, чтобы не смешивать все вindex.js