useSetWalletModalConfig
Set Modal config for the ConnectWallet
Modal.
This is useful if you want to open the Modal using the useSetIsWalletModalOpen
hook and want to configure the Modal before opening it.
Example
Returns
Function to set the Modal config
The function takes an object with the following properties
title
Title of the Modal
theme
theme to use in Modal
By default it is set to "dark" if theme
is not set on ThirdwebProvider
If a theme
is set on ThirdwebProvider
then that theme will be used by default
theme can be set to either "dark"
or "light"
or a custom theme object. You can also import lightTheme
or darkTheme
functions from @thirdweb-dev/react
to use the default themes as base and overrides parts of it.
modalSize
Set the size of the modal - compact
or wide
on desktop
Modal size is always compact
on mobile
By default it is "wide"
for desktop.
termsOfServiceUrl
URL of the "terms of service" page
If provided, Modal will show a Terms of Service message at the bottom with below link
privacyPolicyUrl
URL of the "privacy policy" page
If provided, Modal will show a Privacy Policy message at the bottom with below link
welcomeScreen
Customize the welcome screen. This is only applicable when modalSize
is set to "wide".
On "wide" Modal size, a welcome screen is shown on the right side of the modal.
This screen can be customized in two ways
1. Customize Metadata and Image
2. Render Custom Component
titleIconUrl
Replace the thirdweb icon next to modalTitle and set your own iconUrl
auth
The object contains the following properties to customize the authentication
loginOptional
- specify whether signing in is optional or not. By default it isfalse
( Sign in is required ) ifauthConfig
is set onThirdwebProvider
onLogin
- Callback to be called after user signs in with their walletonLogout
- Callback to be called after user signs out
onConnect
Callback to be called on successful connection of wallet
Note that this does not include the sign in, If you want to call a callback after user connects AND signs in with their wallet, use auth.onLogin
prop instead