From ca77602a677e4841a4b0471d09ece42e559222e0 Mon Sep 17 00:00:00 2001 From: vickytechkey Date: Thu, 29 Oct 2026 19:16:07 +0530 Subject: [PATCH] feat: add Navbar component and seller type definitions --- src/components/common/Preloader.tsx | 11 +++++++---- src/components/layout/DashboardLayout.tsx | 24 ++++++++++++++++++----- src/components/layout/Navbar.tsx | 22 +++++++++++++++++++++ src/pages/dashboard/OverviewPage.tsx | 20 +++++++++++++++++++ src/pages/dashboard/SettingsPage.tsx | 17 ++++++++++++++++ src/types/seller.ts | 3 +++ 6 files changed, 88 insertions(+), 9 deletions(-) diff --git a/src/components/common/Preloader.tsx b/src/components/common/Preloader.tsx index 7755a33..49eb358 100644 --- a/src/components/common/Preloader.tsx +++ b/src/components/common/Preloader.tsx @@ -89,13 +89,16 @@ export const Preloader: React.FC = () => { {/* Central Artisan Logo / Icon */}
- T + Tradhox
diff --git a/src/components/layout/DashboardLayout.tsx b/src/components/layout/DashboardLayout.tsx index d3bcc9c..5544ec2 100644 --- a/src/components/layout/DashboardLayout.tsx +++ b/src/components/layout/DashboardLayout.tsx @@ -75,10 +75,17 @@ export const DashboardLayout: React.FC = () => {
{/* Logo */}
- - - Tradhox - + + Tradhox
@@ -219,7 +226,7 @@ export const DashboardLayout: React.FC = () => { zIndex: 25 }} > - {/* Mobile Sidebar Toggle */} + {/* Mobile Sidebar Toggle & Real Logo */}
+ + Tradhox +
{/* Right Header Actions */} diff --git a/src/components/layout/Navbar.tsx b/src/components/layout/Navbar.tsx index 1631e5f..6dcc37a 100644 --- a/src/components/layout/Navbar.tsx +++ b/src/components/layout/Navbar.tsx @@ -34,6 +34,7 @@ export const Navbar: React.FC = () => { const sellerName = user?.name || user?.storeName || onboarding.tradeName || onboarding.fullName || 'Seller Partner'; const sellerStore = onboarding.tradeName || user?.storeName || 'Maker Store'; + const sellerMid = user?.profile?.merchant_id || user?.merchant_id || onboarding.merchantId || (user?.id ? `TRDPX${String(user.id).padStart(6, '0')}` : undefined); const avatarInitials = (sellerName.replace(/[^a-zA-Z]/g, '') || 'SP').slice(0, 2).toUpperCase(); const navLinks = [ @@ -317,6 +318,27 @@ export const Navbar: React.FC = () => {
+ {sellerMid && ( +
+ MID: {sellerMid} +
+ )} +
{ const { orders, inventory, walletBalance, onboarding, user } = useSeller(); + const sellerMid = user?.profile?.merchant_id || user?.merchant_id || onboarding.merchantId || (user?.id ? `TRDPX${String(user.id).padStart(6, '0')}` : undefined); const [bannerVisible, setBannerVisible] = useState(true); const [restockQty, setRestockQty] = useState('25'); const [activeOrderTab, setActiveOrderTab] = useState<'all' | 'new' | 'ready' | 'scheduled' | 'transit'>('all'); @@ -185,6 +186,25 @@ export const OverviewPage: React.FC = () => { {onboarding.tradeName || onboarding.city || user?.storeName || user?.name || 'Artisan Seller Hub'} + {sellerMid && ( + + MID: {sellerMid} + + )} +
+ {/* Merchant ID (MID) - Internal Platform Tracking */} + {sellerMid && ( +
+
+ badge +
+ Merchant Identification Number (MID) +

Unique seller ID for internal Tradhox platform tracking

+
+
+ + {sellerMid} + +
+ )} + {/* Storefront Branding: Cover Photo & Logo */}
diff --git a/src/types/seller.ts b/src/types/seller.ts index 04bee3f..6bd7606 100644 --- a/src/types/seller.ts +++ b/src/types/seller.ts @@ -6,7 +6,9 @@ export interface UserProfile { role: string; avatar: string; storeName: string; + merchant_id?: string; profile?: { + merchant_id?: string; phone?: string; logo_url?: string; store_name?: string; @@ -75,6 +77,7 @@ export interface OnboardingData { // Step 7: Store Profile & Lineage storeName: string; storeSlug?: string; + merchantId?: string; craftLineageYears: number; artisanBio: string; workshopLocation: string;