primary color footer + when click on chat open chatbot
This commit is contained in:
@@ -6,11 +6,14 @@ import CategoryModal from './CategoryModal'
|
|||||||
import { useSharedStore } from '@/share/store/sharedStore'
|
import { useSharedStore } from '@/share/store/sharedStore'
|
||||||
import { useLocalCart } from '@/app/product/hooks/useLocalCart'
|
import { useLocalCart } from '@/app/product/hooks/useLocalCart'
|
||||||
import { useGetCart } from '@/app/cart/hooks/useCartData'
|
import { useGetCart } from '@/app/cart/hooks/useCartData'
|
||||||
|
import { PRIMARY_COLOR } from '@/config/const'
|
||||||
|
import ChatbotWidget from '@/app/chatbot/components/ChatbotWidget'
|
||||||
|
|
||||||
const MobileBottomMenu: FC = () => {
|
const MobileBottomMenu: FC = () => {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
const [isCategoryModalOpen, setIsCategoryModalOpen] = useState(false)
|
const [isCategoryModalOpen, setIsCategoryModalOpen] = useState(false)
|
||||||
|
const [isChatbotOpen, setIsChatbotOpen] = useState(false)
|
||||||
const { isLogin } = useSharedStore()
|
const { isLogin } = useSharedStore()
|
||||||
|
|
||||||
// Get cart count based on login status
|
// Get cart count based on login status
|
||||||
@@ -35,7 +38,7 @@ const MobileBottomMenu: FC = () => {
|
|||||||
icon: MessageText,
|
icon: MessageText,
|
||||||
label: 'چت',
|
label: 'چت',
|
||||||
path: '/profile/chat',
|
path: '/profile/chat',
|
||||||
onClick: () => handleNavigation(isLogin ? '/profile/chat' : '/auth')
|
onClick: () => setIsChatbotOpen(true)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: ShoppingCart,
|
icon: ShoppingCart,
|
||||||
@@ -71,13 +74,13 @@ const MobileBottomMenu: FC = () => {
|
|||||||
<button
|
<button
|
||||||
key={index}
|
key={index}
|
||||||
onClick={item.onClick}
|
onClick={item.onClick}
|
||||||
className={`flex flex-col items-center gap-1 p-2 min-w-0 flex-1 ${isActive ? 'text-purple-600' : 'text-gray-600'
|
className={`flex flex-col items-center gap-1 p-2 min-w-0 flex-1 ${isActive ? 'text-primary' : 'text-gray-600'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<IconComponent
|
<IconComponent
|
||||||
size={24}
|
size={24}
|
||||||
color={isActive ? '#9333ea' : '#6b7280'}
|
color={isActive ? PRIMARY_COLOR : '#6b7280'}
|
||||||
/>
|
/>
|
||||||
{/* Badge for cart count */}
|
{/* Badge for cart count */}
|
||||||
{item.badge !== undefined && (
|
{item.badge !== undefined && (
|
||||||
@@ -98,6 +101,12 @@ const MobileBottomMenu: FC = () => {
|
|||||||
isOpen={isCategoryModalOpen}
|
isOpen={isCategoryModalOpen}
|
||||||
onClose={() => setIsCategoryModalOpen(false)}
|
onClose={() => setIsCategoryModalOpen(false)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{/* Chatbot Widget */}
|
||||||
|
<ChatbotWidget
|
||||||
|
isOpen={isChatbotOpen}
|
||||||
|
onClose={() => setIsChatbotOpen(false)}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user