1
1
import { 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' ;
14
3
import { useForm } from 'react-hook-form' ;
15
4
import { zodResolver } from '@hookform/resolvers/zod' ;
16
5
import WalletDetails from './components/WalletDetails' ;
@@ -21,7 +10,6 @@ import { useBalance } from './hooks/useBalance';
21
10
import { useTransfer } from './hooks/useTransfer' ;
22
11
23
12
function App ( ) {
24
- const { colorMode, toggleColorMode } = useColorMode ( ) ;
25
13
const { walletManager, address, connectWallet } = useWalletManager ( ) ;
26
14
const { balance, refetchBalance } = useBalance ( address , walletManager ) ;
27
15
const transferMutation = useTransfer ( address , walletManager , refetchBalance ) ;
@@ -46,41 +34,43 @@ function App() {
46
34
} , [ walletManager , connectWallet ] ) ;
47
35
48
36
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 >
57
72
</ 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 >
84
74
</ Container >
85
75
) ;
86
76
}
0 commit comments