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/small UI fixes #2042

Merged
merged 11 commits into from
Dec 11, 2020
2 changes: 1 addition & 1 deletion app/components/UI/DrawerView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ class DrawerView extends PureComponent {
{
name: strings('drawer.settings'),
icon: this.getFeatherIcon('settings'),
warning: strings('drawer.settings_warning'),
warning: strings('drawer.settings_warning_short'),
action: this.showSettings
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ exports[`HintModal should render correctly 1`] = `
style={
Object {
"color": "#000000",
"fontFamily": "EuclidCircularB-Regular",
"fontFamily": "EuclidCircularB-Bold",
"fontSize": 18,
"fontWeight": "bold",
"fontWeight": "600",
}
}
>
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/HintModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const styles = StyleSheet.create({
},
recovery: {
fontSize: 18,
...fontStyles.extraBold,
...fontStyles.bold,
color: colors.fontPrimary
},
leaveHint: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ exports[`SettingsNotification should render correctly as notification 1`] = `
"alignSelf": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "flex-end",
"marginRight": 24,
},
null,
Expand Down
1 change: 1 addition & 0 deletions app/components/UI/SettingsNotification/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const styles = StyleSheet.create({
menuItemWarning: {
flex: 1,
alignSelf: 'center',
justifyContent: 'flex-end',
flexDirection: 'row',
marginRight: 24
},
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/StyledButton/styledButtonStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const styles = StyleSheet.create({
},
viewText: {
fontSize: 18,
...fontStyles.extraBold,
...fontStyles.bold,
color: colors.white
},
view: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,9 @@ exports[`ManualBackupStep1 should render correctly 1`] = `
style={
Object {
"color": "#FFFFFF",
"fontFamily": "EuclidCircularB-Regular",
"fontFamily": "EuclidCircularB-Bold",
"fontSize": 16,
"fontWeight": "bold",
"fontWeight": "600",
"lineHeight": 22,
"marginBottom": 8,
"textAlign": "center",
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/ManualBackupStep1/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const styles = StyleSheet.create({
},
reveal: {
fontSize: Device.isMediumDevice() ? 13 : 16,
...fontStyles.extraBold,
...fontStyles.bold,
color: colors.white,
lineHeight: 22,
marginBottom: 8,
Expand Down
15 changes: 13 additions & 2 deletions app/components/Views/ManualBackupStep3/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { PureComponent } from 'react';
import { Alert, Text, View, SafeAreaView, StyleSheet, Keyboard, TouchableOpacity } from 'react-native';
import { Alert, BackHandler, Text, View, SafeAreaView, StyleSheet, Keyboard, TouchableOpacity } from 'react-native';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { colors, fontStyles } from '../../../styles/common';
Expand Down Expand Up @@ -34,7 +34,7 @@ const styles = StyleSheet.create({
color: colors.fontPrimary,
justifyContent: 'center',
textAlign: 'center',
...fontStyles.extraBold
...fontStyles.bold
},
baseText: {
fontSize: 16,
Expand Down Expand Up @@ -62,6 +62,9 @@ const styles = StyleSheet.create({
}
});

const hardwareBackPress = () => ({});
const HARDWARE_BACK_PRESS = 'hardwareBackPress';

/**
* View that's shown during the last step of
* the backup seed phrase flow
Expand All @@ -72,6 +75,9 @@ class ManualBackupStep3 extends PureComponent {
constructor(props) {
super(props);
this.steps = props.navigation.getParam('steps', undefined);
props.navigation.setParams({
headerLeft: <View />
});
}

state = {
Expand All @@ -87,13 +93,18 @@ class ManualBackupStep3 extends PureComponent {
navigation: PropTypes.object
};

componentWillUnmount = () => {
BackHandler.removeEventListener(HARDWARE_BACK_PRESS, hardwareBackPress);
};

componentDidMount = async () => {
const currentSeedphraseHints = await AsyncStorage.getItem(SEED_PHRASE_HINTS);
const parsedHints = currentSeedphraseHints && JSON.parse(currentSeedphraseHints);
const manualBackup = parsedHints?.manualBackup;
this.setState({
hintText: manualBackup
});
BackHandler.addEventListener(HARDWARE_BACK_PRESS, hardwareBackPress);
};

toggleHint = () => {
Expand Down
12 changes: 6 additions & 6 deletions app/components/Views/Settings/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ exports[`Settings should render correctly 1`] = `
onPress={[Function]}
title="General"
/>
<SettingsDrawer
description="Privacy settings, MetaMetrics, private key and wallet seed phrase"
onPress={[Function]}
title="Security & Privacy"
warning={false}
/>
<SettingsDrawer
description="Access developer features, reset account, setup testnets, sync with extension, state logs, IPFS gateway and custom RPC"
onPress={[Function]}
Expand All @@ -26,12 +32,6 @@ exports[`Settings should render correctly 1`] = `
onPress={[Function]}
title="Contacts"
/>
<SettingsDrawer
description="Privacy settings, MetaMetrics, private key and wallet seed phrase"
onPress={[Function]}
title="Security & Privacy"
warning={false}
/>
<SettingsDrawer
description="Add and edit custom RPC networks"
onPress={[Function]}
Expand Down
12 changes: 6 additions & 6 deletions app/components/Views/Settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ class Settings extends PureComponent {
onPress={this.onPressGeneral}
title={strings('app_settings.general_title')}
/>
<SettingsDrawer
description={strings('app_settings.security_desc')}
onPress={this.onPressSecurity}
title={strings('app_settings.security_title')}
warning={!seedphraseBackedUp}
/>
<SettingsDrawer
description={strings('app_settings.advanced_desc')}
onPress={this.onPressAdvanced}
Expand All @@ -91,12 +97,6 @@ class Settings extends PureComponent {
onPress={this.onPressContacts}
title={strings('app_settings.contacts_title')}
/>
<SettingsDrawer
description={strings('app_settings.security_desc')}
onPress={this.onPressSecurity}
title={strings('app_settings.security_title')}
warning={!seedphraseBackedUp}
/>
<SettingsDrawer
title={strings('app_settings.networks_title')}
description={strings('app_settings.networks_desc')}
Expand Down
19 changes: 18 additions & 1 deletion app/components/Views/SyncWithExtensionSuccess/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { Animated, SafeAreaView, StyleSheet, Text, View, TouchableOpacity, ScrollView } from 'react-native';
import {
Animated,
BackHandler,
SafeAreaView,
StyleSheet,
Text,
View,
TouchableOpacity,
ScrollView
} from 'react-native';
import { colors, fontStyles } from '../../../styles/common';
import { strings } from '../../../../locales/i18n';
import StyledButton from '../../UI/StyledButton';
Expand Down Expand Up @@ -83,6 +92,9 @@ const styles = StyleSheet.create({
}
});

const hardwareBackPress = () => ({});
const HARDWARE_BACK_PRESS = 'hardwareBackPress';

/**
* View that shows the success message once
* the sync with the extension is complete
Expand All @@ -106,8 +118,13 @@ class SyncWithExtensionSuccess extends PureComponent {

iconSpringVal = new Animated.Value(0.4);

componentWillUnmount = () => {
BackHandler.removeEventListener(HARDWARE_BACK_PRESS, hardwareBackPress);
};

componentDidMount() {
this.animateIcon();
BackHandler.addEventListener(HARDWARE_BACK_PRESS, hardwareBackPress);
}

animateIcon() {
Expand Down
4 changes: 0 additions & 4 deletions app/styles/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,5 @@ export const fontStyles = {
bold: {
fontFamily: 'EuclidCircularB-Bold',
fontWeight: '600'
},
extraBold: {
fontFamily: 'EuclidCircularB-Regular',
fontWeight: 'bold'
}
};
1 change: 1 addition & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@
"browser": "Browser",
"settings": "Settings",
"settings_warning": "Wallet unprotected",
"settings_warning_short": "Unprotected",
"help": "Get help",
"logout": "Log Out",
"logout_title": "Do you really want to log out?",
Expand Down
1 change: 1 addition & 0 deletions locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
"browser": "Navegador",
"settings": "Ajustes",
"settings_warning": "Billetera desprotegida",
"settings_warning_short": "Desprotegida",
"help": "Ayuda",
"logout": "Salir",
"logout_title": "Realmente deseas salir?",
Expand Down