Commit 772ad9ba authored by tom's avatar tom

long skeleton, first attempt

parent 428ec75e
...@@ -5,7 +5,7 @@ import omit from 'lodash/omit'; ...@@ -5,7 +5,7 @@ import omit from 'lodash/omit';
import pick from 'lodash/pick'; import pick from 'lodash/pick';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import React, { useCallback } from 'react'; import React, { useCallback } from 'react';
import { animateScroll } from 'react-scroll'; // import { animateScroll } from 'react-scroll';
import type { PaginatedResources, PaginatedResponse, PaginationFilters } from 'lib/api/resources'; import type { PaginatedResources, PaginatedResponse, PaginationFilters } from 'lib/api/resources';
import { RESOURCES } from 'lib/api/resources'; import { RESOURCES } from 'lib/api/resources';
...@@ -25,7 +25,7 @@ export default function useQueryWithPages<Resource extends PaginatedResources>({ ...@@ -25,7 +25,7 @@ export default function useQueryWithPages<Resource extends PaginatedResources>({
filters, filters,
options, options,
pathParams, pathParams,
scrollRef, // scrollRef,
}: Params<Resource>) { }: Params<Resource>) {
const resource = RESOURCES[resourceName]; const resource = RESOURCES[resourceName];
const queryClient = useQueryClient(); const queryClient = useQueryClient();
...@@ -47,8 +47,8 @@ export default function useQueryWithPages<Resource extends PaginatedResources>({ ...@@ -47,8 +47,8 @@ export default function useQueryWithPages<Resource extends PaginatedResources>({
const queryParams = { ...pageParams[page], ...filters }; const queryParams = { ...pageParams[page], ...filters };
const scrollToTop = useCallback(() => { const scrollToTop = useCallback(() => {
scrollRef?.current ? scrollRef.current.scrollIntoView(true) : animateScroll.scrollToTop({ duration: 0 }); // scrollRef?.current ? scrollRef.current.scrollIntoView(true) : animateScroll.scrollToTop({ duration: 0 });
}, [ scrollRef ]); }, [ ]);
const queryResult = useApiQuery(resourceName, { const queryResult = useApiQuery(resourceName, {
pathParams, pathParams,
......
...@@ -3,6 +3,7 @@ const zIndices = { ...@@ -3,6 +3,7 @@ const zIndices = {
auto: 'auto', auto: 'auto',
base: 0, base: 0,
docked: 10, docked: 10,
overDocked: 11,
tooltip: 900, tooltip: 900,
dropdown: 1000, dropdown: 1000,
sticky: 1100, sticky: 1100,
......
...@@ -152,6 +152,7 @@ const AddressTxs = ({ scrollRef }: {scrollRef?: React.RefObject<HTMLDivElement>} ...@@ -152,6 +152,7 @@ const AddressTxs = ({ scrollRef }: {scrollRef?: React.RefObject<HTMLDivElement>}
showSocketInfo={ addressTxsQuery.pagination.page === 1 } showSocketInfo={ addressTxsQuery.pagination.page === 1 }
socketInfoAlert={ socketAlert } socketInfoAlert={ socketAlert }
socketInfoNum={ newItemsCount } socketInfoNum={ newItemsCount }
top={ 80 }
/> />
</> </>
); );
......
...@@ -43,6 +43,10 @@ const AddressCoinBalanceHistory = ({ query }: Props) => { ...@@ -43,6 +43,10 @@ const AddressCoinBalanceHistory = ({ query }: Props) => {
return <DataFetchAlert/>; return <DataFetchAlert/>;
} }
if (query.data.items.length === 0 && !query.isPaginationVisible) {
return <span>There is no coin balance history for this address</span>;
}
return ( return (
<> <>
<Hide below="lg" ssr={ false }> <Hide below="lg" ssr={ false }>
......
...@@ -20,7 +20,7 @@ const AddressNameInfo = ({ data }: Props) => { ...@@ -20,7 +20,7 @@ const AddressNameInfo = ({ data }: Props) => {
hint="Token name and symbol" hint="Token name and symbol"
> >
<LinkInternal href={ route({ pathname: '/token/[hash]', query: { hash: data.token.address } }) }> <LinkInternal href={ route({ pathname: '/token/[hash]', query: { hash: data.token.address } }) }>
{ data.token.name }{ symbol } { data.token.name || 'Unnamed token' }{ symbol }
</LinkInternal> </LinkInternal>
</DetailsInfoItem> </DetailsInfoItem>
); );
......
...@@ -36,7 +36,10 @@ const ActionBar = ({ children, className }: Props) => { ...@@ -36,7 +36,10 @@ const ActionBar = ({ children, className }: Props) => {
transitionProperty="top,box-shadow,background-color,color" transitionProperty="top,box-shadow,background-color,color"
transitionDuration="normal" transitionDuration="normal"
zIndex={{ base: 'sticky2', lg: 'docked' }} zIndex={{ base: 'sticky2', lg: 'docked' }}
boxShadow={{ base: isSticky ? 'md' : 'none', lg: 'none' }} boxShadow={{
base: isSticky ? 'md' : 'none',
lg: isSticky ? '0 4px 6px -6px rgb(0 0 0 / 10%), 0 2px 4px -4px rgb(0 0 0 / 6%)' : 'none',
}}
ref={ ref } ref={ ref }
> >
{ children } { children }
......
...@@ -36,7 +36,7 @@ const TheadSticky = ({ top, children, ...restProps }: Props) => { ...@@ -36,7 +36,7 @@ const TheadSticky = ({ top, children, ...restProps }: Props) => {
top: `${ top }px` || 0, top: `${ top }px` || 0,
backgroundColor: useColorModeValue('white', 'black'), backgroundColor: useColorModeValue('white', 'black'),
boxShadow: isSticky ? 'md' : 'none', boxShadow: isSticky ? 'md' : 'none',
zIndex: 1, zIndex: 'overDocked',
}; };
return ( return (
......
...@@ -10,7 +10,7 @@ const SkeletonTable = ({ columns, className }: Props) => { ...@@ -10,7 +10,7 @@ const SkeletonTable = ({ columns, className }: Props) => {
return ( return (
<Box className={ className }> <Box className={ className }>
<Skeleton height={ 10 } width="100%" borderBottomLeftRadius="none" borderBottomRightRadius="none"/> <Skeleton height={ 10 } width="100%" borderBottomLeftRadius="none" borderBottomRightRadius="none"/>
{ Array.from(Array(3)).map((item, index) => ( { Array.from(Array(50)).map((item, index) => (
<HStack key={ index } spacing={ 6 } marginTop={ 8 }> <HStack key={ index } spacing={ 6 } marginTop={ 8 }>
{ columns.map((width, index) => ( { columns.map((width, index) => (
<Skeleton <Skeleton
......
...@@ -31,6 +31,7 @@ type Props = { ...@@ -31,6 +31,7 @@ type Props = {
currentAddress?: string; currentAddress?: string;
filter?: React.ReactNode; filter?: React.ReactNode;
enableTimeIncrement?: boolean; enableTimeIncrement?: boolean;
top?: number;
} }
const TxsContent = ({ const TxsContent = ({
...@@ -42,6 +43,7 @@ const TxsContent = ({ ...@@ -42,6 +43,7 @@ const TxsContent = ({
socketInfoNum, socketInfoNum,
currentAddress, currentAddress,
enableTimeIncrement, enableTimeIncrement,
top,
}: Props) => { }: Props) => {
const { data, isLoading, isError, setSortByField, setSortByValue, sorting } = useTxsSort(query); const { data, isLoading, isError, setSortByField, setSortByValue, sorting } = useTxsSort(query);
const isMobile = useIsMobile(); const isMobile = useIsMobile();
...@@ -105,7 +107,7 @@ const TxsContent = ({ ...@@ -105,7 +107,7 @@ const TxsContent = ({
showSocketInfo={ showSocketInfo } showSocketInfo={ showSocketInfo }
socketInfoAlert={ socketInfoAlert } socketInfoAlert={ socketInfoAlert }
socketInfoNum={ socketInfoNum } socketInfoNum={ socketInfoNum }
top={ query.isPaginationVisible ? 80 : 0 } top={ top || query.isPaginationVisible ? 80 : 0 }
currentAddress={ currentAddress } currentAddress={ currentAddress }
enableTimeIncrement={ enableTimeIncrement } enableTimeIncrement={ enableTimeIncrement }
/> />
......
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