committed by
GitHub
18 changed files with 198 additions and 53 deletions
@ -0,0 +1 @@ |
|||
%÷_×U›“�]ÿv@cz¸ìáSÆRJ£ƒ®ºÕo–¤o{ø³ôâT¸&hìö‡ÜƬu_ÏÖ¬÷œh*(÷èBBm^ö[6ÅNm»IÇ+댵[cm‹ £GºjëuC¸òó>Áx…A´¼L¯Ccx¨ÎZEåÞX#ßz…´}øÒÚ€œlA*Áº}"Ú¬ˆIü¥pµ`�ólr=BþÙ³¯ôT7_)DÓpÃ,k�TÑRór–‚T“ÖA¡$ìÕ¯šÎ¨ žÜ^¯¯ÙVSA�+Ñ“‡Â”Íò^F¶\=¿ÑU^H{÷€KŠ/ ,‰¥Ã¨(ŸñEß#8KO†Ðɨ–è×¹ |
Binary file not shown.
@ -0,0 +1,49 @@ |
|||
import { CheckIcon, CopyIcon } from "@chakra-ui/icons"; |
|||
import { Box, Center, Divider, HStack, IconButton, Skeleton, Text, useClipboard } from "@chakra-ui/react"; |
|||
import React from "react"; |
|||
import { unixTimestampToDate, WalletInfo } from "./Types"; |
|||
|
|||
interface WalletProps { |
|||
walletInfo: WalletInfo | null; |
|||
} |
|||
|
|||
export default function Wallet( |
|||
{ |
|||
walletInfo, |
|||
}: WalletProps, |
|||
) { |
|||
const { hasCopied, onCopy } = useClipboard(walletInfo ? walletInfo.address : ""); |
|||
|
|||
let balance = <Skeleton height="20px" />; |
|||
let address = <Skeleton height="20px" />; |
|||
let timestamp = <Skeleton height="20px" />; |
|||
|
|||
if (walletInfo) { |
|||
balance = <Text>{walletInfo.balance} BTC</Text>; |
|||
address = ( |
|||
<HStack> |
|||
<Text>{walletInfo.address}</Text> |
|||
<IconButton |
|||
aria-label="Copy to clipboard" |
|||
icon={hasCopied ? <CheckIcon /> : <CopyIcon />} |
|||
onClick={onCopy} |
|||
/> |
|||
</HStack> |
|||
); |
|||
timestamp = <Text>{unixTimestampToDate(walletInfo.last_updated_at).toString()}</Text>; |
|||
} |
|||
|
|||
return ( |
|||
<Box shadow={"md"} marginBottom={5} padding={5}> |
|||
<Center><Text fontWeight={"bold"}>Your wallet</Text></Center> |
|||
<HStack> |
|||
<Text align={"left"}>Balance:</Text> |
|||
{balance} |
|||
</HStack> |
|||
<Divider marginTop={2} marginBottom={2} /> |
|||
{address} |
|||
<Divider marginTop={2} marginBottom={2} /> |
|||
{timestamp} |
|||
</Box> |
|||
); |
|||
} |
Loading…
Reference in new issue