-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat!: support configure, add props for overriding default texts instead of dict * fix: tune rollup config * fix(AsideHeader): fix default texts * chore: remove useless option
- Loading branch information
Showing
30 changed files
with
163 additions
and
96 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,5 @@ | ||
{ | ||
"button_collapse": "Collapse", | ||
"button_expand": "Expand", | ||
"label_more": "More" | ||
} |
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 {registerKeyset} from '../../utils/registerKeyset'; | ||
|
||
import en from './en.json'; | ||
import ru from './ru.json'; | ||
|
||
const COMPONENT = 'AsideHeader'; | ||
export default registerKeyset({en, ru}, COMPONENT); |
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,5 @@ | ||
{ | ||
"button_collapse": "Свернуть", | ||
"button_expand": "Развернуть", | ||
"label_more": "Ещё" | ||
} |
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,28 +1,30 @@ | ||
import React from 'react'; | ||
import {block} from '../../utils/cn'; | ||
|
||
import {defaultDict} from '../../constants'; | ||
|
||
import './Burger.scss'; | ||
|
||
const b = block('mobile-header-burger'); | ||
|
||
export interface BurgerProps { | ||
interface BurgerProps { | ||
closeTitle: string; | ||
openTitle: string; | ||
opened?: boolean; | ||
className?: string; | ||
onClick?: (event: React.MouseEvent<HTMLElement>) => void; | ||
} | ||
|
||
export const Burger = React.memo(({opened, className, onClick}: BurgerProps) => ( | ||
<button | ||
className={b({opened}, className)} | ||
onClick={onClick} | ||
aria-label={opened ? defaultDict['button_close-burger'] : defaultDict['button_open-burger']} | ||
> | ||
<span className={b('icon')}> | ||
<span className={b('icon-dash')}></span> | ||
</span> | ||
</button> | ||
)); | ||
export const Burger = React.memo( | ||
({closeTitle, openTitle, opened, className, onClick}: BurgerProps) => ( | ||
<button | ||
className={b({opened}, className)} | ||
onClick={onClick} | ||
aria-label={opened ? closeTitle : openTitle} | ||
> | ||
<span className={b('icon')}> | ||
<span className={b('icon-dash')}></span> | ||
</span> | ||
</button> | ||
), | ||
); | ||
|
||
Burger.displayName = 'Burger'; |
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,4 @@ | ||
{ | ||
"burger_button_close": "Close menu", | ||
"burger_button_open": "Open menu" | ||
} |
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 {registerKeyset} from '../../utils/registerKeyset'; | ||
|
||
import en from './en.json'; | ||
import ru from './ru.json'; | ||
|
||
const COMPONENT = 'MobileHeader'; | ||
export default registerKeyset({en, ru}, COMPONENT); |
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,4 @@ | ||
{ | ||
"burger_button_close": "Закрыть меню", | ||
"burger_button_open": "Открыть меню" | ||
} |
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.