Merge pull request #598 from lbryio/blank-password-warning

add warning for proceeding with a blank password
This commit is contained in:
Akinwale Ariwodola 2019-07-09 01:38:43 +01:00 committed by GitHub
commit 20cd4affee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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',
},