-
Notifications
You must be signed in to change notification settings - Fork 5
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
228 Transaction review #350
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7fe4d04
feat: review transaction modal added
e979064
feat: transaction review
2c1cf2b
feat: added link to block explorer
0985d08
feat: fixed review transactions
15ef6c7
fix: fixed subscan url
2643291
fix: fixed number comparison
3651649
fix: removed console log
f998781
fix: wnd network asset hub usrl
zarej 06815c5
fix: wnd network asset url for accounts
zarej 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
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,86 @@ | ||
import { FC } from "react"; | ||
import Modal from "../../atom/Modal"; | ||
import Button from "../../atom/Button"; | ||
import { ButtonVariants, InputEditedType } from "../../../app/types/enum"; | ||
import { ReactComponent as DotToken } from "../../../assets/img/dot-token.svg"; | ||
|
||
interface SwapSelectTokenModalProps { | ||
open: boolean; | ||
title: string; | ||
youPay: string; | ||
youReceive: string; | ||
priceImpact: string; | ||
tokenValueA?: string; | ||
tokenValueB?: string; | ||
tokenSymbolA: string; | ||
tokenSymbolB: string; | ||
inputType: string; | ||
onClose: () => void; | ||
onConfirmTransaction: () => void; | ||
} | ||
|
||
const ReviewTransactionModal: FC<SwapSelectTokenModalProps> = ({ | ||
open, | ||
title, | ||
youPay, | ||
youReceive, | ||
priceImpact, | ||
tokenValueA, | ||
tokenValueB, | ||
tokenSymbolA, | ||
tokenSymbolB, | ||
inputType, | ||
onClose, | ||
onConfirmTransaction, | ||
}) => { | ||
return ( | ||
<Modal isOpen={open} onClose={onClose} title={title}> | ||
<div className="flex w-[360px] flex-col gap-5"> | ||
<div className="flex flex-col items-start"> | ||
<span className="font-inter text-small text-gray-200">You pay</span> | ||
<span className="flex w-full items-center justify-between font-unbounded-variable text-heading-4 font-bold text-gray-400"> | ||
{youPay} | ||
<DotToken /> | ||
</span> | ||
</div> | ||
<div className="flex flex-col items-start"> | ||
<span className="font-inter text-small text-gray-200">You receive</span> | ||
<span className="flex w-full items-center justify-between font-unbounded-variable text-heading-4 font-bold text-gray-400"> | ||
{youReceive} | ||
<DotToken /> | ||
</span> | ||
</div> | ||
<hr className="mb-0.5 mt-1 w-full border-[0.7px] border-gray-50" /> | ||
<div className="flex flex-col"> | ||
<div className="flex justify-between"> | ||
<span className="font-inter text-medium text-gray-300">Price impact</span> | ||
<span className="font-inter text-medium text-gray-400">{priceImpact}%</span> | ||
</div> | ||
<div className="flex justify-between"> | ||
<span className="font-inter text-medium text-gray-300"> | ||
{inputType == InputEditedType.exactIn ? "Expected output" : "Expected input"} | ||
</span> | ||
<span className="font-inter text-medium text-gray-400"> | ||
{tokenValueA} {tokenSymbolA} | ||
</span> | ||
</div> | ||
<div className="flex justify-between"> | ||
<span className="font-inter text-medium text-gray-300"> | ||
{inputType === InputEditedType.exactIn ? "Minimum output" : "Maximum input"}t | ||
</span> | ||
<span className="font-inter text-medium text-gray-400"> | ||
{tokenValueB} {tokenSymbolB} | ||
</span> | ||
</div> | ||
</div> | ||
<div className="flex flex-col"> | ||
<Button onClick={onConfirmTransaction} variant={ButtonVariants.btnInteractivePink}> | ||
Confirm Swap | ||
</Button> | ||
</div> | ||
</div> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default ReviewTransactionModal; |
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.
Should be variable based on network