@@ -20,34 +20,60 @@ yarn add @leapwallet/cosmos-social-login-capsule-provider-ui
20
20
/ >
21
21
```
22
22
23
+ ## Add the stylesheets from ` @leapwallet/cosmos-social-login-capsule-provider-ui ` and add ` leap-ui ` class to parent container of imported Modals.
24
+
25
+ This will ensure proper styling and you will be able to customize the modals using css-variables.
26
+
27
+ ``` javascript
28
+ import " @leapwallet/cosmos-social-login-capsule-provider-ui/styles.css" ;
29
+
30
+ < div className= " leap-ui" >
31
+ < LeapSocialLogin
32
+ // params
33
+ / >
34
+ < TransactionSigningModal
35
+ // params
36
+ / >
37
+ < / div> ;
38
+ ```
39
+
23
40
## Next JS Usage
24
41
25
42
For Next JS we recommend to load the module dynamically to avoid SSR issues. And use ` useCapsule ` hook to get the client and other capsule related states.
26
43
27
44
``` javascript
45
+ import " @leapwallet/cosmos-social-login-capsule-provider-ui/styles.css" ;
46
+
28
47
const LeapSocialLogin = dynamic (
29
48
() => import (" @leapwallet/cosmos-social-login-capsule-provider-ui" ).then ((m ) => m .CustomCapsuleModalView ),
30
49
{ ssr: false },
31
50
);
32
51
52
+ const TransactionSigningModal = dynamic (
53
+ () => import (" @leapwallet/cosmos-social-login-capsule-provider-ui" ).then ((m ) => m .TransactionSigningModal ),
54
+ { ssr: false },
55
+ );
56
+
33
57
const HomePage = () => {
34
58
const { client , modalState , onAfterLoginSuccessful , setModalState , onLoginFailure } = useCapsule ();
35
59
36
- return (
37
- < div>
60
+ return client ? (
61
+ < div className = " leap-ui " >
38
62
< LeapSocialLogin
39
- capsule= {client? .getClient () || undefined }
63
+ capsule= {client .getClient ()}
64
+ oAuthMethods= {[" GOOGLE" , " FACEBOOK" , " TWITTER" , " DISCORD" , " APPLE" ]}
40
65
onAfterLoginSuccessful= {() => {
41
- onAfterLoginSuccessful? .();
66
+ void onAfterLoginSuccessful? .();
42
67
}}
43
68
onLoginFailure= {() => {
44
69
onLoginFailure ();
45
70
}}
46
71
setShowCapsuleModal= {setModalState}
47
72
showCapsuleModal= {modalState}
48
73
/ >
74
+ < TransactionSigningModal dAppInfo= {{ name: " Graz Example" }} / >
49
75
< / div>
50
- );
76
+ ) : null ;
51
77
};
52
78
` ` `
53
79
0 commit comments