Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sonln99 committed Jun 21, 2024
1 parent b8f71c6 commit 62ffbad
Showing 1 changed file with 48 additions and 46 deletions.
94 changes: 48 additions & 46 deletions src/app/get-aura/deposit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { useForm, Controller } from "react-hook-form";
import axios, { AxiosRequestConfig, AxiosResponse } from "axios";
import { useEffect, useState } from "react";
import { toast } from "react-toastify";
import { redirect } from 'next/navigation'
import { redirect } from "next/navigation";

interface TableItemProps {
txTime: string;
Expand Down Expand Up @@ -50,7 +50,8 @@ function Deposit() {
formState: { errors },
} = useForm();

const { address, isConnected } = useAccount();
const { address, isConnected, isConnecting, isDisconnected, isReconnecting } =
useAccount();
// const test = "0x7c698F755Cf38b71dEef73B77E0F1438EecA99F2";
const balance = useBalance({
address: address,
Expand Down Expand Up @@ -131,57 +132,58 @@ function Deposit() {
}
}, [address]);

if (!isConnected) {
redirect('/get-aura');
if (isDisconnected) {
redirect("/get-aura");
}

return (
<div className="main-container sub-container flex flex-col">
<div className="flex flex-col">
<div className="introduce-title">
Let’s deposit some AURA to your desired CEX below:
</div>
<div className="flex gap-8 items-center justify-center mt-6 partner">
<div
className={
tutType === "bingx"
? "active partner-button cursor-pointer"
: "partner-button cursor-pointer"
}
onClick={() => {
setTutType("bingx");
}}
>
<Image src={bingx} alt="bingx" height={24} />
</div>
<div
className={
tutType === "gateio"
? "active partner-button cursor-pointer"
: "partner-button cursor-pointer"
}
onClick={() => {
setTutType("gateio");
}}
>
<Image src={gateio} alt="gate.io" height={24} />
{!isConnected && (
<div className="flex flex-col">
<div className="introduce-title">
Let’s deposit some AURA to your desired CEX below:
</div>
<div
className={
tutType === "mexc"
? "active partner-button cursor-pointer"
: "partner-button cursor-pointer"
}
onClick={() => {
setTutType("mexc");
}}
>
<Image src={mexc} alt="mexc" height={24} />
<div className="flex gap-8 items-center justify-center mt-6 partner">
<div
className={
tutType === "bingx"
? "active partner-button cursor-pointer"
: "partner-button cursor-pointer"
}
onClick={() => {
setTutType("bingx");
}}
>
<Image src={bingx} alt="bingx" height={24} />
</div>
<div
className={
tutType === "gateio"
? "active partner-button cursor-pointer"
: "partner-button cursor-pointer"
}
onClick={() => {
setTutType("gateio");
}}
>
<Image src={gateio} alt="gate.io" height={24} />
</div>
<div
className={
tutType === "mexc"
? "active partner-button cursor-pointer"
: "partner-button cursor-pointer"
}
onClick={() => {
setTutType("mexc");
}}
>
<Image src={mexc} alt="mexc" height={24} />
</div>
</div>
</div>
</div>

{tutType != "" && (
)}
{tutType != "" && isConnected && (
<div className="info flex gap-20 mt-15" style={{ marginTop: "60px" }}>
{tutType === "bingx" && (
<Image
Expand Down

0 comments on commit 62ffbad

Please sign in to comment.