Skip to content

Commit

Permalink
Fix logic of the button connecting wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
jeong-ah-choi committed Jan 4, 2023
1 parent d02fce0 commit 696d8c0
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
/* eslint-disable @next/next/no-img-element */
import LoginForm from '@/features/Auth/components/LoginForm'
import WalletConnect from '@/features/Contract/components/WalletConnect'
import useModalStore from '@/store/useModalStore'
import Link from 'next/link'
import React from 'react'
import { NoSSR } from './NoSSR'

const NavBar: React.FC = () => {
const { openModal } = useModalStore()
const { openModal } = useModalStore();
const handleClick = () => {
// get saved session ticket data
const sessionTicket = localStorage.getItem('SessionTicket');
if (sessionTicket !== null) {
openModal({
title: 'Wallet',
component: <WalletConnect />,
})
} else {
openModal({
title: 'Sign In',
component: <LoginForm />,
})
}
};

return (
<NoSSR>
Expand Down Expand Up @@ -51,12 +67,7 @@ const NavBar: React.FC = () => {
</ul>
<button
className="px-4 lg:w-[180px] h-[50px] bg-white rounded-xl flex-center border border-orange"
onClick={() =>
openModal({
title: 'Sign In',
component: <LoginForm />,
})
}
onClick={handleClick}
>
<span className="text-orange text-base font-bold leading-none">
Connect <br className="lg:hidden" />
Expand Down

1 comment on commit 696d8c0

@vercel
Copy link

@vercel vercel bot commented on 696d8c0 Jan 4, 2023

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:

coinbase-kup-web – ./

coinbase-kup-web.vercel.app
coinbase-kup-web-git-main-catze.vercel.app
coinbase-kup-web-catze.vercel.app

Please sign in to comment.