Skip to content

Commit d1d758a

Browse files
committed
chore: update theme and url
1 parent 1532fe0 commit d1d758a

File tree

40 files changed

+340
-333
lines changed

40 files changed

+340
-333
lines changed

src/components/account/accountTable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useMemo } from 'react'
22

33
import { BareProps } from '@/types/page'
44
import { Table, Pagination, TableHeader, TableColumn, TableBody, TableRow, TableCell, getKeyValue } from '@heroui/react'
5-
import { formatHash, getBalanceAmount } from '@/utils/text'
5+
import { formatHash, getBalanceAmount, getThemeColor } from '@/utils/text'
66
import { getExtrinsicListParams, unwrap, useAccounts } from '@/utils/api'
77
import { PAGE_SIZE } from '@/utils/const'
88
import { useData } from '@/context'
@@ -34,7 +34,7 @@ const Component: React.FC<Props> = ({ children, className, args }) => {
3434
bottomContent={
3535
<div className="flex w-full justify-center">
3636
{pages > 0 && (
37-
<Pagination isCompact showControls showShadow initialPage={1} page={page} total={pages} onChange={(page) => setPage(page)} />
37+
<Pagination color={getThemeColor(true)} isCompact showControls showShadow initialPage={1} page={page} total={pages} onChange={(page) => setPage(page)} />
3838
)}
3939
</div>
4040
}
@@ -52,7 +52,7 @@ const Component: React.FC<Props> = ({ children, className, args }) => {
5252
if (columnKey === 'balance') {
5353
return <TableCell>{getBalanceAmount(new BigNumber(item.balance), token?.decimals).toFormat()}</TableCell>
5454
} else if (columnKey === 'address') {
55-
return <TableCell><Link href={`/account/${item.address}`}>{item.address}</Link></TableCell>
55+
return <TableCell><Link color={getThemeColor(true)} href={`/sub/account/${item.address}`}>{item.address}</Link></TableCell>
5656
}
5757
return <TableCell>{getKeyValue(item, columnKey)}</TableCell>
5858
}}

src/components/block/blockTable.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React, { useMemo } from 'react'
33
import { BareProps } from '@/types/page'
44
import { Table, Pagination, TableHeader, TableColumn, TableBody, TableRow, TableCell, getKeyValue } from '@heroui/react'
55
import { unwrap, useBlocks } from '@/utils/api'
6-
import { timeAgo } from '@/utils/text'
6+
import { getThemeColor, timeAgo } from '@/utils/text'
77
import { PAGE_SIZE } from '@/utils/const'
88
import { Link } from '../link'
99

@@ -31,7 +31,7 @@ const Component: React.FC<Props> = ({ children, className }) => {
3131
aria-label="Example table with client side pagination"
3232
bottomContent={
3333
<div className="flex w-full justify-center">
34-
{pages > 0 && <Pagination isCompact showControls showShadow initialPage={1} page={page} total={pages} onChange={(page) => setPage(page)} />}
34+
{pages > 0 && <Pagination color={getThemeColor(true)} isCompact showControls showShadow initialPage={1} page={page} total={pages} onChange={(page) => setPage(page)} />}
3535
</div>
3636
}
3737
classNames={{
@@ -51,13 +51,13 @@ const Component: React.FC<Props> = ({ children, className }) => {
5151
if (columnKey === 'block_num') {
5252
return (
5353
<TableCell>
54-
<Link href={`/block/${item.block_num}`}>{item.block_num}</Link>
54+
<Link color={getThemeColor(true)} href={`/sub/block/${item.block_num}`}>{item.block_num}</Link>
5555
</TableCell>
5656
)
5757
} else if (columnKey === 'hash') {
5858
return (
5959
<TableCell>
60-
<Link href={`/block/${item.block_num}`}>{item.hash}</Link>
60+
<Link color={getThemeColor(true)} href={`/sub/block/${item.block_num}`}>{item.hash}</Link>
6161
</TableCell>
6262
)
6363
} else if (columnKey === 'block_timestamp') {

src/components/erc20Token/erc20TokenTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ const Component: React.FC<Props> = ({ args, children, className }) => {
5151
if (columnKey === 'contract') {
5252
return (
5353
<TableCell>
54-
<Link href={`/pvm/token/${item.contract}`}>{item.contract}</Link>
54+
<Link href={`/token/${item.contract}`}>{item.contract}</Link>
5555
</TableCell>
5656
)
5757
} else if (columnKey === 'symbol') {
5858
return (
5959
<TableCell>
60-
<Link href={`/pvm/token/${item.contract}`}>{item.symbol}</Link>
60+
<Link href={`/token/${item.contract}`}>{item.symbol}</Link>
6161
</TableCell>
6262
)
6363
}

src/components/erc20Token/tokenHolderTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const Component: React.FC<Props> = ({ args, token, children, className }) => {
5151
if (columnKey === 'holder') {
5252
return (
5353
<TableCell>
54-
<Link href={`/pvm/account/${item.holder}`}>{item.holder}</Link>
54+
<Link href={`/account/${item.holder}`}>{item.holder}</Link>
5555
</TableCell>
5656
)
5757
} else if (columnKey === 'balance') {

src/components/erc20Token/tokenTransferTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ const Component: React.FC<Props> = ({ args, token, children, className }) => {
5555
const address = columnKey === 'from' ? item.from : item.to
5656
return (
5757
<TableCell>
58-
<Link href={`/pvm/account/${address}`}>{formatHash(address)}</Link>
58+
<Link href={`/account/${address}`}>{formatHash(address)}</Link>
5959
</TableCell>
6060
)
6161
} else if (columnKey === 'hash') {
62-
return <TableCell><Link href={`/pvm/tx/${item.hash}`}>{formatHash(item.hash)}</Link></TableCell>
62+
return <TableCell><Link href={`/tx/${item.hash}`}>{formatHash(item.hash)}</Link></TableCell>
6363
} else if (columnKey === 'value') {
6464
return <TableCell>{getBalanceAmount(new BigNumber(item.value), item.decimals).toFormat()} {item.symbol}</TableCell>
6565
} else if (columnKey === 'create_at') {

src/components/erc721Token/erc721TokenTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ const Component: React.FC<Props> = ({ args, children, className }) => {
5151
if (columnKey === 'contract') {
5252
return (
5353
<TableCell>
54-
<Link href={`/pvm/token/${item.contract}`}>{item.contract}</Link>
54+
<Link href={`/token/${item.contract}`}>{item.contract}</Link>
5555
</TableCell>
5656
)
5757
} else if (columnKey === 'symbol') {
5858
return (
5959
<TableCell>
60-
<Link href={`/pvm/token/${item.contract}`}>{item.symbol}</Link>
60+
<Link href={`/token/${item.contract}`}>{item.symbol}</Link>
6161
</TableCell>
6262
)
6363
}

src/components/event/eventTable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useMemo } from 'react'
22

33
import { BareProps } from '@/types/page'
44
import { Table, Pagination, TableHeader, TableColumn, TableBody, TableRow, TableCell, getKeyValue } from '@heroui/react'
5-
import { timeAgo } from '@/utils/text'
5+
import { getThemeColor, timeAgo } from '@/utils/text'
66
import { getEventListParams, unwrap, useEvents } from '@/utils/api'
77
import { PAGE_SIZE } from '@/utils/const'
88
import { Link } from '../link'
@@ -31,7 +31,7 @@ const Component: React.FC<Props> = ({ children, className, args }) => {
3131
bottomContent={
3232
<div className="flex w-full justify-center">
3333
{pages > 0 && (
34-
<Pagination isCompact showControls showShadow initialPage={1} page={page} total={pages} onChange={(page) => setPage(page)} />
34+
<Pagination color={getThemeColor(true)} isCompact showControls showShadow initialPage={1} page={page} total={pages} onChange={(page) => setPage(page)} />
3535
)}
3636
</div>
3737
}
@@ -50,7 +50,7 @@ const Component: React.FC<Props> = ({ children, className, args }) => {
5050
if (columnKey === 'event_idx') {
5151
return (
5252
<TableCell>
53-
<Link href={`/event/${item.event_index}`}>{item.event_index}</Link>
53+
<Link color={getThemeColor(true)} href={`/sub/event/${item.event_index}`}>{item.event_index}</Link>
5454
</TableCell>
5555
)
5656
} else if (columnKey === 'module_id') {

src/components/extrinsic/extrinsicTable.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useMemo } from 'react'
22

33
import { BareProps } from '@/types/page'
44
import { Table, Pagination, TableHeader, TableColumn, TableBody, TableRow, TableCell, getKeyValue } from '@heroui/react'
5-
import { formatHash, timeAgo } from '@/utils/text'
5+
import { formatHash, getThemeColor, timeAgo } from '@/utils/text'
66
import { getExtrinsicListParams, unwrap, useExtrinsics } from '@/utils/api'
77
import { PAGE_SIZE } from '@/utils/const'
88
import { Link } from '../link'
@@ -31,7 +31,7 @@ const Component: React.FC<Props> = ({ children, className, args }) => {
3131
bottomContent={
3232
<div className="flex w-full justify-center">
3333
{pages > 0 && (
34-
<Pagination isCompact showControls showShadow initialPage={1} page={page} total={pages} onChange={(page) => setPage(page)} />
34+
<Pagination color={getThemeColor(true)} isCompact showControls showShadow initialPage={1} page={page} total={pages} onChange={(page) => setPage(page)} />
3535
)}
3636
</div>
3737
}
@@ -53,13 +53,13 @@ const Component: React.FC<Props> = ({ children, className, args }) => {
5353
if (columnKey === 'extrinsic_index') {
5454
return (
5555
<TableCell>
56-
<Link href={`/extrinsic/${item.extrinsic_index}`}>{item.extrinsic_index}</Link>
56+
<Link color={getThemeColor(true)} href={`/sub/extrinsic/${item.extrinsic_index}`}>{item.extrinsic_index}</Link>
5757
</TableCell>
5858
)
5959
} else if (columnKey === 'extrinsic_hash') {
6060
return (
6161
<TableCell>
62-
<Link href={`/extrinsic/${item.extrinsic_hash}`}>{formatHash(item.extrinsic_hash)}</Link>
62+
<Link color={getThemeColor(true)} href={`/sub/extrinsic/${item.extrinsic_hash}`}>{formatHash(item.extrinsic_hash)}</Link>
6363
</TableCell>
6464
)
6565
} else if (columnKey === 'success') {

src/components/home/ExtrinsicItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface ExtrinsicItemProps {
99

1010
const ExtrinsicItem: React.FC<ExtrinsicItemProps> = ({ item }) => {
1111
const baseUrl = ''
12-
const linkHref = `/extrinsic/${item.extrinsic_index}`
12+
const linkHref = `/sub/extrinsic/${item.extrinsic_index}`
1313

1414
const bgColor = 'bg-pink-50'
1515
const hoverBgColor = 'hover:bg-pink-100'

src/components/home/HomePage.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@ const HomePage: React.FC = () => {
1818
<InfoCard
1919
title="Substrate Block"
2020
value={formatNumber(metadata.finalized_blockNum)}
21-
href="/block"
21+
href="/sub/block"
2222
bgColor="bg-pink-100"
2323
/>
2424
<InfoCard
2525
title="Extrinsic"
2626
value={formatNumber(metadata.count_extrinsic)}
27-
href="/extrinsic"
27+
href="/sub/extrinsic"
2828
bgColor="bg-pink-100"
2929
/>
3030
</div>
3131
<div className="grid grid-cols-2 gap-4 mb-8">
3232
<InfoCard
3333
title="Account"
3434
value={formatNumber(metadata.total_account)}
35-
href="/account"
35+
href="/sub/account"
3636
bgColor="bg-pink-100"
3737
/>
3838
<InfoCard
3939
title="Transfer"
4040
value={formatNumber(metadata.total_transfer)}
41-
href="/transfer"
41+
href="/sub/transfer"
4242
bgColor="bg-pink-100"
4343
/>
4444
</div>
@@ -51,27 +51,27 @@ const HomePage: React.FC = () => {
5151
<InfoCard
5252
title="PVM Block"
5353
value={metadata.finalized_blockNum}
54-
href="/pvm/block"
54+
href="/block"
5555
bgColor="bg-blue-100"
5656
/>
5757
<InfoCard
5858
title="Transaction"
5959
value={metadata.total_transaction}
60-
href="/pvm/tx"
60+
href="/tx"
6161
bgColor="bg-blue-100"
6262
/>
6363
</div>
6464
<div className="grid grid-cols-2 gap-4 mb-8">
6565
<InfoCard
6666
title="PVM Account"
6767
value={metadata.total_evm_account}
68-
href="/pvm/account"
68+
href="/account"
6969
bgColor="bg-blue-100"
7070
/>
7171
<InfoCard
7272
title="PVM Contract"
7373
value={metadata.total_evm_contract}
74-
href="/pvm/contract"
74+
href="/contract"
7575
bgColor="bg-blue-100"
7676
/>
7777
</div>

0 commit comments

Comments
 (0)