diff --git a/src/components/EmptyPlaceholder/EmptyPlaceholder.tsx b/src/components/EmptyPlaceholder/EmptyPlaceholder.tsx index cb2900bd..e9c46c06 100644 --- a/src/components/EmptyPlaceholder/EmptyPlaceholder.tsx +++ b/src/components/EmptyPlaceholder/EmptyPlaceholder.tsx @@ -26,7 +26,9 @@ export const EmptyPlaceholder: React.FC = ({ - Not connected + + Not connected + It's empty here... {desc?.length && {desc}} {withButton && ( diff --git a/src/components/NoConnected/NoConnected.tsx b/src/components/NoConnected/NoConnected.tsx index ec86dfba..622b9242 100644 --- a/src/components/NoConnected/NoConnected.tsx +++ b/src/components/NoConnected/NoConnected.tsx @@ -21,7 +21,9 @@ export const NoConnected: React.FC = ({ onConnect, title, descCust - Not connected + + Not connected + {!!title && {title}} {descCustomText?.length && ( diff --git a/src/containers/SinglePositionWrapper/SinglePositionWrapper.tsx b/src/containers/SinglePositionWrapper/SinglePositionWrapper.tsx index 7d8d1ddd..d5772ce3 100644 --- a/src/containers/SinglePositionWrapper/SinglePositionWrapper.tsx +++ b/src/containers/SinglePositionWrapper/SinglePositionWrapper.tsx @@ -80,6 +80,7 @@ export const SinglePositionWrapper: React.FC = ({ id }) => { const [showFeesLoader, setShowFeesLoader] = useState(true) const [isFinishedDelayRender, setIsFinishedDelayRender] = useState(false) + const [isLoadingListDelay, setIsLoadListDelay] = useState(isLoadingList) const [isClosingPosition, setIsClosingPosition] = useState(false) @@ -392,9 +393,15 @@ export const SinglePositionWrapper: React.FC = ({ id }) => { } useEffect(() => { + if (isFinishedDelayRender) { + return + } + if (walletStatus === Status.Initialized) { + setIsFinishedDelayRender(true) + } const timer = setTimeout(() => { setIsFinishedDelayRender(true) - }, 1000) + }, 1500) return () => { clearTimeout(timer) @@ -402,10 +409,16 @@ export const SinglePositionWrapper: React.FC = ({ id }) => { }, [walletStatus]) useEffect(() => { - if (isFinishedDelayRender) { - setIsFinishedDelayRender(false) + if (!isLoadingList) { + setTimeout(() => { + setIsLoadListDelay(false) + }, 300) + + return () => { + setIsLoadListDelay(true) + } } - }, [walletStatus]) + }, [isLoadingList]) const onRefresh = () => { if (position) { @@ -532,7 +545,8 @@ export const SinglePositionWrapper: React.FC = ({ id }) => { /> ) } - if ((isLoadingList && walletStatus === Status.Initialized) || !isFinishedDelayRender) { + + if ((isLoadingListDelay && walletStatus === Status.Initialized) || !isFinishedDelayRender) { return ( = ({ id }) => { Loading ) - } - if (walletStatus !== Status.Initialized) { + } else if (walletStatus !== Status.Initialized) { return ( = ({ id }) => { /> ) + } else { + return ( + + navigate('/portfolio')} + buttonName='Back to positions' + /> + + ) } - - return ( - - navigate('/portfolio')} - buttonName='Back to positions' - /> - - ) }