From bb5d07ba047c3c7ec781eb73fa002d4fb574c25e Mon Sep 17 00:00:00 2001 From: Tom McGuire Date: Thu, 7 Sep 2023 13:19:45 -0700 Subject: [PATCH] docs: add @celo/rainbowkit-celo usage and remove react-celo (#528) --- docs/adding-new-dapps.md | 49 ++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/docs/adding-new-dapps.md b/docs/adding-new-dapps.md index 46a8c9de..769cea9a 100644 --- a/docs/adding-new-dapps.md +++ b/docs/adding-new-dapps.md @@ -82,28 +82,39 @@ import { Web3Modal } from '@web3modal/react' /> ``` -### [@celo/react-celo - Docs](https://github.com/celo-org/react-celo#default-wallets-and-customization) +### [@celo/rainbowkit-celo - Docs](https://docs.celo.org/developer/rainbowkit-celo) ```JavaScript -import { CeloProvider } from '@celo/react-celo' +// Make sure to use wagmi e.g. 0.12.x or 1.x.x +import { connectorsForWallets } from '@rainbow-me/rainbowkit' +import { publicProvider } from 'wagmi/providers/public' + +const { chains, provider } = configureChains( + [Alfajores, Celo], + [publicProvider()] +) + +const connectors = connectorsForWallets([ + { + groupName: "Recommended with CELO", + wallets: [ + Valora({ chains }), + // Additional wallets here... + ], + }, +]) + +const wagmiClient = createClient({ + autoConnect: true, + connectors, + provider, +}) ... -Connect to Valora, - providersOptions: { - // This should hide all wallets expect for Valora - hideFromDefaults: Object.keys(SupportedProviders).filter(provider => provider !== 'Valora') as SupportedProviders[], - // This option toggles on and off the search bar - searchable: false, - }, - }} -> + + + + + ``` ## FAQs