diff --git a/src/components/atoms/Table.tsx b/src/components/atoms/Table.tsx index 2aa98832a..8665d4709 100644 --- a/src/components/atoms/Table.tsx +++ b/src/components/atoms/Table.tsx @@ -3,6 +3,7 @@ import DataTable, { IDataTableProps } from 'react-data-table-component' import Loader from './Loader' import Pagination from '../molecules/Pagination' import styles from './Table.module.css' +import { useUserPreferences } from '../../providers/UserPreferences' interface TableProps extends IDataTableProps { isLoading?: boolean @@ -13,7 +14,14 @@ interface TableProps extends IDataTableProps { } function Empty({ message }: { message?: string }): ReactElement { - return
{message || 'No results found'}
+ const { chainIds } = useUserPreferences() + return ( +
+ {chainIds.length === 0 + ? 'No network selected' + : message || 'No results found'} +
+ ) } export default function Table({ diff --git a/src/components/organisms/AssetList.tsx b/src/components/organisms/AssetList.tsx index 3368163bf..024f47c78 100644 --- a/src/components/organisms/AssetList.tsx +++ b/src/components/organisms/AssetList.tsx @@ -68,7 +68,11 @@ const AssetList: React.FC = ({ [className]: className }) - return assetsWithPrices && + return chainIds.length === 0 ? ( +
+
No network selected
+
+ ) : assetsWithPrices && !loading && (isLoading === undefined || isLoading === false) ? ( <> @@ -82,10 +86,8 @@ const AssetList: React.FC = ({ noPublisher={noPublisher} /> )) - ) : chainIds.length === 0 ? ( -
No network selected.
) : ( -
No results found.
+
No results found
)} diff --git a/src/components/pages/Profile/History/PoolShares.tsx b/src/components/pages/Profile/History/PoolShares.tsx index 78e836ea8..a9d0e5602 100644 --- a/src/components/pages/Profile/History/PoolShares.tsx +++ b/src/components/pages/Profile/History/PoolShares.tsx @@ -165,6 +165,7 @@ export default function PoolShares({ const [loading, setLoading] = useState(false) const [dataFetchInterval, setDataFetchInterval] = useState() const newCancelToken = useCancelToken() + const fetchPoolSharesAssets = useCallback( async (cancelToken: CancelToken) => { if (!poolShares || isPoolSharesLoading) return