bigbuffet-rw/app/soapbox/features/crypto-donate/components/site-wallet.tsx

31 lines
727 B
TypeScript
Raw Normal View History

2022-03-25 12:42:04 -07:00
import React from 'react';
2022-03-25 15:47:19 -07:00
import { Stack } from 'soapbox/components/ui';
2022-03-25 12:42:04 -07:00
import { useSoapboxConfig } from 'soapbox/hooks';
2022-11-15 09:23:36 -08:00
import CryptoAddress from './crypto-address';
2022-03-25 12:42:04 -07:00
interface ISiteWallet {
2022-03-25 13:16:05 -07:00
limit?: number,
2022-03-25 12:42:04 -07:00
}
const SiteWallet: React.FC<ISiteWallet> = ({ limit }): JSX.Element => {
const { cryptoAddresses } = useSoapboxConfig();
const addresses = typeof limit === 'number' ? cryptoAddresses.take(limit) : cryptoAddresses;
2022-03-25 12:42:04 -07:00
return (
2022-03-25 15:47:19 -07:00
<Stack space={4}>
{addresses.map(address => (
2022-03-25 12:42:04 -07:00
<CryptoAddress
key={address.ticker}
address={address.address}
ticker={address.ticker}
note={address.note}
2022-03-25 12:42:04 -07:00
/>
))}
2022-03-25 15:47:19 -07:00
</Stack>
2022-03-25 12:42:04 -07:00
);
};
export default SiteWallet;