-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
196 additions
and
116 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
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 |
---|---|---|
@@ -1,75 +1,67 @@ | ||
import { config } from "config"; | ||
import { AnimatePresence, motion } from "framer-motion"; | ||
import { useAllowance } from "hooks/GLM/useGLMApprove"; | ||
import { formatEther } from "viem"; | ||
import { CheckCircleIcon } from "@heroicons/react/20/solid"; | ||
import { useUserCurrentDeposit } from "hooks/depositContract/useDeposit"; | ||
import { Button, Input } from "react-daisyui"; | ||
export const DepositSummary = ({ isVisible }: { isVisible: boolean }) => { | ||
export const DepositSummary = () => { | ||
const { data } = useUserCurrentDeposit(); | ||
console.log("data", data); | ||
if (!data?.amount) { | ||
throw new Error("No deposit found"); | ||
} | ||
return ( | ||
<AnimatePresence> | ||
{isVisible && ( | ||
<motion.div | ||
initial={{ opacity: 0 }} | ||
animate={{ opacity: 1 }} | ||
exit={{ opacity: 0 }} | ||
transition={{ duration: 0.5 }} | ||
<motion.div | ||
initial={{ opacity: 0 }} | ||
animate={{ opacity: 1 }} | ||
exit={{ opacity: 0 }} | ||
transition={{ duration: 0.5 }} | ||
style={{ | ||
position: "absolute", | ||
backgroundColor: "#0000005b", | ||
borderRadius: "16px", | ||
padding: "1rem", | ||
fontSize: "1.3rem", | ||
minWidth: "350px", | ||
}} | ||
> | ||
<h3> | ||
<CheckCircleIcon | ||
className="h-8 inline" | ||
style={{ | ||
position: "absolute", | ||
backgroundColor: "#0000005b", | ||
borderRadius: "16px", | ||
padding: "1rem", | ||
fontSize: "1.3rem", | ||
minWidth: "350px", | ||
color: "#00ff003c", | ||
}} | ||
/>{" "} | ||
<span | ||
style={{ | ||
color: "#0C14D4f3", | ||
}} | ||
> | ||
<h3> | ||
<CheckCircleIcon | ||
className="h-8 inline" | ||
style={{ | ||
color: "#00ff003c", | ||
}} | ||
/>{" "} | ||
<span | ||
style={{ | ||
color: "#0C14D4f3", | ||
}} | ||
> | ||
Deposit Summary | ||
</span> | ||
</h3> | ||
<br></br> | ||
<div className="text-sm flex flex-col justify-between"> | ||
<div> | ||
<span>Amount: </span> | ||
<span>{formatEther(data.amount)}</span> | ||
</div> | ||
<div className="mt-4"> | ||
<Button | ||
size="sm" | ||
color="primary" | ||
className="mr-2 px-6" | ||
onClick={() => { | ||
console.log("Approve"); | ||
}} | ||
> | ||
top up | ||
</Button> | ||
<Input | ||
size="sm" | ||
placeholder="Enter amount" | ||
className="w-40" | ||
type="number" | ||
></Input> | ||
</div> | ||
</div> | ||
</motion.div> | ||
)} | ||
</AnimatePresence> | ||
Deposit Summary | ||
</span> | ||
</h3> | ||
<br></br> | ||
<div className="text-sm flex flex-col justify-between"> | ||
<div> | ||
<span>Amount: </span> | ||
//@ts-ignore | ||
<span>{formatEther(data?.amount || 0n)}</span> | ||
</div> | ||
<div className="mt-4"> | ||
<Button | ||
size="sm" | ||
color="primary" | ||
className="mr-2 px-6" | ||
onClick={() => { | ||
console.log("Approve"); | ||
}} | ||
> | ||
top up | ||
</Button> | ||
<Input | ||
size="sm" | ||
placeholder="Enter amount" | ||
className="w-40" | ||
type="number" | ||
></Input> | ||
</div> | ||
</div> | ||
</motion.div> | ||
); | ||
}; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.summaryCard { | ||
background-color: #0000005b; | ||
border-radius: 16px; | ||
padding: 1rem; | ||
font-size: 1.3rem; | ||
min-width: 350px; | ||
} |
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,14 @@ | ||
import { AnimatePresence } from "framer-motion"; | ||
import styles from "./summaryCard.module.css"; | ||
import { PropsWithChildren } from "react"; | ||
|
||
export const SummaryCard = ({ | ||
isVisible, | ||
children, | ||
}: PropsWithChildren<{ isVisible: boolean }>) => { | ||
return ( | ||
<AnimatePresence> | ||
{isVisible && <div className={styles.summaryCard}>{children}</div>} | ||
</AnimatePresence> | ||
); | ||
}; |
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.