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

feat: add PINExplainer pre-screen to the PINCreate screen to explain the use of the PIN #1291

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jian4on
Copy link

@jian4on jian4on commented Oct 22, 2024

Summary of Changes

New screen added before PIN Set-up to explain the use of the PIN in the wallet to the user. The pre-screen is displayed on navigating to Pin Create screen, the user need to click CONTINUE to access the PIN creating form

Related Issues

N/A

Pull Request Checklist

Tick all boxes below to demonstrate that you have completed the respective task. If the item does not apply to your this PR check it anyway to make it apparent that there's nothing to do.

  • All commits contain a DCO Signed-off-by line (we use the DCO GitHub app to enforce this);
  • Updated LICENSE-3RD-PARTY.md for any added dependencies or vendored components;
  • Updated documentation as needed for changed code and new or modified features;
  • Added sufficient tests so that overall code coverage is not reduced.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

Pro Tip 🤓

  • Read our contribution guide at least once; it will save you a few review cycles!
  • Your PR will likely not be reviewed until all the above boxes are checked and all automated tests have passed.

PR template adapted from the Python attrs project.

Copy link

sonarcloud bot commented Oct 22, 2024

@jleach jleach changed the title Add PINExplainer pre-screen to the PINCreate screen to explain the use of the PIN feat: add PINExplainer pre-screen to the PINCreate screen to explain the use of the PIN Oct 22, 2024
Copy link
Contributor

@bryce-mcmath bryce-mcmath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple small things to clean up, great first PR though!

Comment on lines +170 to +174
<>
{ explained ||
<PINExplainer continueCreatePIN={continueCreatePIN} />
}
{ explained &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this should be a ternary expression:

return explained ? (<KeyboardView>...</KeyboardView>) : (<PINExplainer continueCreatePIN={continueCreatePIN} />)

That way we won't need the fragment and we won't risk odd UI bugs

continueCreatePIN: () => void
}

const Component: React.FC<PINExplainerProps> = ({ continueCreatePIN }) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const Component: React.FC<PINExplainerProps> = ({ continueCreatePIN }) => {
const PINExplainer: React.FC<PINExplainerProps> = ({ continueCreatePIN }) => {

Component should be named even though it's a default export, it's the existing pattern and it helps readability.

Comment on lines +47 to +51
// const navigation = useNavigation<StackNavigationProp<AuthenticateStackParams>>()
const pressBack = () => {
// No handler on Back action yet
// navigation.navigate(Screens.Terms)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're going with the component approach and it's not a separate screen, this can be removed

Comment on lines +2 to +6
/*
import { useNavigation } from '@react-navigation/native'
import { StackNavigationProp } from '@react-navigation/stack'
import { AuthenticateStackParams, Screens } from '../../types/navigators'
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed

Comment on lines +88 to +96
<View style={[{ paddingTop: 10, marginBottom: 20 }]}>
<Button
title={t('Global.Back')}
accessibilityLabel={t('Global.Back')}
testID={testIdWithKey('Back')}
onPress={pressBack}
buttonType={ButtonType.Secondary}
/>
</View>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed but don't forget to move the marginBottom: 20 to the button above that we are keeping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants