Skip to content

Commit b8b0e73

Browse files
committed
chore: update integrate-capsule docs
1 parent 457e4d1 commit b8b0e73

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

docs/docs/guides/integrate-capsule.md

+31-5
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,60 @@ yarn add @leapwallet/cosmos-social-login-capsule-provider-ui
2020
/>
2121
```
2222

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+
2340
## Next JS Usage
2441

2542
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.
2643

2744
```javascript
45+
import "@leapwallet/cosmos-social-login-capsule-provider-ui/styles.css";
46+
2847
const LeapSocialLogin = dynamic(
2948
() => import("@leapwallet/cosmos-social-login-capsule-provider-ui").then((m) => m.CustomCapsuleModalView),
3049
{ ssr: false },
3150
);
3251

52+
const TransactionSigningModal = dynamic(
53+
() => import("@leapwallet/cosmos-social-login-capsule-provider-ui").then((m) => m.TransactionSigningModal),
54+
{ ssr: false },
55+
);
56+
3357
const HomePage = () => {
3458
const { client, modalState, onAfterLoginSuccessful, setModalState, onLoginFailure } = useCapsule();
3559

36-
return (
37-
<div>
60+
return client ? (
61+
<div className="leap-ui">
3862
<LeapSocialLogin
39-
capsule={client?.getClient() || undefined}
63+
capsule={client.getClient()}
64+
oAuthMethods={["GOOGLE", "FACEBOOK", "TWITTER", "DISCORD", "APPLE"]}
4065
onAfterLoginSuccessful={() => {
41-
onAfterLoginSuccessful?.();
66+
void onAfterLoginSuccessful?.();
4267
}}
4368
onLoginFailure={() => {
4469
onLoginFailure();
4570
}}
4671
setShowCapsuleModal={setModalState}
4772
showCapsuleModal={modalState}
4873
/>
74+
<TransactionSigningModal dAppInfo={{ name: "Graz Example" }} />
4975
</div>
50-
);
76+
) : null;
5177
};
5278
```
5379

0 commit comments

Comments
 (0)