-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'alpha-6' into alpha-6-update-readme
- Loading branch information
Showing
16 changed files
with
565 additions
and
905 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
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
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
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,57 +1,23 @@ | ||
import { EthereumClient } from '@web3modal/ethereum'; | ||
import { Web3Modal } from '@web3modal/html'; | ||
import { createWeb3Modal } from '@web3modal/wagmi'; | ||
|
||
import { PUBLIC_WALLETCONNECT_PROJECT_ID } from '$env/static/public'; | ||
import { chains, getChainImages } from '$libs/chain'; | ||
import { wagmiConfig } from '$libs/wagmi'; | ||
|
||
const projectId = PUBLIC_WALLETCONNECT_PROJECT_ID; | ||
|
||
const ethereumClient = new EthereumClient(wagmiConfig, chains); | ||
|
||
const chainImages = getChainImages(); | ||
|
||
export const web3modal = new Web3Modal( | ||
{ | ||
projectId, | ||
chainImages, | ||
// TODO: can we bring these vars into Tailwind theme? | ||
themeVariables: { | ||
'--w3m-font-family': '"Public Sans", sans-serif', | ||
'--w3m-font-feature-settings': 'normal', | ||
'--w3m-button-border-radius': '9999px', | ||
|
||
// Body small regular | ||
'--w3m-text-small-regular-size': '14px', | ||
'--w3m-text-small-regular-weight': '400', | ||
'--w3m-text-small-regular-line-height': '20px', | ||
|
||
// Body regular | ||
'--w3m-text-medium-regular-size': '16px', | ||
'--w3m-text-medium-regular-weight': '400', | ||
'--w3m-text-medium-regular-line-height': '24px', | ||
'--w3m-text-medium-regular-letter-spacing': 'normal', | ||
|
||
// Title body bold | ||
'--w3m-text-big-bold-size': '18px', | ||
'--w3m-text-big-bold-weight': '700', | ||
'--w3m-text-big-bold-line-height': '24px', | ||
|
||
'--w3m-background-color': 'var(--primary-brand)', | ||
'--w3m-overlay-background-color': 'var(--overlay-background)', | ||
'--w3m-background-border-radius': '20px', | ||
'--w3m-container-border-radius': '0', | ||
|
||
// Unofficial variables | ||
// @ts-ignore | ||
'--w3m-color-fg-1': 'var(--primary-content)', | ||
'--w3m-color-bg-1': 'var(--dialog-background)', | ||
'--w3m-color-bg-2': 'var(--neutral-background)', | ||
'--w3m-color-overlay': 'none', | ||
'--w3m-accent-color': 'var(--neutral-accent)', | ||
'--w3m-accent-fill-color': 'var(--primary-content)', | ||
}, | ||
themeMode: (localStorage.getItem('theme') as 'dark' | 'light') ?? 'dark', | ||
export const web3modal = createWeb3Modal({ | ||
wagmiConfig, | ||
projectId, | ||
chains, | ||
chainImages, | ||
themeVariables: { | ||
'--w3m-color-mix': 'var(--neutral-background)', | ||
'--w3m-color-mix-strength': 20, | ||
'--w3m-font-family': '"Public Sans", sans-serif', | ||
'--w3m-border-radius-master': '9999px', | ||
'--w3m-accent': 'var(--primary-brand)', | ||
}, | ||
ethereumClient, | ||
); | ||
themeMode: (localStorage.getItem('theme') as 'dark' | 'light') ?? 'dark', | ||
}); |
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
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,15 +1,12 @@ | ||
import { configureChains, createConfig } from '@wagmi/core'; | ||
import { w3mConnectors, w3mProvider } from '@web3modal/ethereum'; | ||
import { configureChains } from '@wagmi/core'; | ||
import { publicProvider } from '@wagmi/core/providers/public'; | ||
import { defaultWagmiConfig, walletConnectProvider } from '@web3modal/wagmi'; | ||
|
||
import { PUBLIC_WALLETCONNECT_PROJECT_ID } from '$env/static/public'; | ||
import { chains } from '$libs/chain'; | ||
|
||
const projectId = PUBLIC_WALLETCONNECT_PROJECT_ID; | ||
|
||
export const { publicClient } = configureChains(chains, [w3mProvider({ projectId })]); | ||
export const { publicClient } = configureChains(chains, [walletConnectProvider({ projectId }), publicProvider()]); | ||
|
||
export const wagmiConfig = createConfig({ | ||
autoConnect: true, | ||
connectors: w3mConnectors({ projectId, chains }), | ||
publicClient, | ||
}); | ||
export const wagmiConfig = defaultWagmiConfig({ chains, projectId }); |
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
Oops, something went wrong.