From c9be7977b2be50ff43d5dcd46aa7fb6b4590fcc8 Mon Sep 17 00:00:00 2001 From: Tien Nam Dao Date: Wed, 1 Mar 2023 13:44:54 +0700 Subject: [PATCH] fix: update with feedback --- components/Navbar/index.tsx | 2 +- next.config.js | 8 ++++++++ pages/_error.tsx | 7 ------- project.d.ts | 4 ++-- views/transactions/utils.ts | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/components/Navbar/index.tsx b/components/Navbar/index.tsx index cb6b1d35..87b817a1 100644 --- a/components/Navbar/index.tsx +++ b/components/Navbar/index.tsx @@ -25,7 +25,7 @@ export default function Navbar() { { id: '1', label: 'Blocks', - link: '/blocks' + link: '/block' }, { id: '2', diff --git a/next.config.js b/next.config.js index ad1a8518..bc79cd5b 100644 --- a/next.config.js +++ b/next.config.js @@ -15,10 +15,18 @@ const nextConfig = { }, async rewrites() { return [ + { + source: '/blocks', + destination: '/block' + }, { source: '/blocks/:blockId', destination: '/block/:blockId' }, + { + source: '/txs', + destination: '/tx' + }, { source: '/txs/:txHash', destination: '/tx/:txHash' diff --git a/pages/_error.tsx b/pages/_error.tsx index 1ec5e50b..4d669ed3 100644 --- a/pages/_error.tsx +++ b/pages/_error.tsx @@ -35,12 +35,5 @@ CustomErrorComponent.getInitialProps = async contextData => { return NextErrorComponent.getInitialProps(contextData) } -export async function getServerSideProps({}) { - return { - props: { - title: `Error Page` - } - } -} export default CustomErrorComponent diff --git a/project.d.ts b/project.d.ts index 5e95af53..c564e7ea 100644 --- a/project.d.ts +++ b/project.d.ts @@ -243,12 +243,12 @@ interface FeeResponse { } } -export interface Period { +interface Period { length: string amount: Coin[] } -export interface Coin { +interface Coin { denom: string amount: string } diff --git a/views/transactions/utils.ts b/views/transactions/utils.ts index 22534069..52174755 100644 --- a/views/transactions/utils.ts +++ b/views/transactions/utils.ts @@ -170,7 +170,7 @@ export const caculateCosmosTxAmount = (messages: TransactionMessage[]): string = BigNumber.from(getAstraTokenAmount((content as TextProposalFullContent).initialDeposit)) ) } else if ((content as MsgCreateClawbackVestingAccountContent)?.params) { - ;(content as MsgCreateClawbackVestingAccountContent).params.vesting_periods.forEach( + ((content as MsgCreateClawbackVestingAccountContent).params.vesting_periods || [])?.forEach( (period: Period) => { totalAmount = totalAmount.add(BigNumber.from(getAstraTokenAmount(period.amount))) }