Skip to content

Commit

Permalink
check previousScreen and change lading message (#1740)
Browse files Browse the repository at this point in the history
* check previousScreen and change lading message

* Make cta for secure your wallet camel case

* Update snapshot

* Pass getParam in test for ChoosePassword
  • Loading branch information
rickycodes authored Jul 30, 2020
1 parent 6b84579 commit fa2da66
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
9 changes: 8 additions & 1 deletion app/components/Views/ChoosePassword/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ class ChoosePassword extends PureComponent {
const { isSelected, password, confirmPassword, secureTextEntry, error, loading } = this.state;
const passwordsMatch = password !== '' && password === confirmPassword;
const canSubmit = passwordsMatch && isSelected;
const previousScreen = this.props.navigation.getParam(AppConstants.PREVIOUS_SCREEN);

return (
<SafeAreaView style={styles.mainWrapper}>
Expand All @@ -492,7 +493,13 @@ class ChoosePassword extends PureComponent {
)}
</View>
<ActivityIndicator size="large" color={Device.isAndroid() ? colors.blue : colors.grey} />
<Text style={styles.title}>{strings('create_wallet.title')}</Text>
<Text style={styles.title}>
{strings(
previousScreen === 'onboarding'
? 'create_wallet.title'
: 'secure_your_wallet.creating_password'
)}
</Text>
<Text style={styles.subtitle}>{strings('create_wallet.subtitle')}</Text>
</View>
) : (
Expand Down
1 change: 1 addition & 0 deletions app/components/Views/ChoosePassword/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('ChoosePassword', () => {
const wrapper = shallow(
<ChoosePassword
navigation={{
getParam: () => ['onboarding', 'protect'],
state: { params: {} }
}}
/>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ exports[`ProtectYourAccount should render correctly 1`] = `
testID="submit-button"
type="confirm"
>
CREATE PASSWORD
Create Password
</StyledButton>
</View>
</ScrollViewMock>
Expand Down
3 changes: 2 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,8 @@
"step_2_description": "Save wallet seed phrase",
"info_text_1": "Take a few moments to finish setting up your MetaMask wallet.",
"info_text_2": "This will ensure only you can access your funds and will let you recover your wallet if you lose your device",
"cta_text": "CREATE PASSWORD"
"cta_text": "Create Password",
"creating_password": "Creating password..."
},
"account_backup_step_1": {
"remind_me_later": "Remind me later",
Expand Down

0 comments on commit fa2da66

Please sign in to comment.