Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarify docs #166

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions sdk/apps/docs/docs/customization/external_modal.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,17 @@ const adapter = await NightlyConnectAdapter.build(
appInitData,
{ disableModal: true } // ensures that the default modal will be disabled
)
```

Now you can define and instantiate your own modal and use the adapter to provide any necessary logic.

:::info

The example below shows the process using the `NightlyConnectSelectorModal`, but the code may look different, depending on the underlying code in your modal of choice.

:::

```js
// creates a new modal
const modal = new NightlyConnectSelectorModal(
adapter.walletsList,
Expand All @@ -42,15 +52,15 @@ const modal = new NightlyConnectSelectorModal(
)

// we can also use events to determine,
// what the current state of the app and react accordingly
// what the current state of the app is, and react accordingly
adapter.on('connect', (pk) => {
modal.closeModal()
})
```

The code described above sets up the adapter and the modal for later use.

To connect using custom modal, we can run:
To connect, we can run:

```js
if (modal)
Expand Down
2 changes: 1 addition & 1 deletion sdk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading