Add customer and business user-product flows across dashboards.
Ship my-products / customer-products UI with gallery uploads, status controls, module gating, and related shared UI polish. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
c5bdaad16b
commit
1271d96539
@@ -1,12 +1,14 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { NavLink, useNavigate } from 'react-router-dom'
|
||||
import { Home, User, MapPin, ShoppingBag, Heart, HelpCircle, LogOut } from 'lucide-react'
|
||||
import { Home, User, MapPin, ShoppingBag, Heart, Package, HelpCircle, LogOut } from 'lucide-react'
|
||||
import { useLocale } from '@meshkee/dashboard-ui'
|
||||
import { useAuth } from '../context/AuthContext'
|
||||
import { useTenantBranding } from '../context/TenantBrandingContext'
|
||||
import { useT } from '../i18n/useT'
|
||||
import { getActiveBusinessDomain } from '../lib/businessContext'
|
||||
import { isAbortError } from '../lib/api'
|
||||
import { getWebsiteBusinessInfo } from '../services/websiteService'
|
||||
import { hasBusinessModule } from '../utils/businessModules'
|
||||
import meshkeeLogo from '../assets/meshkee-logo.png'
|
||||
import styles from './Sidebar.module.css'
|
||||
|
||||
@@ -14,6 +16,7 @@ export function Sidebar() {
|
||||
const navigate = useNavigate()
|
||||
const { user, logout } = useAuth()
|
||||
const { locale } = useLocale()
|
||||
const { enabledModules } = useTenantBranding()
|
||||
const t = useT()
|
||||
const [brandName, setBrandName] = useState('')
|
||||
const [logoUrl, setLogoUrl] = useState<string | null>(null)
|
||||
@@ -21,6 +24,7 @@ export function Sidebar() {
|
||||
const businessDomain = getActiveBusinessDomain()
|
||||
const fallbackBusinessName = user?.customerBusinesses[0]?.name ?? t('app.storeFallback')
|
||||
const displayName = brandName || fallbackBusinessName
|
||||
const showMyProducts = hasBusinessModule(enabledModules, 'customer_products')
|
||||
|
||||
const navItems = [
|
||||
{ icon: Home, label: t('nav.home'), to: '/' },
|
||||
@@ -28,6 +32,9 @@ export function Sidebar() {
|
||||
{ icon: MapPin, label: t('nav.addresses'), to: '/addresses' },
|
||||
{ icon: ShoppingBag, label: t('nav.orders'), to: '/orders' },
|
||||
{ icon: Heart, label: t('nav.favorites'), to: '/favorites' },
|
||||
...(showMyProducts
|
||||
? [{ icon: Package, label: t('nav.myProducts'), to: '/my-products' }]
|
||||
: []),
|
||||
]
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user