Skip to content

Commit

Permalink
Merge pull request #158 from ChainSafe/v3.1-updates
Browse files Browse the repository at this point in the history
Extending UI docs
  • Loading branch information
kantagara authored Dec 12, 2024
2 parents cfa1b05 + cee3858 commit c60fbb0
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ cryptographically
Ctrl
Docusaurus
DApp
deactivateOnClick
devs
dev
devsetup
Expand Down Expand Up @@ -120,6 +121,7 @@ Ethereum
EVM
evm-blockchain
extending-the-sdk
extending-ui
faq
fix-namespaces
fullscreen
Expand Down Expand Up @@ -147,6 +149,9 @@ GitHub
github
Goerli's
goerliETH
GuiOverlayManager
GuiScreen
GuiOverlayType
how-tos
HTTPS
HyperPlay
Expand Down Expand Up @@ -367,4 +372,4 @@ Localhost
localhost:8000
https
Brotli
LoginProvider
LoginProvider
40 changes: 40 additions & 0 deletions docs/v2.6/23_extending-ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
slug: /current/extending-ui
sidebar_position: 23
sidebar_label: Extending UI
---

# Extending UI

:::info

This page shows you how to extend UI for the SDK.

:::

To Extend UI for the SDK, you can create your own UI scripts that inherit from `GuiScreen`

## Overlays

There are three overlay types `GuiOverlayManager.GuiOverlayType` available in the SDK:

1. **Error :** Displays an error message.
2. **Loading :** Displays a message with a loading spinner.
3. **Toast :** Displays a toast message with a timeout.

### Usage

To show an overlay, you can call the following method:

```csharp
int GuiManager.Instance.Overlays.Show(GuiOverlayType type, string message, bool deactivateOnClick, Action onClose = null, float timeOut = 0)
```

| **Name** | **Type** | **Description** |
|---------------------|------------------|--------------------------------------------------------------------------------------------------|
| `type` | `GuiOverlayType` | Type of the overlay, it be `Error`, `Loading` or `Toast` |
| `message` | `string` | Message to display in overlay |
| `deactivateOnClick` | `bool` | Can overlay be closed on click |
| `onClose` | `Action` | Callback to be invoked when overlay is closed |
| `timeOut` | `float` | Time in seconds after which overlay should be closed, if it is equal to 0 then it has no timeout |

1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = {
'v2.6/ramp',
'v2.6/lootboxes',
'v2.6/extending-the-sdk',
'v2.6/extending-ui',
],
},
{
Expand Down

0 comments on commit c60fbb0

Please sign in to comment.