Skip to content

Commit

Permalink
open modal button (#623)
Browse files Browse the repository at this point in the history
* open modal button

* usdc only (#626)
  • Loading branch information
stormcloud266 authored Aug 2, 2024
1 parent c6da08d commit 4be882b
Show file tree
Hide file tree
Showing 5 changed files with 863 additions and 1,276 deletions.
28 changes: 25 additions & 3 deletions apps/next/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import type { AuthProviderProps } from 'app/provider/auth'
import { api } from 'app/utils/api'
import type { NextPage } from 'next'
import Head from 'next/head'
import type { ReactElement, ReactNode } from 'react'
import { useEffect, type ReactElement, type ReactNode } from 'react'
import type { SolitoAppProps } from 'solito'
import { Provider } from 'app/provider'
import { projectId, config as wagmiConfig } from 'app/provider/wagmi/config'
import { createWeb3Modal } from '@web3modal/wagmi/react'
import { createWeb3Modal, useWeb3ModalTheme } from '@web3modal/wagmi/react'
import { baseMainnetClient } from '@my/wagmi'
import { YStack, H1, H2 } from '@my/ui'
import { IconSendLogo } from 'app/components/icons'
Expand All @@ -23,6 +23,23 @@ createWeb3Modal({
wagmiConfig,
projectId,
defaultChain: baseMainnetClient.chain,
themeVariables: {
'--w3m-accent': '#86AE80',
},
tokens: {
8453: {
address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
},
845337: {
address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
},
1: {
address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
},
1337: {
address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
},
},
})

if (process.env.NODE_ENV === 'production') {
Expand All @@ -40,7 +57,12 @@ function MyApp({
// reference: https://nextjs.org/docs/pages/building-your-application/routing/pages-and-layouts
const getLayout = Component.getLayout || ((page) => page)

const [, setTheme] = useRootTheme()
const [theme, setTheme] = useRootTheme()
const { setThemeMode } = useWeb3ModalTheme()

useEffect(() => {
setThemeMode(theme)
}, [theme, setThemeMode])

return (
<>
Expand Down
Loading

0 comments on commit 4be882b

Please sign in to comment.