-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from MyriadFlow/ui
changed connect button in the navbar
- Loading branch information
Showing
7 changed files
with
14,128 additions
and
97 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,19 +1,39 @@ | ||
'use client' | ||
|
||
import React, { ReactNode } from 'react' | ||
|
||
|
||
import { createWeb3Modal } from '@web3modal/wagmi/react' | ||
|
||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query' | ||
import { useState, type ReactNode } from 'react' | ||
import { WagmiProvider } from 'wagmi' | ||
|
||
import { config } from './wagmi' | ||
import { State, WagmiProvider } from 'wagmi' | ||
import { config, projectId } from './wagmi' | ||
|
||
|
||
// Setup queryClient | ||
const queryClient = new QueryClient() | ||
|
||
if (!projectId) throw new Error('Wallet Connect Project ID is not defined') | ||
|
||
export function Providers(props: { children: ReactNode }) { | ||
const [queryClient] = useState(() => new QueryClient()) | ||
// Create modal | ||
createWeb3Modal({ | ||
wagmiConfig: config, | ||
projectId, | ||
enableAnalytics: true, // Optional - defaults to your Cloud configuration | ||
enableOnramp: true // Optional - false as default | ||
}) | ||
|
||
return ( | ||
<WagmiProvider config={config}> | ||
<QueryClientProvider client={queryClient}> | ||
{props.children} | ||
</QueryClientProvider> | ||
</WagmiProvider> | ||
) | ||
export default function Web3ModalProvider({ | ||
children, | ||
initialState | ||
}: { | ||
children: ReactNode | ||
initialState?: State | ||
}) { | ||
return ( | ||
<WagmiProvider config={config} initialState={initialState}> | ||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider> | ||
</WagmiProvider> | ||
) | ||
} |
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 |
---|---|---|
@@ -1,23 +1,28 @@ | ||
import { http, createConfig } from 'wagmi' | ||
import { mainnet, sepolia, baseSepolia } from 'wagmi/chains' | ||
import { coinbaseWallet, injected, walletConnect } from 'wagmi/connectors' | ||
import { defaultWagmiConfig } from '@web3modal/wagmi/react/config' | ||
|
||
export const config = createConfig({ | ||
chains: [ | ||
// mainnet, | ||
import { cookieStorage, createStorage } from 'wagmi' | ||
import { baseSepolia } from 'wagmi/chains' | ||
|
||
baseSepolia, | ||
], | ||
connectors: [injected(), coinbaseWallet({ appName: 'Myriadflow' })], | ||
ssr: true, | ||
transports: { | ||
// [mainnet.id]: http(), | ||
[baseSepolia.id]: http(), | ||
}, | ||
}) | ||
// Get projectId from https://cloud.walletconnect.com | ||
export const projectId = process.env.NEXT_PUBLIC_PROJECT_ID | ||
|
||
if (!projectId) throw new Error('Project ID is not defined') | ||
|
||
declare module 'wagmi' { | ||
interface Register { | ||
config: typeof config | ||
} | ||
const metadata = { | ||
name: 'Web3Modal', | ||
description: 'Web3Modal Example', | ||
url: 'https://web3modal.com', | ||
icons: ['https://avatars.githubusercontent.com/u/37784886'] | ||
} | ||
|
||
// Create wagmiConfig | ||
const chains = [baseSepolia] as const | ||
export const config = defaultWagmiConfig({ | ||
chains, | ||
projectId, | ||
metadata, | ||
ssr: true, | ||
storage: createStorage({ | ||
storage: cookieStorage | ||
}), | ||
}) |