Skip to content

Commit

Permalink
docs: updated demo
Browse files Browse the repository at this point in the history
  • Loading branch information
yjb94 committed Jan 23, 2020
1 parent 40e5d15 commit 18d422b
Showing 1 changed file with 60 additions and 25 deletions.
85 changes: 60 additions & 25 deletions demo/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,81 @@ import {render} from 'react-dom'
import ReactStoreBadges from '../../src'

class Demo extends Component {
constructor(props) {
super(props);

this.state = {
locale:'en-us'
};
}

changeLocale = () => {
const { locale } = this.state;
this.setState({ locale:locale === 'en-us' ? 'ko-kr' : 'en-us' })
}

render() {
const { locale } = this.state;

return (
<div
style={{
fontFamily:'Arial',
textAlign:'center',
display:'flex',
flexDirection:'column',
alignItems:'center'
}}
>
<h1>React Store Badges</h1>
<div
style={{
width:'600px',
display:'flex',
justifyContent:'space-between'
marginBottom:'60px'
}}
>
<ReactStoreBadges
platform={'ios'}
url={'https://apps.apple.com/app/'}
/>

<ReactStoreBadges
platform={'android'}
url={'https://play.google.com/store/apps/details?id='}
locale={'ko-kr'}
/>
<h1>React Store Badges</h1>
<div
style={{
width:'600px',
display:'flex',
justifyContent:'space-between'
}}
>
<ReactStoreBadges
platform={'ios'}
url={'https://apps.apple.com/app/'}
/>
<ReactStoreBadges
platform={'android'}
url={'https://play.google.com/store/apps/details?id='}
locale={'ko-kr'}
/>
<ReactStoreBadges
platform={'ios'}
url={'https://apps.apple.com/app/'}
locale={'es-ES'}
/>

<ReactStoreBadges
platform={'ios'}
url={'https://apps.apple.com/app/'}
locale={'pt-pt'}
/>

<ReactStoreBadges
platform={'android'}
url={'https://play.google.com/store/apps/details?id='}
locale={'zh-cn'}
/>
<ReactStoreBadges
platform={'android'}
url={'https://play.google.com/store/apps/details?id='}
locale={'zh-CN'}
/>
</div>
</div>
<div>
<h1>Locale Change</h1>
<div>
<ReactStoreBadges
platform={'ios'}
url={'https://apps.apple.com/app/'}
locale={locale}
/>
</div>
<button
onClick={this.changeLocale}
>
change language
</button>
</div>
</div>
)
Expand Down

0 comments on commit 18d422b

Please sign in to comment.