From 55238ac1ec7f1fda4d2c05bfeaebb27da021f3ba Mon Sep 17 00:00:00 2001 From: "f.schoenknecht" Date: Fri, 6 Dec 2024 16:39:54 +0000 Subject: [PATCH] GITBOOK-45: refactor: modal --- getting-started/implementation-guide/modal.md | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/getting-started/implementation-guide/modal.md b/getting-started/implementation-guide/modal.md index a3f20dd..134ab1b 100644 --- a/getting-started/implementation-guide/modal.md +++ b/getting-started/implementation-guide/modal.md @@ -17,7 +17,7 @@ icon: square-code ### The TConnectModalProvider -The TConnectModalProvider has six options: +The TConnectModalProvider has eight properties: ```typescript // API-key to get access to our service @@ -43,11 +43,6 @@ appName: string; appUrl: string; ``` -```typescript -// Optional ReactNode to be rendered as the content of the provider. -children?: ReactNode | undefined; -``` - ```typescript // Optional URL for the application icon appIcon?: string; @@ -55,16 +50,19 @@ appIcon?: string; ```typescript // Optional array to specify which networks to filter or allow +// Default: etherlink and tezos networkFilter?: Array<'etherlink' | 'tezos'>; ``` ```typescript // Optional configuration for the Tezos Beacon network +// Default: Mainnet tezosBeaconNetwork?: TezosBeaconNetwork; ``` ```typescript // Optional configuration for the Tezos WalletConnect network +// Default: Mainnet tezosWcNetwork?: TezosWcNetwork; ``` @@ -102,20 +100,25 @@ npm install @tconnect.io/modal {% step %} #### Setup the Modal Provider -We recommend first providing the TConnectModalProvider, for example in `Layout.tsx.` +We recommend first providing the TConnectModalProvider, for example in `App.tsx.` ```typescript -import { TConnectModalProvider } from '@tconnect.io/modal'; -import { App } from './pages/App'; - - - - +import { TConnectModalProvider } from "@tconnect.io/modal"; +import { MyComponent } from "./MyComponent"; + +export default function App() { + return ( + + + + ); +} + ``` {% endstep %} @@ -125,16 +128,13 @@ import { App } from './pages/App'; Now, within the provider, in this example in the `App` component, the `openModal` method can be called to display the modal for wallet selection. ```typescript -import { useTConnectModal } from '@tconnect.io/modal'; +import { useTConnectModal } from "@tconnect.io/modal"; -export const App = () => { - const tConnect = useTConnectModal(); - return ( - - ); +export const MyComponent = () => { + const tConnect = useTConnectModal(); + return ; }; -App.displayName = 'App'; ``` {% endstep %} {% endstepper %} @@ -145,7 +145,7 @@ App.displayName = 'App'; {% step %} #### Blockchain Selection -The modal first provides the option to choose the blockchain to be used. The user can select between Tezos or Etherlink. +The modal first provides the option to choose the blockchain to be used. The user can select between Tezos and Etherlink. {% endstep %} @@ -169,13 +169,13 @@ Once a wallet is selected, the user is redirected to the wallet and prompted to {% step %} #### Connection Established -After a successful connection, the modal closes, and the developer get the provider from the Modal Hook. +After a successful connection, the modal closes, and the developer gets the provider from the modal hook. {% endstep %} {% step %} #### Disconnection -If connection is established, you can open the modal and disconnect +If connection is established, you can open the modal and disconnect. {% endstep %}