Skip to content

Commit

Permalink
feat: add connect btn
Browse files Browse the repository at this point in the history
  • Loading branch information
alter-eggo committed Oct 18, 2023
1 parent 618923f commit 3903ba1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/app/components/crypto-assets/components/asset-row-grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,28 @@ interface AssetRowGridProps {
balance: React.ReactNode;
caption: React.ReactNode;
usdBalance?: React.ReactNode;
connectBtn?: React.ReactNode;
}
export function AssetRowGrid({ title, balance, caption, usdBalance }: AssetRowGridProps) {
export function AssetRowGrid({
title,
balance,
caption,
usdBalance,
connectBtn,
}: AssetRowGridProps) {
const balanceItem = connectBtn ? (
<GridItem rowSpan={2} display="flex" justifyContent="end">
{connectBtn}
</GridItem>
) : (
<GridItem textAlign="right">{balance}</GridItem>
);
return (
<Grid columns={2} gridTemplateColumns="2fr 1fr" gridTemplateRows={2} gap={0}>
<GridItem textAlign="left" whiteSpace="nowrap" overflow="hidden" textOverflow="ellipsis">
{title}
</GridItem>
<GridItem textAlign="right">{balance}</GridItem>
{balanceItem}
<GridItem textAlign="left">{caption}</GridItem>
{usdBalance && <GridItem>{usdBalance}</GridItem>}
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export const CryptoCurrencyAssetItemLayout = forwardRefWithAs(
{additionalUsdBalanceInfo}
</Flex>
}
connectBtn={connectBtn}
/>
</Flag>
{component}
Expand Down

0 comments on commit 3903ba1

Please sign in to comment.