-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
384a46f
commit a3dc4ca
Showing
2 changed files
with
54 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { WagmiProvider, createConfig } from 'wagmi' | ||
Check failure on line 1 in src/@context/Web3Provider.tsx GitHub Actions / test (ubuntu-latest, 18)
|
||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query' | ||
import { ConnectKitProvider, getDefaultConfig } from 'connectkit' | ||
import { getSupportedChains } from '../@utils/wallet/chains' | ||
import { getSupportedChainIds } from '../../chains.config' | ||
import { ReactElement, ReactNode } from 'react' | ||
|
||
const config = createConfig( | ||
getDefaultConfig({ | ||
// Your dApps chains | ||
chains: getSupportedChains(getSupportedChainIds()), | ||
// Required API Keys | ||
walletConnectProjectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID, | ||
// Required App Info | ||
appName: 'Pontus-X' | ||
}) | ||
) | ||
|
||
// ConnectKit CSS overrides | ||
// https://docs.family.co/connectkit/theming#theme-variables | ||
export const connectKitTheme = { | ||
'--ck-font-family': 'var(--font-family-base)', | ||
'--ck-border-radius': 'var(--border-radius)', | ||
'--ck-overlay-background': 'var(--background-body-transparent)', | ||
'--ck-modal-box-shadow': '0 0 20px 20px var(--box-shadow-color)', | ||
'--ck-body-background': 'var(--background-body)', | ||
'--ck-body-color': 'var(--font-color-text)', | ||
'--ck-primary-button-border-radius': 'var(--border-radius)', | ||
'--ck-primary-button-color': 'var(--font-color-heading)', | ||
'--ck-primary-button-background': 'var(--background-content)', | ||
'--ck-secondary-button-border-radius': 'var(--border-radius)' | ||
} | ||
|
||
const queryClient = new QueryClient() | ||
|
||
export default function Web3Provider({ | ||
children | ||
}: { | ||
children: ReactNode | ||
}): ReactElement { | ||
return ( | ||
<WagmiProvider config={config}> | ||
<QueryClientProvider client={queryClient}> | ||
<ConnectKitProvider customTheme={connectKitTheme}> | ||
{children} | ||
</ConnectKitProvider> | ||
</QueryClientProvider> | ||
</WagmiProvider> | ||
) | ||
} | ||
|
||
export { Web3Provider } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters