11import { useEffect } from 'react' ;
2- import {
3- Box ,
4- Button ,
5- Container ,
6- VStack ,
7- useColorMode ,
8- IconButton ,
9- Heading ,
10- Card ,
11- CardBody ,
12- } from '@chakra-ui/react' ;
13- import { SunIcon , MoonIcon } from '@chakra-ui/icons' ;
2+ import { Button , Container , Stack , Text , Box } from '@interchain-ui/react' ;
143import { useForm } from 'react-hook-form' ;
154import { zodResolver } from '@hookform/resolvers/zod' ;
165import WalletDetails from './components/WalletDetails' ;
@@ -21,7 +10,6 @@ import { useBalance } from './hooks/useBalance';
2110import { useTransfer } from './hooks/useTransfer' ;
2211
2312function App ( ) {
24- const { colorMode, toggleColorMode } = useColorMode ( ) ;
2513 const { walletManager, address, connectWallet } = useWalletManager ( ) ;
2614 const { balance, refetchBalance } = useBalance ( address , walletManager ) ;
2715 const transferMutation = useTransfer ( address , walletManager , refetchBalance ) ;
@@ -46,41 +34,43 @@ function App() {
4634 } , [ walletManager , connectWallet ] ) ;
4735
4836 return (
49- < Container maxW = "container.sm" py = { 8 } >
50- < VStack spacing = { 6 } align = "stretch" >
51- < Box display = "flex" justifyContent = "flex-end" >
52- < IconButton
53- aria-label = "Toggle color mode"
54- icon = { colorMode === 'light' ? < MoonIcon /> : < SunIcon /> }
55- onClick = { toggleColorMode }
56- />
37+ < Container
38+ maxWidth = '$containerSm'
39+ attributes = { { paddingTop : '$8' } }
40+ >
41+ < Stack
42+ direction = 'vertical'
43+ space = '$6'
44+ align = "stretch"
45+ >
46+ < Box >
47+ < Stack
48+ direction = 'vertical'
49+ space = '$6'
50+ align = "stretch"
51+ >
52+ < Text as = 'h1' fontSize = '$10xl' > Cosmos Wallet</ Text >
53+ { ! address ? (
54+ < Button onClick = { connectWallet } > Connect Keplr</ Button >
55+ ) : (
56+ < >
57+ < WalletDetails
58+ address = { address }
59+ balance = { balance ?? '0' }
60+ onRefresh = { refetchBalance }
61+ />
62+ < TransferForm
63+ register = { register }
64+ errors = { errors }
65+ handleSubmit = { handleSubmit }
66+ onSubmit = { onSubmit }
67+ isLoading = { transferMutation . isMutating }
68+ />
69+ </ >
70+ ) }
71+ </ Stack >
5772 </ Box >
58- < Card >
59- < CardBody >
60- < VStack spacing = { 4 } align = "stretch" >
61- < Heading size = "md" > Cosmos Wallet</ Heading >
62- { ! address ? (
63- < Button onClick = { connectWallet } > Connect Keplr</ Button >
64- ) : (
65- < >
66- < WalletDetails
67- address = { address }
68- balance = { balance ?? '0' }
69- onRefresh = { refetchBalance }
70- />
71- < TransferForm
72- register = { register }
73- errors = { errors }
74- handleSubmit = { handleSubmit }
75- onSubmit = { onSubmit }
76- isLoading = { transferMutation . isMutating }
77- />
78- </ >
79- ) }
80- </ VStack >
81- </ CardBody >
82- </ Card >
83- </ VStack >
73+ </ Stack >
8474 </ Container >
8575 ) ;
8676}
0 commit comments