Skip to content

Commit de28c23

Browse files
Remove web3 modal
1 parent 402342a commit de28c23

File tree

7 files changed

+14
-83
lines changed

7 files changed

+14
-83
lines changed

apps/next/pages/_app.tsx

+2-34
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import '../public/reset.css'
22
import '../styles/globals.css'
3-
43
import 'raf/polyfill'
54
import '@my/ui/src/config/fonts.css'
65

@@ -10,38 +9,12 @@ import type { AuthProviderProps } from 'app/provider/auth'
109
import { api } from 'app/utils/api'
1110
import type { NextPage } from 'next'
1211
import Head from 'next/head'
13-
import { useEffect, type ReactElement, type ReactNode } from 'react'
12+
import type { ReactElement, ReactNode } from 'react'
1413
import type { SolitoAppProps } from 'solito'
1514
import { Provider } from 'app/provider'
16-
import { projectId, config as wagmiConfig } from 'app/provider/wagmi/config'
17-
import { createWeb3Modal, useWeb3ModalTheme } from '@web3modal/wagmi/react'
18-
import { baseMainnetClient } from '@my/wagmi'
1915
import { YStack, H1, H2 } from '@my/ui'
2016
import { IconSendLogo } from 'app/components/icons'
2117

22-
createWeb3Modal({
23-
wagmiConfig,
24-
projectId,
25-
defaultChain: baseMainnetClient.chain,
26-
themeVariables: {
27-
'--w3m-accent': '#86AE80',
28-
},
29-
tokens: {
30-
8453: {
31-
address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
32-
},
33-
845337: {
34-
address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
35-
},
36-
1: {
37-
address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
38-
},
39-
1337: {
40-
address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
41-
},
42-
},
43-
})
44-
4518
if (process.env.NODE_ENV === 'production') {
4619
require('../public/tamagui.css')
4720
}
@@ -57,12 +30,7 @@ function MyApp({
5730
// reference: https://nextjs.org/docs/pages/building-your-application/routing/pages-and-layouts
5831
const getLayout = Component.getLayout || ((page) => page)
5932

60-
const [theme, setTheme] = useRootTheme()
61-
const { setThemeMode } = useWeb3ModalTheme()
62-
63-
useEffect(() => {
64-
setThemeMode(theme)
65-
}, [theme, setThemeMode])
33+
const [, setTheme] = useRootTheme()
6634

6735
return (
6836
<>

packages/app/features/auth/account-recovery/eoa/RecoverWithEOA.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
import { Button, ButtonText } from '@my/ui'
88
import type { SignMessageErrorType } from '@wagmi/core'
99
import type { SignState } from 'app/features/auth/account-recovery/account-recovery'
10-
import { OpenConnectModalWrapper } from 'app/utils/OpenConnectModalWrapper'
1110
import { useAccount, useSignMessage } from 'wagmi'
1211
import type { SignMessageData, SignMessageVariables } from 'wagmi/query'
1312

@@ -48,10 +47,8 @@ export default function RecoverWithEOA(props: Props) {
4847
}
4948

5049
return (
51-
<OpenConnectModalWrapper width={'50%'}>
52-
<Button onPress={isConnected ? onPress : null} theme="green" br="$4">
53-
<ButtonText testID="account-recovery-eoa-btn">EOA</ButtonText>
54-
</Button>
55-
</OpenConnectModalWrapper>
50+
<Button onPress={isConnected ? onPress : null} theme="green" br="$4">
51+
<ButtonText testID="account-recovery-eoa-btn">EOA</ButtonText>
52+
</Button>
5653
)
5754
}

packages/app/jest.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ const config: Config = {
156156

157157
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
158158
transformIgnorePatterns: [
159-
'node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|moti|sentry-expo|native-base|react-native-svg|solito|@web3modal|@web3modal/*|@wagmi|wagmi/*|viem|viem/*|@tamagui/animations-moti)',
159+
'node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|moti|sentry-expo|native-base|react-native-svg|solito|@tamagui/animations-moti)',
160160
],
161161

162162
moduleNameMapper: {

packages/app/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"@wagmi/chains": "^1.8.0",
4040
"@wagmi/connectors": "^5.1.1",
4141
"@wagmi/core": "^2.13.1",
42-
"@web3modal/wagmi": "^5.0.2",
4342
"base64-arraybuffer": "^1.0.2",
4443
"burnt": "^0.12.1",
4544
"cbor": "^9.0.1",

packages/app/provider/wagmi/WagmiProvider.native.tsx

-12
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import type { FC, ReactNode } from 'react'
21
import { WagmiProvider as OGWagmiProvider } from 'wagmi'
3-
import { projectId, config } from './config'
4-
5-
if (!projectId) throw new Error('Project ID is not defined')
2+
import { config } from '@my/wagmi'
3+
import type { FC, ReactNode } from 'react'
64

75
export const WagmiProvider: FC<{ children: ReactNode }> = ({
86
children,
@@ -11,3 +9,9 @@ export const WagmiProvider: FC<{ children: ReactNode }> = ({
119
}) => {
1210
return <OGWagmiProvider config={config}>{children}</OGWagmiProvider>
1311
}
12+
13+
declare module 'wagmi' {
14+
interface Register {
15+
config: typeof config
16+
}
17+
}

packages/app/provider/wagmi/config.ts

-25
This file was deleted.

0 commit comments

Comments
 (0)