-
Notifications
You must be signed in to change notification settings - Fork 146
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Jian Wang <[email protected]>
Signed-off-by: Jian Wang <[email protected]>
Quality Gate passedIssues Measures |
There was a problem hiding this 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!
<> | ||
{ explained || | ||
<PINExplainer continueCreatePIN={continueCreatePIN} /> | ||
} | ||
{ explained && |
There was a problem hiding this comment.
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 }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
// const navigation = useNavigation<StackNavigationProp<AuthenticateStackParams>>() | ||
const pressBack = () => { | ||
// No handler on Back action yet | ||
// navigation.navigate(Screens.Terms) | ||
} |
There was a problem hiding this comment.
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
/* | ||
import { useNavigation } from '@react-navigation/native' | ||
import { StackNavigationProp } from '@react-navigation/stack' | ||
import { AuthenticateStackParams, Screens } from '../../types/navigators' | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed
<View style={[{ paddingTop: 10, marginBottom: 20 }]}> | ||
<Button | ||
title={t('Global.Back')} | ||
accessibilityLabel={t('Global.Back')} | ||
testID={testIdWithKey('Back')} | ||
onPress={pressBack} | ||
buttonType={ButtonType.Secondary} | ||
/> | ||
</View> |
There was a problem hiding this comment.
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
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.
Signed-off-by
line (we use the DCO GitHub app to enforce this);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 🤓
PR template adapted from the Python attrs project.