Skip to content
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

feat: Add button to change language #85

Merged
merged 3 commits into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add button on picker
  • Loading branch information
amaury1093 committed Apr 26, 2019
commit 7e7d5df061d16bbfd768f26189a558185b67a491
1 change: 1 addition & 0 deletions App/Screens/About/About.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { Linking, ScrollView, StyleSheet, Text, View } from 'react-native';

import { Box } from './Box';
import { BackButton } from '../../components/BackButton';
import { Language } from './Language';
import { i18n } from '../../localization';
import * as theme from '../../utils/theme';

Expand Down
29 changes: 18 additions & 11 deletions App/Screens/About/Language/Language.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { inject, observer } from 'mobx-react';
import React, { Component } from 'react';
import { Picker, StyleSheet } from 'react-native';
import { Button, Picker, StyleSheet, View } from 'react-native';

import { i18n } from '../../../localization';
import * as theme from '../../../utils/theme';
Expand All @@ -32,21 +32,28 @@ export class Language extends Component {

render () {
return (
<Picker
itemStyle={theme.text}
onValueChange={this.handleValueChange}
selectedValue={i18n.locale}
style={styles.picker}
>
<Picker.Item label="English (US)" value="en" />
<Picker.Item label="Spanish (Spain)" value="es" />
</Picker>
<View style={{ borderWidth: 0 }}>
<Button title="ABC" />
<Picker
itemStyle={theme.text}
onValueChange={this.handleValueChange}
selectedValue={i18n.locale}
style={styles.picker}
>
<Picker.Item label="English (US)" value="en" />
<Picker.Item label="Spanish (Spain)" value="es" />
</Picker>
</View>

);
}
}

const styles = StyleSheet.create({
picker: {
width: 200
height: 1000,
position: 'absolute',
top: 0,
width: 1000
}
});
17 changes: 17 additions & 0 deletions App/Screens/About/Language/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Sh**t! I Smoke
// Copyright (C) 2018-2019 Marcelo S. Coelho, Amaury Martiny

// Sh**t! I Smoke is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Sh**t! I Smoke is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Sh**t! I Smoke. If not, see <http:https://www.gnu.org/licenses/>.

export * from './Language';