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 ea43137 commit 3d4026b
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 17 deletions.
1 change: 1 addition & 0 deletions src/app/get-aura/deposit-aura/deposit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface TableItemProps {

function Deposit() {
const [tutType, setTutType] = useState<string>("gateio");

const {
sendTransaction,
data: hash,
Expand Down
4 changes: 4 additions & 0 deletions src/app/get-aura/deposit-aura/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ import {
} from "wagmi";
import WalletConnectEVM from "../wallet-connect";
import Deposit from "./deposit";
import { useEffect } from "react";

function DepositAura() {
useEffect(() => {
document.title = "Deposit AURA to exchanges";
}, []);
const { isConnected, address } = useAccount();
return (
<div>
Expand Down
44 changes: 37 additions & 7 deletions src/app/get-aura/table-history/mobile-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import carretUp from "@/assets/icons/ic_carret_up.svg";
import clock from "@/assets/icons/ic_clock.svg";
import Image from "next/image";
import { formatNumber } from "../../utils/numbers";
import { useAccount, useBalance } from "wagmi";

interface MobileTableItemProps {
txTime: string;
Expand All @@ -23,22 +24,36 @@ type props = {

const MobileTableItem: React.FC<props> = ({ tableItem }) => {
const [expand, setExpand] = useState(false);
const { address, isConnected } = useAccount();
const balance = useBalance({
address: address,
});
const _symbol = balance?.data?.symbol;

return (
<div className="frame-29681">
<div className="frame-29779">
<div className="heading">
<div className="title">
<div className="frame-1000002280">
<Address address={tableItem?.evmTxHash} link={true} ellipsis={true} />
<Address
address={tableItem?.evmTxHash}
link={true}
ellipsis={true}
/>
</div>
<div className="time-and-message">
<div className="time">
<Image src={clock} alt="" height={14} />
<div className="cell-text2">{dayjs(tableItem.txTime).format("HH:mm:ss DD/MM/YYYY")}</div>
<div className="cell-text2">
{dayjs(tableItem.txTime).format("HH:mm:ss DD/MM/YYYY")}
</div>
</div>
</div>
<div className="in-out">
<div className={tableItem?.status?.toLowerCase()}>{tableItem.status}</div>
<div className={tableItem?.status?.toLowerCase()}>
{tableItem.status}
</div>
</div>
</div>
<div
Expand All @@ -47,26 +62,41 @@ const MobileTableItem: React.FC<props> = ({ tableItem }) => {
setExpand(!expand);
}}
>
<Image src={carretUp} className={expand ? "expanded" : ""} alt="" height={16} />
<Image
src={carretUp}
className={expand ? "expanded" : ""}
alt=""
height={16}
/>
</div>
</div>
{expand && (
<div className="flex flex-col w-full gap-2">
<div className="line-18"></div>
<div className="frame-29708">
<div className="amount">Amount</div>
<div className="_200-aura">{formatNumber(formatUnits(BigInt(tableItem?.amount), 18))} AURA</div>
<div className="_200-aura">
{formatNumber(formatUnits(BigInt(tableItem?.amount), 18))} {_symbol?.toString()}
</div>
</div>
<div className="frame-29707">
<div className="cosmos-tx-hash">Cosmos TX hash</div>
<div className="frame-3099">
<Address address={tableItem?.cosmosTxHash} link={true} ellipsis={true} />
<Address
address={tableItem?.cosmosTxHash}
link={true}
ellipsis={true}
/>
</div>
</div>
<div className="frame-29705">
<div className="deposit-address">Deposit address</div>
<div className="content">
<Address address={tableItem?.depAddress} link={true} ellipsis={true} />
<Address
address={tableItem?.depAddress}
link={true}
ellipsis={true}
/>
</div>
</div>
</div>
Expand Down
32 changes: 27 additions & 5 deletions src/app/get-aura/table-history/table-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import dayjs from "dayjs";
import React from "react";
import { formatUnits } from "viem";
import { formatNumber } from "../../utils/numbers";
import { useAccount, useBalance } from "wagmi";

interface TableItemProps {
txTime: string;
Expand All @@ -18,26 +19,47 @@ type props = {
};

const TableItem: React.FC<props> = ({ tableItem }) => {
const { address } = useAccount();
const balance = useBalance({
address: address,
});
const _symbol = balance?.data?.symbol;

return (
<div className="frame-418 max-w-full">
<div className="frame-359">
<div className="frame-560">
<div className="_18-24-24-15-10-2024">{dayjs(tableItem?.txTime)?.format("HH:mm:ss DD/MM/YYYY")}</div>
<div className="_18-24-24-15-10-2024">
{dayjs(tableItem?.txTime)?.format("HH:mm:ss DD/MM/YYYY")}
</div>
</div>
<div className="frame-554">
<Address address={tableItem?.evmTxHash} link={true} ellipsis={true} />
</div>
<div className="frame-570">
<Address address={tableItem?.cosmosTxHash} link={true} ellipsis={true} />
<Address
address={tableItem?.cosmosTxHash}
link={true}
ellipsis={true}
/>
</div>
<div className="frame-571">
<Address address={tableItem?.depAddress} link={true} ellipsis={true} />
<Address
address={tableItem?.depAddress}
link={true}
ellipsis={true}
/>
</div>
<div className="frame-561">
<div className="_20-aura">{formatNumber(formatUnits(BigInt(tableItem?.amount), 18))} AURA</div>
<div className="_20-aura">
{formatNumber(formatUnits(BigInt(tableItem?.amount), 18))}{" "}
{_symbol?.toString()}
</div>
</div>
<div className="frame-572">
<div className={tableItem?.status?.toLowerCase()}>{tableItem?.status}</div>
<div className={tableItem?.status?.toLowerCase()}>
{tableItem?.status}
</div>
</div>
</div>
</div>
Expand Down
4 changes: 0 additions & 4 deletions src/app/get-aura/table-history/table.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import useActivityHistory from "@/hooks/useActivityHistory";
import { useEffect, useState } from "react";
import { useAccount } from "wagmi";
import "./table.css";
import { useMediaQuery } from "react-responsive";
import axios, { AxiosRequestConfig, AxiosResponse } from "axios";
import MobileTableItem from "./mobile-table";
import TableItem from "./table-item";
interface TableItemProps {
Expand Down
5 changes: 4 additions & 1 deletion src/app/get-aura/withdraw-aura/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ import {
} from "wagmi";
import WalletConnectEVM from "../wallet-connect";
import Withdraw from "./withdraw";
import { useEffect } from "react";

function WithdrawAura() {
// return <Withdraw></Withdraw>;
useEffect(() => {
document.title = "Withdraw AURA from exchanges";
}, []);
const { isConnected, address } = useAccount();
return (
<div>
Expand Down

0 comments on commit 3d4026b

Please sign in to comment.