Commit 017935a8 authored by isstuev's avatar isstuev

fixes2

parent 11192a24
...@@ -56,7 +56,9 @@ const LatestBlocks = () => { ...@@ -56,7 +56,9 @@ const LatestBlocks = () => {
content = ( content = (
<> <>
<Skeleton w="100%" h={ 6 } mb={ 9 }/> <Skeleton w="100%" h={ 6 } mb={ 9 }/>
{ Array.from(Array(blocksCount)).map((item, index) => <LatestBlocksItemSkeleton key={ index }/>) } <VStack spacing={ `${ BLOCK_MARGIN }px` } mb={ 6 } height={ `${ BLOCK_HEIGHT * blocksCount + BLOCK_MARGIN * (blocksCount - 1) }px` } overflow="hidden">
{ Array.from(Array(blocksCount)).map((item, index) => <LatestBlocksItemSkeleton key={ index }/>) }
</VStack>
</> </>
); );
} }
...@@ -82,6 +84,9 @@ const LatestBlocks = () => { ...@@ -82,6 +84,9 @@ const LatestBlocks = () => {
{ data.slice(0, blocksCount).map((block => <LatestBlocksItem key={ block.height } block={ block } h={ BLOCK_HEIGHT }/>)) } { data.slice(0, blocksCount).map((block => <LatestBlocksItem key={ block.height } block={ block } h={ BLOCK_HEIGHT }/>)) }
</AnimatePresence> </AnimatePresence>
</VStack> </VStack>
<Flex justifyContent="center">
<Link fontSize="sm" href={ link('blocks') }>View all blocks</Link>
</Flex>
</> </>
); );
} }
...@@ -90,9 +95,6 @@ const LatestBlocks = () => { ...@@ -90,9 +95,6 @@ const LatestBlocks = () => {
<> <>
<Heading as="h4" fontSize="18px" mb={{ base: 3, lg: 8 }}>Latest Blocks</Heading> <Heading as="h4" fontSize="18px" mb={{ base: 3, lg: 8 }}>Latest Blocks</Heading>
{ content } { content }
<Flex justifyContent="center">
<Link fontSize="sm" href={ link('blocks') }>View all blocks</Link>
</Flex>
</> </>
); );
}; };
......
import { Box, Heading, Flex, Link, Text } from '@chakra-ui/react'; import { Box, Heading, Flex, Link, Text, 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';
...@@ -27,34 +27,35 @@ const LatestTransactions = () => { ...@@ -27,34 +27,35 @@ const LatestTransactions = () => {
if (isLoading) { if (isLoading) {
content = ( content = (
<> <>
<Skeleton h="56px" w="100%"/>
{ Array.from(Array(txsCount)).map((item, index) => <LatestTxsItemSkeleton key={ index }/>) } { Array.from(Array(txsCount)).map((item, index) => <LatestTxsItemSkeleton key={ index }/>) }
</> </>
); );
} }
if (isError) { if (isError) {
content = <Text>There are no transactions. Please reload page.</Text>; content = <Text mt={ 4 }>There are no transactions. Please reload page.</Text>;
} }
if (data) { if (data) {
const txsUrl = link('txs');
content = ( content = (
<Box mb={{ base: 3, lg: 6 }}> <>
{ data.slice(0, txsCount).map((tx => <LatestTxsItem key={ tx.hash } tx={ tx }/>)) } <LatestTxsNotice/>
</Box> <Box mb={{ base: 3, lg: 6 }}>
{ data.slice(0, txsCount).map((tx => <LatestTxsItem key={ tx.hash } tx={ tx }/>)) }
</Box>
<Flex justifyContent="center">
<Link fontSize="sm" href={ txsUrl }>View all transactions</Link>
</Flex>
</>
); );
} }
const txsUrl = link('txs');
return ( return (
<> <>
<Heading as="h4" fontSize="18px" mb={{ base: 3, lg: 8 }}>Latest transactions</Heading> <Heading as="h4" fontSize="18px" mb={{ base: 3, lg: 8 }}>Latest transactions</Heading>
{ /* <TxsNewItemNotice mb={{ base: 3, lg: 8 }} url={ txsUrl }>{ ({ content }) => <Box>{ content }</Box> }</TxsNewItemNotice> */ }
<LatestTxsNotice/>
{ content } { content }
<Flex justifyContent="center">
<Link fontSize="sm" href={ txsUrl }>View all transactions</Link>
</Flex>
</> </>
); );
}; };
......
import { Box, Flex, Skeleton, useColorModeValue } from '@chakra-ui/react'; import { Flex, Skeleton, useColorModeValue } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
const StatsItemSkeleton = () => { const StatsItemSkeleton = () => {
const bgColor = useColorModeValue('blackAlpha.50', 'whiteAlpha.50'); const bgColor = useColorModeValue('blackAlpha.50', 'whiteAlpha.50');
return ( return (
<Flex background={ bgColor } padding={ 5 } borderRadius="16px"> <Flex
<Skeleton w="40px" h="40px"/> backgroundColor={ bgColor }
<Box ml={ 4 }> padding={ 5 }
<Skeleton w="69px" h="10px" mb="10px"/> borderRadius="16px"
<Skeleton w="93px" h="10px"/> flexDirection={{ base: 'row', lg: 'column', xl: 'row' }}
</Box> alignItems="center"
>
<Skeleton
w="40px"
h="40px"
mr={{ base: 4, lg: 0, xl: 4 }}
mb={{ base: 0, lg: 2, xl: 0 }}
/>
<Flex flexDirection="column" alignItems={{ base: 'start', lg: 'center', xl: 'start' }}>
<Skeleton w="69px" h="10px" mt="4px" mb="8px"/>
<Skeleton w="93px" h="14px" mb="4px"/>
</Flex>
</Flex> </Flex>
); );
}; };
......
...@@ -31,7 +31,15 @@ const ChainIndicatorItem = ({ id, title, value, icon, isSelected, onClick, stats ...@@ -31,7 +31,15 @@ const ChainIndicatorItem = ({ id, title, value, icon, isSelected, onClick, stats
} }
if (stats.isLoading) { if (stats.isLoading) {
return <Skeleton h={ 3 } w="70px" my={ 1.5 }/>; return (
<Skeleton
h={ 3 }
w="70px"
my={ 1.5 }
// ssr: isMobile = undefined, isLoading = true
display={{ base: 'none', lg: 'block' }}
/>
);
} }
if (stats.isError) { if (stats.isError) {
......
...@@ -16,7 +16,7 @@ const Home = () => { ...@@ -16,7 +16,7 @@ const Home = () => {
backgroundImage="radial-gradient(farthest-corner at 0 0, rgba(183, 148, 244, 0.8) 0%, rgba(0, 163, 196, 0.8) 100%)" backgroundImage="radial-gradient(farthest-corner at 0 0, rgba(183, 148, 244, 0.8) 0%, rgba(0, 163, 196, 0.8) 100%)"
borderRadius="24px" borderRadius="24px"
padding={{ base: '24px 40px', lg: '48px' }} padding={{ base: '24px 40px', lg: '48px' }}
minW="850px" minW={{ base: 'unset', lg: '900px' }}
> >
<Heading <Heading
as="h1" as="h1"
......
...@@ -44,7 +44,7 @@ const Page = ({ ...@@ -44,7 +44,7 @@ const Page = ({
}, [ wrapChildren ]); }, [ wrapChildren ]);
const renderedChildren = wrapChildren ? ( const renderedChildren = wrapChildren ? (
<PageContent>{ children }</PageContent> <PageContent hasSearch={ hasSearch }>{ children }</PageContent>
) : children; ) : children;
return ( return (
......
...@@ -3,16 +3,17 @@ import React from 'react'; ...@@ -3,16 +3,17 @@ import React from 'react';
interface Props { interface Props {
children: React.ReactNode; children: React.ReactNode;
hasSearch: boolean;
} }
const PageContent = ({ children }: Props) => { const PageContent = ({ children, hasSearch }: Props) => {
return ( return (
<Box <Box
as="main" as="main"
w="100%" w="100%"
paddingX={{ base: 4, lg: 12 }} paddingX={{ base: 4, lg: 12 }}
paddingBottom={ 10 } paddingBottom={ 10 }
paddingTop={{ base: '138px', lg: 0 }} paddingTop={{ base: hasSearch ? '138px' : '88px', lg: 0 }}
> >
{ children } { children }
</Box> </Box>
......
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