-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: Implement confirm layout #13331
base: main
Are you sure you want to change the base?
Conversation
const isFlatConfirmation = FLAT_CONFIRMATIONS.includes( | ||
approvalRequest?.type as TransactionType, | ||
); | ||
const ContentDisplay = isFlatConfirmation ? ScrollView : 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.
ScrollView may still be useful if content overflow, if there is no overflow - it will anyways behave as normal 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.
Ideally this component should not know about modal / fullscreen layout. If possible differences in layout can be moved a level up in <ConfirmaionLayout>
component.
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.
Exactly, I was also thinking to capsulate this logic in ConfirmaionLayout
. However if we want to stick up Footer
to the bottom (for flat confirmations), I think this is the only viable solution. I am happy to apply any suggestions if you have on this.
const { approvalRequest } = useApprovalRequest(); | ||
const isFlatConfirmation = FLAT_CONFIRMATIONS.includes( | ||
approvalRequest?.type as TransactionType, | ||
); |
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.
Rather than using an array like this here can we make it dynamic, may be we check if confirmation is not initiated by DAPP, that ways we will not need not maintain it for new confirmation that we add.
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.
That's definitely something we can do. But my understanding is that flat confirmation support is not tied to origin. Maybe we could visit this in the upcoming implementations?
</View> | ||
<Footer /> | ||
<View style={styles.container}> | ||
{children} | ||
</View> | ||
</BottomModal> | ||
); |
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.
Rather than including <ConfirmationLayout
in <Confirm
can we rather include <Confirm>
in place of {children}
here.
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.
Good call, done
backgroundColor: theme.colors.background.alternative, | ||
justifyContent: 'space-between', | ||
paddingHorizontal: 16, | ||
}, |
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.
Not sure is fixed
position there in react native ?
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.
Quality Gate failedFailed conditions See analysis details on SonarQube Cloud Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE |
Description
This PR adds flat confirmation layout in re-designed confirmations.
Related issues
Fixes: Task is currently in draft
Manual testing steps
N/A
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist