Created
November 13, 2017 08:10
-
-
Save dsternlicht/87ea9df7be7a9ebff66443f5692897ce to your computer and use it in GitHub Desktop.
Login screen with localization
This file contains hidden or 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
| import React, { Component } from 'react'; | |
| import { | |
| View, | |
| Text, | |
| Button | |
| } from 'react-native'; | |
| import { strings } from '../locales/i18n'; | |
| class LoginScreen extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| username: 'Daniel' | |
| }; | |
| } | |
| render() { | |
| return ( | |
| <View> | |
| <Text>{strings('login.welcome', { name: this.state.username })}</Text> | |
| <Button title={strings('login.login_button')}></Button> | |
| <Button title={strings('login.singup_button')}></Button> | |
| </View> | |
| ); | |
| } | |
| } | |
| export default LoginScreen; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a bug here on line 24, 'login.singup_button', should be 'login.signup_button', just came from the post on Medium.
This
<Button title={strings('login.singup_button')}></Button>Should be
<Button title={strings('login.signup_button')}></Button>Link to Medium article