Skip to content

Commit

Permalink
ui: add footnote about germinating deposits
Browse files Browse the repository at this point in the history
  • Loading branch information
0xalecks committed Apr 17, 2024
1 parent a6e44d1 commit ad95910
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 10 deletions.
14 changes: 14 additions & 0 deletions projects/ui/src/components/Common/TableCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export type TableCardProps = {
/** disable border */
maxRows?: number;
hideFooter?: true | undefined;
footNote?: string | undefined;
};

interface GridRowParams<R extends GridRowModel = GridRowModel> {
Expand Down Expand Up @@ -85,6 +86,7 @@ const TableCard: FC<TableCardProps> = ({
tableCss,
maxRows = 5,
hideFooter = false,
footNote,
}) => {
const tableHeight = useMemo(() => {
if (!rows || rows.length === 0) return '250px';
Expand Down Expand Up @@ -179,6 +181,18 @@ const TableCard: FC<TableCardProps> = ({
getRowClassName={customRowStyler}
/>
</Box>
{footNote && (
<Box
sx={{
pt: 0.5,
px: 2,
pb: 1,
color: 'text.tertiary',
}}
>
*{footNote}
</Box>
)}
</Card>
);
};
Expand Down
29 changes: 19 additions & 10 deletions projects/ui/src/components/Silo/Actions/Deposits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ const Deposits: FC<
[siloBalance?.deposited.crates, deltaStem, decimalShift]
);

const hasGerminating = !!rows.find((r) => r.isGerminating);

const columns = useMemo(
() =>
[
Expand Down Expand Up @@ -185,16 +187,23 @@ const Deposits: FC<
const state = !account ? 'disconnected' : 'ready';

return (
<TableCard
title={`${token.name} Deposits`}
rows={rows}
columns={columns}
amount={amount}
value={getUSD(token, amount || ZERO_BN)}
state={state}
token={token}
{...props}
/>
<>
<TableCard
title={`${token.name} Deposits`}
rows={rows}
columns={columns}
amount={amount}
value={getUSD(token, amount || ZERO_BN)}
state={state}
token={token}
footNote={
hasGerminating
? 'Green rows represent germinating deposits'
: undefined
}
{...props}
/>
</>
);
};

Expand Down

0 comments on commit ad95910

Please sign in to comment.