Commit b0fb59e1 authored by isstuev's avatar isstuev

fixes and tests

parent 34bc7548
This diff is collapsed.
...@@ -41,6 +41,7 @@ frontend: ...@@ -41,6 +41,7 @@ frontend:
- "/verified-contracts" - "/verified-contracts"
- "/graphiql" - "/graphiql"
- "/output-roots" - "/output-roots"
- "/withdrawals"
resources: resources:
limits: limits:
......
...@@ -26,33 +26,29 @@ const Withdrawals = () => { ...@@ -26,33 +26,29 @@ const Withdrawals = () => {
return <DataFetchAlert/>; return <DataFetchAlert/>;
} }
const text = isLoading ?
<Skeleton w="400px" h="26px" mb={{ base: 6, lg: 0 }}/> :
<Text mb={{ base: 6, lg: 0 }}>A total of { data.total } withdrawals found</Text>;
const bar = (
<>
{ isMobile && text }
<ActionBar mt={ -6 }>
<Flex alignItems="center" justifyContent="space-between" w="100%">
{ !isMobile && text }
{ isPaginationVisible && <Pagination ml="auto" { ...pagination }/> }
</Flex>
</ActionBar>
</>
);
if (isLoading) { if (isLoading) {
return ( return (
<> <>
{ bar } <Skeleton w={{ base: '100%', lg: '320px' }} h="26px" mb={{ base: 6, lg: 7 }} mt={{ base: 0, lg: 7 }}/>
<SkeletonList display={{ base: 'block', lg: 'none' }}/> <SkeletonList display={{ base: 'block', lg: 'none' }}/>
<SkeletonTable display={{ base: 'none', lg: 'block' }} columns={ Array(7).fill(`${ 100 / 7 }%`) }/> <SkeletonTable minW="950px" display={{ base: 'none', lg: 'block' }} columns={ Array(7).fill(`${ 100 / 7 }%`) }/>
</> </>
); );
} }
const text = <Text mb={{ base: 6, lg: 0 }}>A total of { data.total.toLocaleString('en') } withdrawals found</Text>;
return ( return (
<> <>
{ bar } { (isMobile || !isPaginationVisible) && text }
{ isPaginationVisible && (
<ActionBar mt={ -6 }>
<Flex alignItems="center" justifyContent="space-between" w="100%">
{ !isMobile && text }
<Pagination ml="auto" { ...pagination }/>
</Flex>
</ActionBar>
) }
<Show below="lg" ssr={ false }>{ data.items.map((item => <WithdrawalsListItem key={ item.l2_tx_hash } { ...item }/>)) }</Show> <Show below="lg" ssr={ false }>{ data.items.map((item => <WithdrawalsListItem key={ item.l2_tx_hash } { ...item }/>)) }</Show>
<Hide below="lg" ssr={ false }><WithdrawalsTable items={ data.items } top={ isPaginationVisible ? 80 : 0 }/></Hide> <Hide below="lg" ssr={ false }><WithdrawalsTable items={ data.items } top={ isPaginationVisible ? 80 : 0 }/></Hide>
</> </>
......
...@@ -64,7 +64,11 @@ const WithdrawalsListItem = ({ ...@@ -64,7 +64,11 @@ const WithdrawalsListItem = ({
{ l1_tx_hash && ( { l1_tx_hash && (
<HStack spacing={ 3 } width="100%"> <HStack spacing={ 3 } width="100%">
<Text fontSize="sm" fontWeight={ 500 } whiteSpace="nowrap">L1 txn hash</Text> <Text fontSize="sm" fontWeight={ 500 } whiteSpace="nowrap">L1 txn hash</Text>
<LinkExternal href={ appConfig.L2.withdrawalUrl }><HashStringShorten hash={ l1_tx_hash }/></LinkExternal> <LinkExternal
href={ appConfig.L2.L1BaseUrl + route({ pathname: '/tx/[hash]', query: { hash: l1_tx_hash } }) }
>
<HashStringShorten hash={ l1_tx_hash }/>
</LinkExternal>
</HStack> </HStack>
) } ) }
{ challenge_period_end && ( { challenge_period_end && (
......
...@@ -60,8 +60,13 @@ const WithdrawalsTableItem = ({ ...@@ -60,8 +60,13 @@ const WithdrawalsTableItem = ({
} }
</Td> </Td>
<Td verticalAlign="middle"> <Td verticalAlign="middle">
{ l1_tx_hash ? { l1_tx_hash ? (
<LinkExternal href={ appConfig.L2.withdrawalUrl }><HashStringShorten hash={ l1_tx_hash }/></LinkExternal> : <LinkExternal
href={ appConfig.L2.L1BaseUrl + route({ pathname: '/tx/[hash]', query: { hash: l1_tx_hash } }) }
>
<HashStringShorten hash={ l1_tx_hash }/>
</LinkExternal>
) :
'N/A' 'N/A'
} }
</Td> </Td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment