generated from storybookjs/addon-kit
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add play stories and fix play functionality
- Loading branch information
1 parent
e72c802
commit f021609
Showing
6 changed files
with
98 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
import React, {FC} from 'react'; | ||
import {useTranslation} from 'react-i18next'; | ||
import React, {FC, useState} from 'react'; | ||
import {useTranslation, Trans} from 'react-i18next'; | ||
|
||
const Test: FC = () => { | ||
const {t} = useTranslation(); | ||
const [count, setCount] = useState(0); | ||
|
||
return <div>{t('hello')}</div>; | ||
const onClick = () => setCount((count) => count + 1); | ||
|
||
return ( | ||
<div> | ||
<span>{t('hello')}</span>{' '} | ||
<span> | ||
<Trans>world</Trans> | ||
</span> | ||
<div style={{marginTop: '1rem'}}> | ||
<button onClick={onClick}>{t('click', {count})}</button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Test; |
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,3 +1,6 @@ | ||
export default { | ||
hello: 'Hello', | ||
world: 'World', | ||
click_one: '{{count}} click', | ||
click_other: '{{count}} clicks', | ||
}; |
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,3 +1,6 @@ | ||
export default { | ||
hello: 'Bonjour', | ||
world: 'Monde', | ||
click_one: '{{count}} clic', | ||
click_other: '{{count}} clics', | ||
}; |
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,3 +1,6 @@ | ||
export default { | ||
hello: 'こんにちは', | ||
world: '世界', | ||
click_one: '{{count}}クリック', | ||
click_other: '{{count}}クリック', | ||
}; |
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