mirror of
https://git.meshkee.com/Meshkee/dashboards.git
synced 2026-08-11 22:30:58 +04:30
Fix business sidebar NavItem typing for production build.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
0a2358b0c2
commit
42cb8efc62
@@ -86,106 +86,105 @@ export function Sidebar() {
|
|||||||
return nameEn.trim() || nameFa.trim() || fallbackBusinessName
|
return nameEn.trim() || nameFa.trim() || fallbackBusinessName
|
||||||
}, [locale, nameEn, nameFa, fallbackBusinessName])
|
}, [locale, nameEn, nameFa, fallbackBusinessName])
|
||||||
|
|
||||||
const navItems = useMemo<NavItem[]>(
|
const navItems = useMemo<NavItem[]>(() => {
|
||||||
() =>
|
const items: NavItem[] = [
|
||||||
[
|
{ type: 'link', id: 'home', icon: Home, labelKey: 'nav.home', to: '/' },
|
||||||
{ type: 'link', id: 'home', icon: Home, labelKey: 'nav.home', to: '/' },
|
{
|
||||||
{
|
type: 'link',
|
||||||
type: 'link',
|
id: 'business-profile',
|
||||||
id: 'business-profile',
|
icon: Building2,
|
||||||
icon: Building2,
|
labelKey: 'nav.businessProfile',
|
||||||
labelKey: 'nav.businessProfile',
|
to: '/business-profile',
|
||||||
to: '/business-profile',
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'group',
|
||||||
type: 'group',
|
id: 'products',
|
||||||
id: 'products',
|
icon: ShoppingBag,
|
||||||
icon: ShoppingBag,
|
labelKey: 'nav.products',
|
||||||
labelKey: 'nav.products',
|
basePath: '/products',
|
||||||
basePath: '/products',
|
moduleId: 'products',
|
||||||
moduleId: 'products',
|
children: [
|
||||||
children: [
|
{ labelKey: 'nav.products.overview', to: '/products' },
|
||||||
{ labelKey: 'nav.products.overview', to: '/products' },
|
{ labelKey: 'nav.products.list', to: '/products/list' },
|
||||||
{ labelKey: 'nav.products.list', to: '/products/list' },
|
{ labelKey: 'nav.products.new', to: '/products/new' },
|
||||||
{ labelKey: 'nav.products.new', to: '/products/new' },
|
{ labelKey: 'nav.products.categories', to: '/products/categories' },
|
||||||
{ labelKey: 'nav.products.categories', to: '/products/categories' },
|
{ labelKey: 'nav.products.brands', to: '/products/brands' },
|
||||||
{ labelKey: 'nav.products.brands', to: '/products/brands' },
|
{ labelKey: 'nav.products.settings', to: '/products/settings' },
|
||||||
{ labelKey: 'nav.products.settings', to: '/products/settings' },
|
],
|
||||||
],
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'group',
|
||||||
type: 'group',
|
id: 'store',
|
||||||
id: 'store',
|
icon: Store,
|
||||||
icon: Store,
|
labelKey: 'nav.store',
|
||||||
labelKey: 'nav.store',
|
basePath: '/store',
|
||||||
basePath: '/store',
|
moduleId: 'store',
|
||||||
moduleId: 'store',
|
children: [
|
||||||
children: [
|
{ labelKey: 'nav.store.overview', to: '/store' },
|
||||||
{ labelKey: 'nav.store.overview', to: '/store' },
|
{ labelKey: 'nav.store.items', to: '/store/items' },
|
||||||
{ labelKey: 'nav.store.items', to: '/store/items' },
|
{ labelKey: 'nav.store.orders', to: '/store/orders' },
|
||||||
{ labelKey: 'nav.store.orders', to: '/store/orders' },
|
{ labelKey: 'nav.store.shipping', to: '/store/shipping' },
|
||||||
{ labelKey: 'nav.store.shipping', to: '/store/shipping' },
|
{ labelKey: 'nav.store.cards', to: '/store/cards' },
|
||||||
{ labelKey: 'nav.store.cards', to: '/store/cards' },
|
{ labelKey: 'nav.store.settings', to: '/store/settings' },
|
||||||
{ labelKey: 'nav.store.settings', to: '/store/settings' },
|
],
|
||||||
],
|
},
|
||||||
},
|
{ type: 'link', id: 'customers', icon: Users, labelKey: 'nav.customers', to: '/customers' },
|
||||||
{ type: 'link', id: 'customers', icon: Users, labelKey: 'nav.customers', to: '/customers' },
|
{
|
||||||
{
|
type: 'group',
|
||||||
type: 'group',
|
id: 'blog',
|
||||||
id: 'blog',
|
icon: FileText,
|
||||||
icon: FileText,
|
labelKey: 'nav.blog',
|
||||||
labelKey: 'nav.blog',
|
basePath: '/blog',
|
||||||
basePath: '/blog',
|
moduleId: 'blog',
|
||||||
moduleId: 'blog',
|
children: [
|
||||||
children: [
|
{ labelKey: 'nav.blog.overview', to: '/blog' },
|
||||||
{ labelKey: 'nav.blog.overview', to: '/blog' },
|
{ labelKey: 'nav.blog.list', to: '/blog/list' },
|
||||||
{ labelKey: 'nav.blog.list', to: '/blog/list' },
|
{ labelKey: 'nav.blog.new', to: '/blog/new' },
|
||||||
{ labelKey: 'nav.blog.new', to: '/blog/new' },
|
{ labelKey: 'nav.blog.categories', to: '/blog/categories' },
|
||||||
{ labelKey: 'nav.blog.categories', to: '/blog/categories' },
|
{ labelKey: 'nav.blog.settings', to: '/blog/settings' },
|
||||||
{ labelKey: 'nav.blog.settings', to: '/blog/settings' },
|
],
|
||||||
],
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'group',
|
||||||
type: 'group',
|
id: 'portfolios',
|
||||||
id: 'portfolios',
|
icon: Briefcase,
|
||||||
icon: Briefcase,
|
labelKey: 'nav.portfolios',
|
||||||
labelKey: 'nav.portfolios',
|
basePath: '/portfolios',
|
||||||
basePath: '/portfolios',
|
moduleId: 'portfolio',
|
||||||
moduleId: 'portfolio',
|
children: [
|
||||||
children: [
|
{ labelKey: 'nav.portfolios.overview', to: '/portfolios' },
|
||||||
{ labelKey: 'nav.portfolios.overview', to: '/portfolios' },
|
{ labelKey: 'nav.portfolios.list', to: '/portfolios/list' },
|
||||||
{ labelKey: 'nav.portfolios.list', to: '/portfolios/list' },
|
{ labelKey: 'nav.portfolios.new', to: '/portfolios/new' },
|
||||||
{ labelKey: 'nav.portfolios.new', to: '/portfolios/new' },
|
{ labelKey: 'nav.portfolios.categories', to: '/portfolios/categories' },
|
||||||
{ labelKey: 'nav.portfolios.categories', to: '/portfolios/categories' },
|
{ labelKey: 'nav.portfolios.settings', to: '/portfolios/settings' },
|
||||||
{ labelKey: 'nav.portfolios.settings', to: '/portfolios/settings' },
|
],
|
||||||
],
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'group',
|
||||||
type: 'group',
|
id: 'website',
|
||||||
id: 'website',
|
icon: Globe,
|
||||||
icon: Globe,
|
labelKey: 'nav.website',
|
||||||
labelKey: 'nav.website',
|
basePath: '/website',
|
||||||
basePath: '/website',
|
children: [
|
||||||
children: [
|
{ labelKey: 'nav.website.overview', to: '/website' },
|
||||||
{ labelKey: 'nav.website.overview', to: '/website' },
|
{ labelKey: 'nav.website.sliders', to: '/website/sliders' },
|
||||||
{ labelKey: 'nav.website.sliders', to: '/website/sliders' },
|
{ labelKey: 'nav.website.specialCategories', to: '/website/special-categories' },
|
||||||
{ labelKey: 'nav.website.specialCategories', to: '/website/special-categories' },
|
{ labelKey: 'nav.website.specialBrands', to: '/website/special-brands' },
|
||||||
{ labelKey: 'nav.website.specialBrands', to: '/website/special-brands' },
|
{ labelKey: 'nav.website.specialItems', to: '/website/special-items' },
|
||||||
{ labelKey: 'nav.website.specialItems', to: '/website/special-items' },
|
{ labelKey: 'nav.website.contact', to: '/website/contact' },
|
||||||
{ labelKey: 'nav.website.contact', to: '/website/contact' },
|
{ labelKey: 'nav.website.subscriptions', to: '/website/subscriptions' },
|
||||||
{ labelKey: 'nav.website.subscriptions', to: '/website/subscriptions' },
|
{ labelKey: 'nav.website.faq', to: '/website/faq' },
|
||||||
{ labelKey: 'nav.website.faq', to: '/website/faq' },
|
{ labelKey: 'nav.website.badges', to: '/website/badges' },
|
||||||
{ labelKey: 'nav.website.badges', to: '/website/badges' },
|
{ labelKey: 'nav.website.ePayment', to: '/website/e-payment' },
|
||||||
{ labelKey: 'nav.website.ePayment', to: '/website/e-payment' },
|
],
|
||||||
],
|
},
|
||||||
},
|
{ type: 'link', id: 'settings', icon: Settings, labelKey: 'nav.settings', to: '/settings' },
|
||||||
{ type: 'link', id: 'settings', icon: Settings, labelKey: 'nav.settings', to: '/settings' },
|
]
|
||||||
].filter(
|
|
||||||
(item) =>
|
return items.filter(
|
||||||
!item.moduleId || hasBusinessModule(enabledModules, item.moduleId),
|
(item) => !item.moduleId || hasBusinessModule(enabledModules, item.moduleId),
|
||||||
),
|
)
|
||||||
[enabledModules],
|
}, [enabledModules])
|
||||||
)
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const controller = new AbortController()
|
const controller = new AbortController()
|
||||||
|
|||||||
Reference in New Issue
Block a user