Skip to content

Commit

Permalink
feat: add empty My Orders table description for unconnected state
Browse files Browse the repository at this point in the history
  • Loading branch information
dib542 committed Jun 3, 2024
1 parent 6a9c9d6 commit b17415f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default function Table<
getRowKey,
context,
rowDescription = 'Data',
messageOnEmptyData,
filtered = false,
}: {
className?: string;
Expand All @@ -27,6 +28,7 @@ export default function Table<
getRowKey?: (row: DataRow) => string | number;
context: Context;
rowDescription?: string;
messageOnEmptyData?: ReactNode;
filtered?: boolean;
}) {
if (columns.length !== headings.length) {
Expand Down Expand Up @@ -85,9 +87,11 @@ export default function Table<
<tr>
<td colSpan={columns.length}>
{data ? (
<>
No {filtered ? 'Matching' : ''} {rowDescription} Found
</>
messageOnEmptyData || (
<>
No {filtered ? 'Matching' : ''} {rowDescription} Found
</>
)
) : (
<>Loading...</>
)}
Expand Down
1 change: 1 addition & 0 deletions src/pages/Orderbook/OrderbookFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ function OrderbookFooterTable({
filterToStatus,
}}
rowDescription="Orders"
messageOnEmptyData={!address && 'Connect wallet to see your orders'}
/>
);
}
Expand Down

0 comments on commit b17415f

Please sign in to comment.