Skip to content

Commit

Permalink
feat: display tx header when there is no txs
Browse files Browse the repository at this point in the history
  • Loading branch information
MonikaCat committed Feb 27, 2024
1 parent 642b566 commit 8da175b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import AutoSizer from 'react-virtualized-auto-sizer';
import { VariableSizeGrid as Grid } from 'react-window';
import InfiniteLoader from 'react-window-infinite-loader';
import FilterTxsByType from '@/components/transaction_type_filter';
import NoData from '@/components/no_data';

const useRenderHeaderCell = ({
columnIndex,
Expand Down Expand Up @@ -87,6 +88,14 @@ const Desktop: FC<TransactionsListState> = ({
// Default isItemLoaded function
const defaultIsItemLoaded = () => true;

// Render NoData component if itemCount is 0
const noDataComponent =
itemCount === 0 ? (
<div className={classes.noData}>

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-archway)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-agoric)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-akash)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-assetmantle)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-band)

Property 'noData' does not exist on type 'Record<"body" | "root" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-bitsong)

Property 'noData' does not exist on type 'Record<"body" | "root" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-cheqd)

Property 'noData' does not exist on type 'Record<"root" | "cell" | "body", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-comdex)

Property 'noData' does not exist on type 'Record<"root" | "cell" | "body", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-coreum)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-emoney)

Property 'noData' does not exist on type 'Record<"root" | "cell" | "body", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-evmos)

Property 'noData' does not exist on type 'Record<"body" | "root" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-desmos)

Property 'noData' does not exist on type 'Record<"body" | "root" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-cosmos)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-humansai)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-crescent)

Property 'noData' does not exist on type 'Record<"body" | "root" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-gitopia)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-jackal)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-likecoin)

Property 'noData' does not exist on type 'Record<"body" | "root" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-kyve)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-persistence)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-nym)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-osmosis)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-neutron)

Property 'noData' does not exist on type 'Record<"root" | "cell" | "body", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-regen)

Property 'noData' does not exist on type 'Record<"body" | "root" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-quicksilver)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-quasar)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-provenance)

Property 'noData' does not exist on type 'Record<"root" | "cell" | "body", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-wormhole)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-stride)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.

Check failure on line 94 in packages/ui/src/components/transactions_list/components/desktop/index.tsx

View workflow job for this annotation

GitHub Actions / ts-lint-build (web-rizon)

Property 'noData' does not exist on type 'Record<"root" | "body" | "cell", string>'.
<NoData />
</div>
) : null;

return (
<div className={cx(classes.root, className)}>
<AutoSizer onResize={onResize}>
Expand Down Expand Up @@ -177,6 +186,7 @@ const Desktop: FC<TransactionsListState> = ({
</>
)}
</AutoSizer>
{noDataComponent}
</div>
);
};
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/components/transactions_list/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { FC } from 'react';
import Loading from '@/components/loading';
import NoData from '@/components/no_data';
import Desktop from '@/components/transactions_list/components/desktop';
import Mobile from '@/components/transactions_list/components/mobile';
import type { TransactionsListState } from '@/components/transactions_list/types';
Expand Down Expand Up @@ -30,7 +29,7 @@ const TransactionsList: FC<TransactionsListState> = (props) => {
};

if (!itemCount) {
return isNextPageLoading ? <Loading /> : <NoData />;
if (isNextPageLoading) return <Loading />;
}

return (
Expand Down

0 comments on commit 8da175b

Please sign in to comment.