Skip to content

Commit

Permalink
Add Modal
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-bazz committed Nov 15, 2022
1 parent c59467c commit 8caa2bc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
22 changes: 6 additions & 16 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,27 @@ function App() {

const modal = useRef();
function handleModal() {
DOMMethods.showModal(modal.current)
modal.current.showModal()
}
function handleClose() {
DOMMethods.closeModal(modal.current)
modal.current.close()
}

return (
<>
<Router>

<Nav />
<Nav handleModal={handleModal} />

<Routes >

<Route path='/' element={<Home />} />
<Route path='NFTs' element={<Nft />} />

</Routes>
{/* <Dialog modal={modal} >
<div className="modal__header">
<h3>Connect Wallet</h3>
<div className="close" onClick={() => handleClose()}>
<Icons name={`cross`} />
</div>
</div>
<div className="modal__body">
<p>Choose your preferred wallet:</p>
<LinkBTN name={`meta-fox`} text={`Metamask`} />
<LinkBTN name={`wallet`} text={`WalletConnect`} />
</div>
</Dialog> */}

<Dialog modal={modal} handleClose={handleClose} />

<Footer />

</Router>
Expand Down
22 changes: 18 additions & 4 deletions src/App/component/Dialog.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
import Icons from "../../assets/icons/Icons";
import LinkBTN from "./LinkBTN";


export default function Dialog({modal, children}) {
export default function Dialog({ modal, children , handleClose}) {
return (
<dialog className="modal" ref={modal}>
{children}
</dialog>
<dialog className="modal" ref={modal}>
<div className="modal__header">
<h3>Connect Wallet</h3>
<div className="close" onClick={() => handleClose()}>
<Icons name={`cross`} />

</div>
</div>
<div className="modal__body">
<p>Choose your preferred wallet:</p>
<LinkBTN name={`meta-fox`} text={`Metamask`} />
<LinkBTN name={`wallet`} text={`WalletConnect`} />

</div>
</dialog>
)
}

2 comments on commit 8caa2bc

@vercel
Copy link

@vercel vercel bot commented on 8caa2bc Nov 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

metabnb-nf-ts – ./

metabnb-nf-ts-git-main-b-a-zz.vercel.app
metabnb-nf-ts-b-a-zz.vercel.app
metabnb-nf-ts.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 8caa2bc Nov 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

metabnb-nf-ts-me4v – ./

metabnb-nf-ts-me4v.vercel.app
metabnb-nf-ts-me4v-b-a-zz.vercel.app
metabnb-nf-ts-me4v-git-main-b-a-zz.vercel.app

Please sign in to comment.