Skip to content

Commit

Permalink
Update readmes (WalletConnect#582)
Browse files Browse the repository at this point in the history
* Create dedicated readme asset folder

* Update github action pr check branch

* add lerna to prettierignore (it auto formats)

* Use env variable for example projectId, animation tweakes

* save progress

* Add some hooks readme

* add more readme documentation

* finalise hooks docs

* Add project id env variable
  • Loading branch information
iljadaderko committed Sep 17, 2022
1 parent 8e35b36 commit 9d14846
Show file tree
Hide file tree
Showing 11 changed files with 457 additions and 70 deletions.
Binary file added .github/assets/custom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed .github/assets/header.jpeg
Binary file not shown.
Binary file added .github/assets/header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
run: npm ci
- name: build
run: npm run build
env:
NEXT_PUBLIC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_PROJECT_ID }}

code_style:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ node_modules/
.next
out
lerna-debug.log
.env.local
9 changes: 5 additions & 4 deletions examples/react/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import type { AppProps } from 'next/app'
import '../styles.css'

// Get projectID at https://cloud.walletconnect.com
const WC_PROJECT_ID = 'YOUR_PROJECT_ID'
if (!process.env.NEXT_PUBLIC_PROJECT_ID)
throw new Error('You need to provide NEXT_PUBLIC_PROJECT_ID env variable')

// Configure chains and providers (rpc's)
const { chains, provider } = configureChains([chain.mainnet], [publicProvider()])
const { chains, provider } = configureChains([chain.mainnet, chain.arbitrum], [publicProvider()])

// Create wagmi client
const wagmiClient = createClient({
Expand All @@ -21,9 +22,9 @@ const wagmiClient = createClient({

// Configure web3modal
const modalConfig: ConfigOptions = {
projectId: WC_PROJECT_ID,
projectId: process.env.NEXT_PUBLIC_PROJECT_ID,
theme: 'dark',
accentColor: 'orange'
accentColor: 'default'
}

export default function App({ Component, pageProps }: AppProps) {
Expand Down
1 change: 0 additions & 1 deletion examples/react/src/sections/SwitchChainSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export default function AccountSection() {
<select onChange={({ target }) => onSwithChainDemo(target.value)} disabled={isLoading}>
<option value="eip155:1">Ethereum</option>
<option value="eip155:42161">Arbitrum</option>
<option value="eip155:43114">Avalanche</option>
</select>
</section>
)
Expand Down
2 changes: 1 addition & 1 deletion examples/react/src/styles.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
body {
background-color: black;
background-color: #000;
color: #fff;
display: flex;
justify-content: center;
Expand Down
Loading

0 comments on commit 9d14846

Please sign in to comment.