Skip to content

Commit

Permalink
fix: wallets rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaccoSordo committed Jan 10, 2025
1 parent b7b92fe commit 7811024
Showing 1 changed file with 33 additions and 21 deletions.
54 changes: 33 additions & 21 deletions packages/beacon-ui/src/components/wallets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,40 @@ interface WalletProps {
}

const Wallets: React.FC<WalletProps> = (props: WalletProps) => {
const wallets = props.wallets.map((wallet) => (
<Wallet
key={wallet.id}
disabled={props.disabled}
name={wallet.name}
description={wallet.descriptions.join(' & ')}
image={wallet.image}
small={props.small}
onClick={() => {
props.onClickWallet(wallet.id)
}}
/>
))
const groupedElements = []

for (let i = 0; i < wallets.length; i += 4) {
groupedElements.push(wallets.slice(i, i + 4))
}

return (
<Grid2
container
rowSpacing={1}
columnSpacing={{ xs: 1, sm: 2, md: 3 }}
justifyContent={'center'}
padding={'10px'}
>
{props.wallets.map((wallet) => (
<Wallet
key={wallet.id}
disabled={props.disabled}
name={wallet.name}
description={wallet.descriptions.join(' & ')}
image={wallet.image}
small={props.small}
onClick={() => {
props.onClickWallet(wallet.id)
}}
/>
))}
<Button onClick={props.onClickOther} variant='contained' size='large'>
<Grid2 container sx={{ justifyContent: 'center' }}>
<Grid2 container spacing={2} sx={{ flexFlow: 'column', padding: '20px' }}>
{groupedElements.map((group, groupIndex) => (
<Grid2 container spacing={2} key={groupIndex}>
{group.map((item, itemIndex) => (
<Grid2 size={3} key={itemIndex}>
{/* Replace this with your content for each item */}
{item}
</Grid2>
))}
</Grid2>
))}
</Grid2>
<Button onClick={props.onClickOther} variant="outlined" sx={{ width: '100%' }}>
{props.isMobile ? 'Pair wallet on another device' : 'Show QR code'}
</Button>
</Grid2>
Expand Down

0 comments on commit 7811024

Please sign in to comment.