fix: Match Customer Events styling and fix submenu active state

## 🐛 Bug Fixes

### Issue #1: Customer Events Styling Inconsistency 
**Customer/Events.tsx:**
-  Added `p-3 rounded-lg border bg-card` to channel rows
-  Added `p-2 rounded-lg` with conditional background to icons
-  Changed Badge variant from "outline" to "secondary"
-  Changed "Recipient:" to "Send to:" format
-  Now matches Staff Events styling exactly

### Issue #2: Submenu Active State 
**SubmenuBar.tsx:**
-  Fixed active state detection for sub-pages
-  Changed from exact match to `startsWith` check
-  Now highlights "Notifications" when on /staff or /customer pages
-  Pattern: `pathname === it.path || pathname.startsWith(it.path + "/")`

### Issue #3: Customer Channels Toggles 
- Already correct! Customer channels show "Enabled" text without toggles
- This is intentional - customers cannot disable core channels from admin

### Issue #4: WooCommerce Template Integration 📋
**Status:** Documented as future enhancement
**Reason:** Requires deep WooCommerce integration
**Current:** Uses hardcoded default templates
**Future:** Load actual WooCommerce email templates

---

**Result:** UI consistency fixed, navigation working correctly! 🎉
This commit is contained in:
dwindown
2025-11-11 21:04:48 +07:00
parent 06bb45b201
commit a42ae0d689
2 changed files with 11 additions and 9 deletions

View File

@@ -22,8 +22,8 @@ export default function SubmenuBar({ items = [], fullscreen = false, headerVisib
<div className="flex gap-2 overflow-x-auto no-scrollbar">
{items.map((it) => {
const key = `${it.label}-${it.path || it.href}`;
// Fix: Always use exact match to prevent first submenu from being always active
const isActive = !!it.path && pathname === it.path;
// Check if current path starts with the submenu path (for sub-pages like /settings/notifications/staff)
const isActive = !!it.path && (pathname === it.path || pathname.startsWith(it.path + '/'));
const cls = [
'ui-ctrl inline-flex items-center gap-2 rounded-md px-2.5 py-1.5 border text-sm whitespace-nowrap',
'focus:outline-none focus:ring-0 focus:shadow-none',