From c0a6d99cea9bcdbc238df46c2fa6dc1b55604a62 Mon Sep 17 00:00:00 2001 From: eericxu <2681350846@qq.com> Date: Tue, 17 Dec 2024 16:19:47 +0800 Subject: [PATCH] fix style --- src/components/ALoading.tsx | 2 +- src/components/ATable.tsx | 12 +++++++----- src/components/Pagination.tsx | 2 +- src/pages/files.tsx | 21 +++++++++++---------- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/components/ALoading.tsx b/src/components/ALoading.tsx index 8c438e7..9200944 100644 --- a/src/components/ALoading.tsx +++ b/src/components/ALoading.tsx @@ -8,7 +8,7 @@ export function Loading(p: { size?: string } & HTMLAttributes) {
diff --git a/src/components/ATable.tsx b/src/components/ATable.tsx index 598fd1e..943571a 100644 --- a/src/components/ATable.tsx +++ b/src/components/ATable.tsx @@ -2,13 +2,15 @@ import { FC, useEffect } from "react"; import { data } from "../pages/files"; import { copyTextToClipboard, formatBytes, timestampToDateTime, truncateMiddle } from "../utils/utils"; import { Loading } from "./ALoading"; +import classNames from "classnames"; type ATableProps = { - header: { name: string }[] + header: { name: string, className?: string }[] data?: data[] loading?: boolean + className?: string } -const ATable: FC = ({ header = [], data = [], loading }) => { +const ATable: FC = ({ header = [], data = [], loading, className }) => { const fileHost = (item: data) => { const cru_host = 'https://gw.crust-gateway.xyz/ipfs' @@ -33,10 +35,10 @@ const ATable: FC = ({ header = [], data = [], loading }) => { return <> - +
{header.map((item, i) => { - return + return })} {!loading && data.length > 0 && data.map((item, i) => { @@ -75,7 +77,7 @@ const ATable: FC = ({ header = [], data = [], loading }) => { })}
{item.name}{item.name}
- {loading && } + {loading && } ; }; diff --git a/src/components/Pagination.tsx b/src/components/Pagination.tsx index adc6ff0..6e9f90c 100644 --- a/src/components/Pagination.tsx +++ b/src/components/Pagination.tsx @@ -79,7 +79,7 @@ export const Pagination = (p: Props) => { return (
diff --git a/src/pages/files.tsx b/src/pages/files.tsx index 9beff59..bb0614d 100644 --- a/src/pages/files.tsx +++ b/src/pages/files.tsx @@ -47,7 +47,7 @@ const Files = () => { const getCurrentUserInfo = async () => { setLoading(true); - const url = `https://tonbags-api.crust.network/users?address=${add.address}&page=${pgNum}&pageSize=10`; + const url = `https://tonbags-api.crust.network/users?address=${add.address}&page=${pgNum}&pageSize=8`; if (!add?.address) return; fetch(url, { headers: { 'Content-Type': 'application/json' } @@ -74,7 +74,7 @@ const Files = () => { }, [add?.address, pgNum]); return ( -
+
{ <> My Files @@ -95,15 +95,16 @@ const Files = () => {
@@ -119,7 +120,7 @@ const Files = () => { }} total={userData?.pagination?.totalRecords || 0} pgSize={Number(userData?.pagination.pageSize) || 1} - pgNum={Number(userData?.pagination.page) || 10} + pgNum={Number(userData?.pagination.page) || 8} />