@@ -6,6 +6,7 @@ import { configureChains, createConfig, WagmiConfig } from "wagmi";
6
6
import { arbitrumGoerli , gnosisChiado } from "wagmi/chains" ;
7
7
import { publicProvider } from "wagmi/providers/public" ;
8
8
import { useToggleTheme } from "hooks/useToggleThemeContext" ;
9
+ import { useTheme } from "styled-components" ;
9
10
10
11
const chains = [ arbitrumGoerli , gnosisChiado ] ;
11
12
const projectId = process . env . WALLETCONNECT_PROJECT_ID ?? "6efaa26765fa742153baf9281e218217" ;
@@ -24,11 +25,23 @@ const wagmiConfig = createConfig({
24
25
const ethereumClient = new EthereumClient ( wagmiConfig , chains ) ;
25
26
26
27
const Web3Provider : React . FC < { children : React . ReactNode } > = ( { children } ) => {
27
- const [ theme ] = useToggleTheme ( ) ;
28
+ const [ themeToggle ] = useToggleTheme ( ) ;
29
+ const theme = useTheme ( ) ;
28
30
return (
29
31
< >
30
32
< WagmiConfig config = { wagmiConfig } > { children } </ WagmiConfig >
31
- < Web3Modal themeMode = { theme as "light" | "dark" } { ...{ projectId, ethereumClient } } />
33
+ < Web3Modal
34
+ themeMode = { themeToggle as "light" | "dark" }
35
+ themeVariables = { {
36
+ "--w3m-accent-color" : theme . primaryPurple ,
37
+ "--w3m-background-color" : theme . primaryPurple ,
38
+ "--w3m-overlay-background-color" : "rgba(0, 0, 0, 0.6)" ,
39
+ "--w3m-overlay-backdrop-filter" : "blur(3px)" ,
40
+ "--w3m-logo-image-url" : "https://github.com/kleros/kleros-v2/blob/feat(web)/wallet-connect-themes/docs/kleros-logo-white.png?raw=true" ,
41
+ "--w3m-color-bg-1" : theme . lightBackground ,
42
+ } }
43
+ { ...{ projectId, ethereumClient } }
44
+ />
32
45
</ >
33
46
) ;
34
47
} ;
0 commit comments