-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1932 from ten-protocol/jennifer/2751-tenscan-ui-u…
…pdates [Tenscan] Frontend Updates
- Loading branch information
Showing
55 changed files
with
2,020 additions
and
396 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v20.11.0 |
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
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { fetchBatchByHeight } from "@/api/batches"; | ||
import Layout from "@/src/components/layouts/default-layout"; | ||
import { BatchHeightDetailsComponent } from "@/src/components/modules/batches/batch-height-details"; | ||
import { | ||
Card, | ||
CardHeader, | ||
CardTitle, | ||
CardContent, | ||
CardDescription, | ||
} from "@/src/components/ui/card"; | ||
import { Skeleton } from "@/src/components/ui/skeleton"; | ||
import { useQuery } from "@tanstack/react-query"; | ||
import { useRouter } from "next/router"; | ||
|
||
export default function Batch() { | ||
const router = useRouter(); | ||
const { height } = router.query; | ||
|
||
const { data, isLoading } = useQuery({ | ||
queryKey: ["batchHeight", height], | ||
queryFn: () => fetchBatchByHeight(height as string), | ||
}); | ||
|
||
const batchDetails = data?.item; | ||
|
||
return ( | ||
<Layout> | ||
{isLoading ? ( | ||
<Skeleton className="h-6 w-24" /> | ||
) : batchDetails ? ( | ||
<Card className="col-span-3"> | ||
<CardHeader> | ||
<CardTitle>Batch #{Number(batchDetails?.header?.number)}</CardTitle> | ||
<CardDescription> | ||
Overview of the batch #{Number(batchDetails?.header?.number)} | ||
</CardDescription> | ||
</CardHeader> | ||
<CardContent> | ||
<BatchHeightDetailsComponent batchDetails={batchDetails} /> | ||
</CardContent> | ||
</Card> | ||
) : ( | ||
<div>Batch not found</div> | ||
)} | ||
</Layout> | ||
); | ||
} | ||
|
||
export async function getServerSideProps(context: any) { | ||
return { | ||
props: {}, | ||
}; | ||
} |
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,66 @@ | ||
import { fetchBatchTransactions } from "@/api/batches"; | ||
import Layout from "@/src/components/layouts/default-layout"; | ||
import { DataTable } from "@/src/components/modules/common/data-table/data-table"; | ||
import { columns } from "@/src/components/modules/batches/transaction-columns"; | ||
import { | ||
Card, | ||
CardHeader, | ||
CardTitle, | ||
CardContent, | ||
CardDescription, | ||
} from "@/src/components/ui/card"; | ||
import { useQuery } from "@tanstack/react-query"; | ||
import { useRouter } from "next/router"; | ||
import { getOptions } from "@/src/lib/constants"; | ||
import TruncatedAddress from "@/src/components/modules/common/truncated-address"; | ||
|
||
export default function BatchTransactions() { | ||
const router = useRouter(); | ||
const { fullHash } = router.query; | ||
const options = getOptions(router.query); | ||
|
||
const { data, isLoading, refetch } = useQuery({ | ||
queryKey: ["batchTransactions", { fullHash, options }], | ||
queryFn: () => fetchBatchTransactions(fullHash as string, options), | ||
}); | ||
|
||
const { TransactionsData, Total } = data?.result || { | ||
TransactionsData: [], | ||
Total: 0, | ||
}; | ||
|
||
return ( | ||
<Layout> | ||
<Card className="col-span-3"> | ||
<CardHeader> | ||
<CardTitle>Transactions</CardTitle> | ||
<CardDescription className="flex items-center space-x-2"> | ||
<p>Overview of all transactions in this batch:</p> | ||
<TruncatedAddress | ||
address={fullHash as string} | ||
showCopy={false} | ||
link={"/batch/" + fullHash} | ||
/> | ||
</CardDescription> | ||
</CardHeader> | ||
<CardContent> | ||
<DataTable | ||
columns={columns} | ||
data={TransactionsData} | ||
refetch={refetch} | ||
total={+Total} | ||
isLoading={isLoading} | ||
noResultsMessage="No transactions found in this batch." | ||
noPagination={true} | ||
/> | ||
</CardContent> | ||
</Card> | ||
</Layout> | ||
); | ||
} | ||
|
||
export async function getServerSideProps(context: any) { | ||
return { | ||
props: {}, | ||
}; | ||
} |
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.