-
Notifications
You must be signed in to change notification settings - Fork 6
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
Resuming deposit modal #138
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4b32328
Resume staking flow modal
ioay cbdf3ee
Resume modal: update styles, naming convention & directory structure
ioay f9c2ab0
Add pending transaction process to context
ioay 12ab0a1
Reverted bitcoin min amount
ioay fcdf8d2
Reverted staking steps
ioay 3738bfa
End transaction process for default staking step
ioay be492cd
Added end of transaction to resetState method, updated activeStakingS…
ioay 0da8188
Merge branch 'main' into resuming-deposit-modal
ioay b5a02c4
Pause icon styles, fn callback renamed for depositBTC
ioay d0d4805
Merge branch 'main' into resuming-deposit-modal
ioay 0543d88
Use chakra unit instead of rem, fixing issues after modalBase changes
ioay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from "react" | ||
import { createIcon } from "@chakra-ui/react" | ||
|
||
export const PauseIcon = createIcon({ | ||
displayName: "PauseIcon", | ||
viewBox: "0 0 18 20", | ||
path: ( | ||
<path | ||
d="M2 18V2M16 18V2" | ||
stroke="currentColor" | ||
strokeWidth="3" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
/> | ||
), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from "react" | ||
import { | ||
ModalHeader, | ||
ModalBody, | ||
ModalFooter, | ||
Button, | ||
HStack, | ||
} from "@chakra-ui/react" | ||
|
||
import Spinner from "#/components/shared/Spinner" | ||
import { PauseIcon } from "#/assets/icons" | ||
import { TextMd } from "#/components/shared/Typography" | ||
|
||
export default function ResumeModal({ | ||
onResume, | ||
onClose, | ||
}: { | ||
onResume: () => void | ||
onClose: () => void | ||
}) { | ||
return ( | ||
<> | ||
<ModalHeader>Paused</ModalHeader> | ||
<ModalBody textAlign="start" py={6} mx={3}> | ||
<HStack position="relative" justifyContent="center"> | ||
<Spinner size="xl" /> | ||
<PauseIcon position="absolute" boxSize={6} color="brand.400" /> | ||
</HStack> | ||
|
||
<TextMd>Are your sure you want to cancel?</TextMd> | ||
</ModalBody> | ||
<ModalFooter flexDirection="column" gap={2}> | ||
<Button size="lg" width="100%" onClick={onResume}> | ||
Resume deposit | ||
</Button> | ||
<Button size="lg" width="100%" variant="outline" onClick={onClose}> | ||
Yes, cancel | ||
</Button> | ||
</ModalFooter> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think we can only name it as
Resume
. We are in themodals
directory so it seems redundant to me. We had the same approach withMissingAccount
or other modals declared here. The same goes for the file name.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.
We can keep the file name without the suffix
modal
because we are in themodals
directory, but I recommend staying with the current naming convention of components because such a name says more about the component type and will not be confused with the name of a function or other component if it appears and is not modal. I would even recommend such a change in other places as eg:MissingAccountModal
.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.
Discussion moved to discord
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.
The suffix may be useful when we import this modal and use it elsewhere, it adds clarity.
On the other hand we've already got bunch of components that don't have the suffixes:
ActionForm
,Overview
, etc.Also let's take
Details
list, should it be renamed toDetailsList
?Should
Pause
icon become aPauseIcon
?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.
It feels like a deeper discussion to establish the common patterns, that we shouldn't block this PR with, unless we agree on the pattern and decide to refactor it across the board in a follow-up.
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 left some much more detailed thoughts in the Discord thread, but quick answers on the above two examples:
Pause
should bePauseIcon
, andDetails
should have a more descriptive name thanDetails
orDetailsList
! Details of what?)