add warning for proceeding with a blank password

This commit is contained in:
Akinwale Ariwodola 2019-07-08 04:22:02 +01:00
parent 455dadd30d
commit 120c3ca52f
4 changed files with 31 additions and 0 deletions

View file

@ -115,6 +115,15 @@ class WalletPage extends React.PureComponent {
<Icon name={this.state.revealPassword ? 'eye-slash' : 'eye'} size={16} style={firstRunStyle.revealIcon} />
</TouchableOpacity>
</View>
{(!this.state.password || this.state.password.trim().length === 0) && (
<View style={firstRunStyle.passwordWarning}>
<Text style={firstRunStyle.passwordWarningText}>
{hasSyncedWallet
? 'If you did not provide a password, please press Use LBRY to continue.'
: 'You can proceed without a password, but this is not recommended.'}
</Text>
</View>
)}
{(!hasSyncedWallet && this.state.password && this.state.password.trim().length) > 0 && (
<View style={firstRunStyle.passwordStrength}>

View file

@ -134,6 +134,17 @@ class SyncVerifyPage extends React.PureComponent {
<Icon name={this.state.revealPassword ? 'eye-slash' : 'eye'} size={16} style={firstRunStyle.revealIcon} />
</TouchableOpacity>
</View>
{(!this.state.password || this.state.password.trim().length === 0) && (
<View style={firstRunStyle.passwordWarning}>
<Text style={firstRunStyle.passwordWarningText}>
{hasSyncedWallet
? 'If you did not provide a password, please press Use LBRY to continue.'
: 'You can proceed without a password, but this is not recommended.'}
</Text>
</View>
)}
{(!hasSyncedWallet && this.state.password && this.state.password.trim().length) > 0 && (
<View style={firstRunStyle.passwordStrength}>
<BarPasswordStrengthDisplay

View file

@ -12,6 +12,7 @@ const Colors = {
LighterGrey: '#e5e5e5',
Orange: '#ffbb00',
Red: '#ff0000',
BrightRed: '#e35454',
VeryLightGrey: '#f1f1f1',
White: '#ffffff',
UriDescBlue: '#3971db',

View file

@ -172,6 +172,16 @@ const firstRunStyle = StyleSheet.create({
marginRight: 32,
marginBottom: 48,
},
passwordWarning: {
marginLeft: 32,
marginRight: 32,
marginBottom: 24,
},
passwordWarningText: {
color: Colors.BrightRed,
fontFamily: 'Inter-UI-Regular',
fontSize: 16,
},
centered: {
alignItems: 'center',
},