login / sign up side bar
This commit is contained in:
@@ -7,10 +7,12 @@ import { clx } from '../helpers/utils'
|
||||
import Image from 'next/image'
|
||||
import { usePathname } from 'next/navigation'
|
||||
import Button from '@/components/Button'
|
||||
import Link from 'next/link'
|
||||
import { LOGIN_URL } from '@/config/const'
|
||||
|
||||
const SideBar: FC = () => {
|
||||
|
||||
const { openSidebar, setOpenSidebar } = useSharedStore()
|
||||
const { openSidebar, setOpenSidebar, isLogin } = useSharedStore()
|
||||
const pathname = usePathname()
|
||||
const isActive = (name: string) => {
|
||||
if (pathname === '/' && name === 'home') {
|
||||
@@ -100,12 +102,18 @@ const SideBar: FC = () => {
|
||||
|
||||
</div>
|
||||
|
||||
{
|
||||
!isLogin &&
|
||||
<div className='flex-1 flex items-end justify-center px-12'>
|
||||
<Link className='w-full' href={`${LOGIN_URL}?redirect=${encodeURIComponent(window.location.href)}`}>
|
||||
<Button
|
||||
label='ورود | ثبت نام'
|
||||
/>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user