fix: simplify More page - Marketing as simple button without submenu
- Remove inline submenu expansion for Marketing - Keep it consistent with Appearance and Settings (simple buttons) - Description provides enough context about what's inside
This commit is contained in:
@@ -12,7 +12,6 @@ interface MenuItem {
|
|||||||
label: string;
|
label: string;
|
||||||
description: string;
|
description: string;
|
||||||
to: string;
|
to: string;
|
||||||
children?: { label: string; to: string }[];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const menuItems: MenuItem[] = [
|
const menuItems: MenuItem[] = [
|
||||||
@@ -20,11 +19,7 @@ const menuItems: MenuItem[] = [
|
|||||||
icon: <Megaphone className="w-5 h-5" />,
|
icon: <Megaphone className="w-5 h-5" />,
|
||||||
label: __('Marketing'),
|
label: __('Marketing'),
|
||||||
description: __('Newsletter, coupons, and promotions'),
|
description: __('Newsletter, coupons, and promotions'),
|
||||||
to: '/marketing',
|
to: '/marketing'
|
||||||
children: [
|
|
||||||
{ label: __('Newsletter'), to: '/marketing/newsletter' },
|
|
||||||
{ label: __('Coupons'), to: '/coupons' },
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: <Palette className="w-5 h-5" />,
|
icon: <Palette className="w-5 h-5" />,
|
||||||
@@ -80,8 +75,8 @@ export default function MorePage() {
|
|||||||
{/* Menu Items */}
|
{/* Menu Items */}
|
||||||
<div className="divide-y">
|
<div className="divide-y">
|
||||||
{menuItems.map((item) => (
|
{menuItems.map((item) => (
|
||||||
<div key={item.to}>
|
|
||||||
<button
|
<button
|
||||||
|
key={item.to}
|
||||||
onClick={() => navigate(item.to)}
|
onClick={() => navigate(item.to)}
|
||||||
className="w-full flex items-center gap-4 py-4 hover:bg-accent transition-colors"
|
className="w-full flex items-center gap-4 py-4 hover:bg-accent transition-colors"
|
||||||
>
|
>
|
||||||
@@ -96,21 +91,6 @@ export default function MorePage() {
|
|||||||
</div>
|
</div>
|
||||||
<ChevronRight className="w-5 h-5 text-muted-foreground flex-shrink-0" />
|
<ChevronRight className="w-5 h-5 text-muted-foreground flex-shrink-0" />
|
||||||
</button>
|
</button>
|
||||||
{/* Submenu items */}
|
|
||||||
{item.children && item.children.length > 0 && (
|
|
||||||
<div className="pl-14 pb-2 space-y-1">
|
|
||||||
{item.children.map((child) => (
|
|
||||||
<button
|
|
||||||
key={child.to}
|
|
||||||
onClick={() => navigate(child.to)}
|
|
||||||
className="w-full text-left py-2 px-3 text-sm text-muted-foreground hover:text-foreground hover:bg-accent rounded-md transition-colors"
|
|
||||||
>
|
|
||||||
{child.label}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user