-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 226-swap-input-switcher
- Loading branch information
Showing
14 changed files
with
296 additions
and
20 deletions.
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
123 changes: 123 additions & 0 deletions
123
src/components/organism/ReviewTransactionModal/index.tsx
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,123 @@ | ||
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; | ||
tokenValueASecond?: string; | ||
tokenValueBSecond?: string; | ||
tokenSymbolA: string; | ||
tokenSymbolB: string; | ||
inputType: string; | ||
showAll?: boolean; | ||
onClose: () => void; | ||
onConfirmTransaction: () => void; | ||
} | ||
|
||
const ReviewTransactionModal: FC<SwapSelectTokenModalProps> = ({ | ||
open, | ||
title, | ||
youPay, | ||
youReceive, | ||
priceImpact, | ||
tokenValueA, | ||
tokenValueASecond, | ||
tokenValueB, | ||
tokenValueBSecond, | ||
tokenSymbolA, | ||
tokenSymbolB, | ||
inputType, | ||
showAll, | ||
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> | ||
{showAll ? ( | ||
<> | ||
<div className="flex justify-between"> | ||
<span className="font-inter text-medium text-gray-300">Expected output</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">Minimum output</span> | ||
<span className="font-inter text-medium text-gray-400"> | ||
{tokenValueB} {tokenSymbolA} | ||
</span> | ||
</div> | ||
<div className="flex justify-between"> | ||
<span className="font-inter text-medium text-gray-300">Expected output</span> | ||
<span className="font-inter text-medium text-gray-400"> | ||
{tokenValueASecond} {tokenSymbolB} | ||
</span> | ||
</div> | ||
<div className="flex justify-between"> | ||
<span className="font-inter text-medium text-gray-300">Minimum output</span> | ||
<span className="font-inter text-medium text-gray-400"> | ||
{tokenValueBSecond} {tokenSymbolB} | ||
</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"} | ||
</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
Oops, something went wrong.