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