Skip to content

Commit

Permalink
add custom button
Browse files Browse the repository at this point in the history
  • Loading branch information
glitch-txs committed Jan 25, 2024
1 parent 2cbd550 commit 2bdcf30
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 116 deletions.
2 changes: 1 addition & 1 deletion dapps/web3modal/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@tanstack/react-query": "^5.17.19",
"@web3modal/wagmi": "4.0.0-alpha.2",
"@web3modal/wagmi": "4.0.0-alpha.3",
"next": "14.0.4",
"react": "^18",
"react-dom": "^18",
Expand Down
156 changes: 43 additions & 113 deletions dapps/web3modal/next/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion dapps/web3modal/next/src/app/page.module.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.main {
display: flex;
flex-direction: column;
justify-content: space-between;
justify-content: center;
align-items: center;
padding: 6rem;
gap: 40px;
min-height: 100vh;
}
3 changes: 2 additions & 1 deletion dapps/web3modal/next/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import Connect from '@/components/Connect'
import Connect, { Custom } from '@/components/Connect'
import styles from './page.module.css'

export default function Home() {
return (
<main className={styles.main}>
<Connect />
<Custom/>
</main>
)
}
7 changes: 7 additions & 0 deletions dapps/web3modal/next/src/components/Connect.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
'use client'

import { useWeb3Modal } from "@web3modal/wagmi/react"

export default function Connect() {
return <w3m-button />
}

export function Custom(){
const { open } = useWeb3Modal()
return <button onClick={()=>open()} >open modal</button>
}

0 comments on commit 2bdcf30

Please sign in to comment.