online and offline base cart

This commit is contained in:
hamid zarghami
2025-09-14 10:27:33 +03:30
parent cb5a9a8e21
commit 7b05f96576
16 changed files with 690 additions and 24 deletions
+15 -1
View File
@@ -2,11 +2,25 @@
import Input from '@/components/Input'
import { Separator } from '@/components/ui/separator'
import { DocumentText, Home, Profile, ShoppingCart, HambergerMenu } from 'iconsax-react'
import { FC, Fragment, useState } from 'react'
import { FC, Fragment, useEffect, useState } from 'react'
import Menu from './components/Menu'
import { useSharedStore } from './store/sharedStore'
import { getToken } from '@/config/func'
const Header: FC = () => {
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false)
const { setIsLogin } = useSharedStore()
const handleSetIsLogin = async () => {
const token = await getToken()
setIsLogin(token ? true : false)
}
useEffect(() => {
handleSetIsLogin()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
return (
<Fragment>