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

Bugfix: android general settings #1192

Merged
merged 7 commits into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 9 additions & 6 deletions app/components/UI/Navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ export default function getNavbarOptions(title, navigation, disableNetwork = fal
* @returns {Object} - Corresponding navbar options containing title and headerTitleStyle
*/
export function getNavigationOptionsTitle(title, navigation) {
function navigationPop() {
navigation.pop();
}
return {
title,
headerTitleStyle: {
Expand All @@ -185,8 +188,7 @@ export function getNavigationOptionsTitle(title, navigation) {
},
headerTintColor: colors.blue,
headerLeft: (
// eslint-disable-next-line react/jsx-no-bind
<TouchableOpacity onPress={() => navigation.pop()} style={styles.backButton}>
<TouchableOpacity onPress={navigationPop} style={styles.backButton}>
<IonicIcon
name={Platform.OS === 'android' ? 'md-arrow-back' : 'ios-arrow-back'}
size={Platform.OS === 'android' ? 24 : 28}
Expand Down Expand Up @@ -470,6 +472,9 @@ export function getOptinMetricsNavbarOptions() {
* @returns {Object} - Corresponding navbar options containing headerTitle, headerTitle and headerTitle
*/
export function getClosableNavigationOptions(title, backButtonText, navigation) {
function navigationPop() {
navigation.pop();
}
return {
title,
headerTitleStyle: {
Expand All @@ -478,13 +483,11 @@ export function getClosableNavigationOptions(title, backButtonText, navigation)
},
headerLeft:
Platform.OS === 'ios' ? (
// eslint-disable-next-line react/jsx-no-bind
<TouchableOpacity onPress={() => navigation.pop()} style={styles.closeButton}>
<TouchableOpacity onPress={navigationPop} style={styles.closeButton}>
<Text style={styles.closeButtonText}>{backButtonText}</Text>
</TouchableOpacity>
) : (
// eslint-disable-next-line react/jsx-no-bind
<TouchableOpacity onPress={() => navigation.pop()} style={styles.backButton}>
<TouchableOpacity onPress={navigationPop} style={styles.backButton}>
<IonicIcon name={'md-arrow-back'} size={24} style={styles.backIcon} />
</TouchableOpacity>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exports[`GeneralSettings should render correctly 1`] = `
"backgroundColor": "#FFFFFF",
"flex": 1,
"padding": 24,
"zIndex": 99999999999999,
}
}
>
Expand Down
4 changes: 3 additions & 1 deletion app/components/Views/Settings/GeneralSettings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const styles = StyleSheet.create({
wrapper: {
backgroundColor: colors.white,
flex: 1,
padding: 24
padding: 24,
zIndex: 99999999999999
},
title: {
...fontStyles.normal,
Expand Down Expand Up @@ -106,6 +107,7 @@ class Settings extends PureComponent {
};

selectLanguage = language => {
if (language === this.state.currentLanguage) return;
setLocale(language);
this.setState({ currentLanguage: language });
setTimeout(() => this.props.navigation.navigate('Home'), 100);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exports[`Settings should render correctly 1`] = `
"backgroundColor": "#FFFFFF",
"flex": 1,
"paddingLeft": 18,
"zIndex": 99999999999999,
}
}
>
Expand Down
3 changes: 2 additions & 1 deletion app/components/Views/Settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const styles = StyleSheet.create({
wrapper: {
backgroundColor: colors.white,
flex: 1,
paddingLeft: 18
paddingLeft: 18,
zIndex: 99999999999999
}
});

Expand Down