1
- import { Center , HStack , Spacer , Stack , Text , useColorMode } from "@chakra-ui/react" ;
2
- import { useAccount , useCapsule } from "graz" ;
1
+ import "@leapwallet/cosmos-social-login-capsule-provider-ui/styles.css" ;
2
+
3
+ import { Center , HStack , Spacer , Stack , Text } from "@chakra-ui/react" ;
4
+ import { useAccount } from "graz" ;
3
5
import type { NextPage } from "next" ;
4
- import dynamic from "next/dynamic" ;
5
6
import { BalanceList } from "ui/balance-list" ;
7
+ import CapsuleModals from "ui/capsule-modals" ;
6
8
import { ChainSwitcher } from "ui/chain-switcher" ;
7
9
import { ConnectButton } from "ui/connect-button" ;
8
10
import { ConnectStatus } from "ui/connect-status" ;
9
11
import { ToggleTheme } from "ui/toggle-theme" ;
10
- import "@leapwallet/cosmos-social-login-capsule-provider-ui/styles.css" ;
11
-
12
- const LeapSocialLogin = dynamic (
13
- ( ) => import ( "@leapwallet/cosmos-social-login-capsule-provider-ui" ) . then ( ( m ) => m . CustomCapsuleModalView ) ,
14
- { ssr : false } ,
15
- ) ;
16
12
17
13
const HomePage : NextPage = ( ) => {
18
14
const { data : accountData } = useAccount ( {
19
15
chainId : "cosmoshub-4" ,
20
16
} ) ;
21
- const { client, modalState, onAfterLoginSuccessful, setModalState, onLoginFailure } = useCapsule ( ) ;
22
- const { colorMode } = useColorMode ( ) ;
17
+
23
18
return (
24
19
< Center minH = "100vh" >
25
20
< Stack bgColor = "whiteAlpha.100" boxShadow = "md" maxW = "md" p = { 4 } rounded = "md" spacing = { 4 } w = "full" >
@@ -45,22 +40,7 @@ const HomePage: NextPage = () => {
45
40
< ConnectButton />
46
41
</ HStack >
47
42
</ Stack >
48
- < div className = 'leap-ui' >
49
- < LeapSocialLogin
50
- capsule = { client ?. getClient ( ) || undefined }
51
- // @ts -expect-error - type error
52
- oAuthMethods = { [ "GOOGLE" , "FACEBOOK" , "TWITTER" , "DISCORD" , "APPLE" ] }
53
- onAfterLoginSuccessful = { ( ) => {
54
- void onAfterLoginSuccessful ?.( ) ;
55
- } }
56
- onLoginFailure = { ( ) => {
57
- onLoginFailure ( ) ;
58
- } }
59
- setShowCapsuleModal = { setModalState }
60
- showCapsuleModal = { modalState }
61
- theme = { colorMode }
62
- />
63
- </ div >
43
+ < CapsuleModals />
64
44
</ Center >
65
45
) ;
66
46
} ;
0 commit comments