From 771c48e4bbcad6a50e1ad30b7116eb525ca0c627 Mon Sep 17 00:00:00 2001 From: Dwindi Ramadhana Date: Wed, 31 Dec 2025 14:19:08 +0700 Subject: [PATCH] fix: align mobile bottom bar with desktop nav structure - Add Marketing section to More page with Newsletter and Coupons submenu - Remove standalone Coupons entry (now under Marketing) - Add submenu rendering support for items with children - Use Megaphone icon for Marketing section --- admin-spa/src/routes/More/index.tsx | 75 ++++++++++++++++++----------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/admin-spa/src/routes/More/index.tsx b/admin-spa/src/routes/More/index.tsx index fcf2365..abed9e6 100644 --- a/admin-spa/src/routes/More/index.tsx +++ b/admin-spa/src/routes/More/index.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react'; import { useNavigate, Link } from 'react-router-dom'; -import { Tag, Settings as SettingsIcon, Palette, ChevronRight, Minimize2, LogOut, Sun, Moon, Monitor, ExternalLink } from 'lucide-react'; +import { Tag, Settings as SettingsIcon, Palette, ChevronRight, Minimize2, LogOut, Sun, Moon, Monitor, ExternalLink, Mail, Megaphone } from 'lucide-react'; import { __ } from '@/lib/i18n'; import { usePageHeader } from '@/contexts/PageHeaderContext'; import { useApp } from '@/contexts/AppContext'; @@ -12,14 +12,19 @@ interface MenuItem { label: string; description: string; to: string; + children?: { label: string; to: string }[]; } const menuItems: MenuItem[] = [ { - icon: , - label: __('Coupons'), - description: __('Manage discount codes and promotions'), - to: '/coupons' + icon: , + label: __('Marketing'), + description: __('Newsletter, coupons, and promotions'), + to: '/marketing', + children: [ + { label: __('Newsletter'), to: '/marketing/newsletter' }, + { label: __('Coupons'), to: '/coupons' }, + ] }, { icon: , @@ -40,7 +45,7 @@ export default function MorePage() { const { setPageHeader, clearPageHeader } = usePageHeader(); const { isStandalone, exitFullscreen } = useApp(); const { theme, setTheme } = useTheme(); - + useEffect(() => { setPageHeader(__('More')); return () => clearPageHeader(); @@ -56,7 +61,7 @@ export default function MorePage() { // Clear auth and redirect to login window.location.href = window.WNW_CONFIG?.wpAdminUrl || '/wp-admin'; }; - + const themeOptions = [ { value: 'light', icon: , label: __('Light') }, { value: 'dark', icon: , label: __('Dark') }, @@ -75,22 +80,37 @@ export default function MorePage() { {/* Menu Items */}
{menuItems.map((item) => ( -
- - +
+
{item.label}
+
+ {item.description} +
+
+ + + {/* Submenu items */} + {item.children && item.children.length > 0 && ( +
+ {item.children.map((child) => ( + + ))} +
+ )} + ))} @@ -102,11 +122,10 @@ export default function MorePage() { )} - + {isStandalone ? (