-
Notifications
You must be signed in to change notification settings - Fork 102
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(hackathon-surplus): show surplus modal when confirmation modal is closed #2773
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/common/pure/Modal/index.ts
Outdated
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.
Refactor
<styledEl.Wrapper> | ||
<styledEl.Section> | ||
<styledEl.Header> | ||
<styledEl.CloseIconWrapper onClick={onDismiss} /> | ||
</styledEl.Header> | ||
</styledEl.Section> | ||
<SurplusModal order={order} /> | ||
</styledEl.Wrapper> |
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.
Re-using the same components to works nicely with #2767 without any changes
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.
code review only, no test
@@ -23,6 +25,7 @@ export const SwapModals = React.memo(function (props: SwapModalsProps) { | |||
{/*<CowSubsidyModal isOpen={showCowSubsidyModal} onDismiss={closeModals} /> */} | |||
{<ConfirmSwapModalSetup {...confirmSwapProps} />} | |||
{showNativeWrapModal && <EthFlowModal {...ethFlowProps} />} | |||
{!showNativeWrapModal && <SurplusModalSetup />} |
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.
Is this condition correct? !showNativeWrapModal
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.
Yes, I just want to make sure it's not displayed by accident when EthFlowModal is active
const order = useOrder({ id: orderId, chainId }) | ||
|
||
const onDismiss = useCallback(() => { | ||
orderId && removeOrderId(orderId) |
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.
cool how you handled the queue of modals
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.
Great changes!
ba4197a
to
9151a14
Compare
9151a14
to
da10508
Compare
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.
Hey @alfetopito , great! I noticed that styles of the modal are a bit off, but you are aware of it.
I have also tested edge cases:
- 2 orders in a regular mode: the 1st progress bar is closed, the 2nd is opened: everything worked as expected. When the 1st order was filled, no Surplus modal appeared, but the progress bar changes the view when the 2nd order was filled.
- Expert mode, 2 orders: 2 modals appear one after another (or under another). So it looks like I need to press on the close icon twice in order to close the Surplus modal (however, I close 2 modals as numbers are changed when I close the 1st one)). Not sure if we need to fix this
- Regular mode, 2 orders with closed bars: the same behavior as in the p.2.
- When my Limit order is filled, I also see the surplus modal on the Swap page!
I did not test it for TWAP order. However, let me know please if I need to.
Did not seem to be in needed as there's another instance called from within ConfirmSwap modal. Must test other use cases to be sure it still works as before
…dal" This reverts commit 4a45dea.
da10508
to
6539aab
Compare
I was able to fix it \o/
Now pop up should only show for swap orders
No need, if it works for limit (by not showing) it's enough |
Hey @alfetopito , great job! |
That, I'll delegate to @fairlighteth as it's out of my reach |
Hey @alfetopito , @fairlighteth , I have created #2790 issue for this |
Summary
Continuing #2752
Trigger surplus modal when order is fulfilled even if confirmation modal is closed
To Test