mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* fallback components * home page graphs: fix tab title flickering * degraded views * fix tx degraded view when initial query is refetching * call unwatch when components unmount * tests * use context to store rpc data * stats degraded state * update tests * RPC data hint * fixes * review fixes * condition fix * cover ads in test
25 lines
691 B
TypeScript
25 lines
691 B
TypeScript
import React from 'react';
|
|
|
|
import useGradualIncrement from 'lib/hooks/useGradualIncrement';
|
|
import SocketNewItemsNotice from 'ui/shared/SocketNewItemsNotice';
|
|
|
|
interface Props {
|
|
overflow: number;
|
|
url: string;
|
|
isLoading: boolean;
|
|
}
|
|
|
|
const LatestTxsDegradedNewItems = ({ overflow, url, isLoading }: Props) => {
|
|
const [ num, setNum ] = useGradualIncrement(0);
|
|
|
|
React.useEffect(() => {
|
|
if (!isLoading && overflow > 0) {
|
|
setNum(overflow);
|
|
}
|
|
}, [ isLoading, overflow, setNum ]);
|
|
|
|
return <SocketNewItemsNotice borderBottomRadius={ 0 } num={ num } url={ url } showErrorAlert={ false } isLoading={ isLoading }/>;
|
|
};
|
|
|
|
export default React.memo(LatestTxsDegradedNewItems);
|