Commit 7f2afd75 authored by isstuev's avatar isstuev

text instead of alert if empty table

parent 42ea53d1
import { Box, Text, Show, Alert, Skeleton } from '@chakra-ui/react'; import { Box, Text, Show, Hide, Skeleton } from '@chakra-ui/react';
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import React from 'react'; import React from 'react';
...@@ -31,10 +31,10 @@ const BlocksContent = ({ type }: Props) => { ...@@ -31,10 +31,10 @@ const BlocksContent = ({ type }: Props) => {
<Show below="lg" key="skeleton-mobile"> <Show below="lg" key="skeleton-mobile">
<BlocksSkeletonMobile/> <BlocksSkeletonMobile/>
</Show> </Show>
<Show above="lg" key="skeleton-desktop"> <Hide below="lg" key="skeleton-desktop">
<Skeleton h={ 6 } mb={ 8 } w="150px"/> <Skeleton h={ 6 } mb={ 8 } w="150px"/>
<SkeletonTable columns={ [ '125px', '120px', '21%', '64px', '35%', '22%', '22%' ] }/> <SkeletonTable columns={ [ '125px', '120px', '21%', '64px', '35%', '22%', '22%' ] }/>
</Show> </Hide>
</> </>
); );
} }
...@@ -44,14 +44,14 @@ const BlocksContent = ({ type }: Props) => { ...@@ -44,14 +44,14 @@ const BlocksContent = ({ type }: Props) => {
} }
if (data.items.length === 0) { if (data.items.length === 0) {
return <Alert>There are no blocks.</Alert>; return <Text as="span">There are no blocks.</Text>;
} }
return ( return (
<> <>
<Text as="span">Total of { data.items[0].height.toLocaleString() } blocks</Text> <Text as="span">Total of { data.items[0].height.toLocaleString() } blocks</Text>
<Show below="lg" key="content-mobile"><BlocksList data={ data.items }/></Show> <Show below="lg" key="content-mobile"><BlocksList data={ data.items }/></Show>
<Show above="lg" key="content-desktop"><BlocksTable data={ data.items }/></Show> <Hide below="lg" key="content-desktop"><BlocksTable data={ data.items }/></Hide>
<Box mx={{ base: 0, lg: 6 }} my={{ base: 6, lg: 3 }}> <Box mx={{ base: 0, lg: 6 }} my={{ base: 6, lg: 3 }}>
{ /* eslint-disable-next-line react/jsx-no-bind */ } { /* eslint-disable-next-line react/jsx-no-bind */ }
<Pagination page={ 1 } onNextPageClick={ () => {} } onPrevPageClick={ () => {} } resetPage={ () => {} } hasNextPage/> <Pagination page={ 1 } onNextPageClick={ () => {} } onPrevPageClick={ () => {} } resetPage={ () => {} } hasNextPage/>
......
import { Box, Flex, Alert, Show } from '@chakra-ui/react'; import { Box, Flex, Text, Show, Hide } from '@chakra-ui/react';
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import React from 'react'; import React from 'react';
...@@ -96,7 +96,7 @@ const TxInternals = () => { ...@@ -96,7 +96,7 @@ const TxInternals = () => {
return ( return (
<> <>
<Show below="lg"><TxInternalsSkeletonMobile/></Show> <Show below="lg"><TxInternalsSkeletonMobile/></Show>
<Show above="lg"><TxInternalsSkeletonDesktop/></Show> <Hide below="lg"><TxInternalsSkeletonDesktop/></Hide>
</> </>
); );
} }
...@@ -106,7 +106,7 @@ const TxInternals = () => { ...@@ -106,7 +106,7 @@ const TxInternals = () => {
} }
if (data.items.length === 0) { if (data.items.length === 0) {
return <Alert>There are no internal transactions for this transaction.</Alert>; return <Text as="span">There are no internal transactions for this transaction.</Text>;
} }
const content = (() => { const content = (() => {
......
import { Box, Alert } from '@chakra-ui/react'; import { Box, Text } from '@chakra-ui/react';
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import React from 'react'; import React from 'react';
...@@ -37,7 +37,7 @@ const TxLogs = () => { ...@@ -37,7 +37,7 @@ const TxLogs = () => {
} }
if (data.items.length === 0) { if (data.items.length === 0) {
return <Alert>There are no logs for this transaction.</Alert>; return <Text as="span">There are no logs for this transaction.</Text>;
} }
return ( return (
......
import { Alert, Box, Show } from '@chakra-ui/react'; import { Text, Box, Show, Hide } from '@chakra-ui/react';
import React, { useState, useCallback } from 'react'; import React, { useState, useCallback } from 'react';
import type { TTxsFilters } from 'types/api/txsFilters'; import type { TTxsFilters } from 'types/api/txsFilters';
...@@ -71,13 +71,13 @@ const TxsContent = ({ ...@@ -71,13 +71,13 @@ const TxsContent = ({
const txs = data?.items; const txs = data?.items;
if (!isLoading && !txs) { if (!isLoading && !txs) {
return <Alert>There are no transactions.</Alert>; return <Text as="span">There are no transactions.</Text>;
} }
let content = ( let content = (
<> <>
<Show below="lg" ssr={ false }><TxsSkeletonMobile/></Show> <Show below="lg" ssr={ false }><TxsSkeletonMobile/></Show>
<Show above="lg" ssr={ false }><TxsSkeletonDesktop/></Show> <Hide below="lg" ssr={ false }><TxsSkeletonDesktop/></Hide>
</> </>
); );
......
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