From 66004a0fbaa33a704a60182fd19963d0dc5363db Mon Sep 17 00:00:00 2001 From: Alireza Hassani Date: Sat, 1 Aug 2026 09:35:27 +0330 Subject: [PATCH] Add FA/EN locale, home activity charts, and theme-aware polish. Ship shared LocaleProvider, business/customer i18n, branding defaultLocale, curated home tiles with dual 30-day charts, and chart/page aura tokens; refresh PROJECT_CONTEXT. Co-authored-by: Cursor --- apps/business/index.html | 14 +- apps/business/src/App.tsx | 3 + .../src/components/Breadcrumbs.module.css | 4 + apps/business/src/components/Breadcrumbs.tsx | 13 +- .../src/components/CategoryRow.module.css | 12 +- .../components/DailyActivityChart.module.css | 138 ++++ .../src/components/DailyActivityChart.tsx | 164 +++++ .../src/components/DashboardDocumentTitle.tsx | 9 +- .../business/src/components/Header.module.css | 20 +- apps/business/src/components/Header.tsx | 94 ++- .../src/components/PageLayout.module.css | 4 +- .../src/components/PortfolioCard.module.css | 2 +- .../business/src/components/PortfolioCard.tsx | 18 +- .../ProductActivityChart.module.css | 6 +- .../src/components/ProductActivityChart.tsx | 34 +- .../src/components/ProductCard.module.css | 8 +- .../components/SearchableSelect.module.css | 2 +- .../src/components/SectionCard.module.css | 60 +- apps/business/src/components/SectionCard.tsx | 26 +- .../src/components/Sidebar.module.css | 29 +- apps/business/src/components/Sidebar.tsx | 269 ++++---- .../src/components/StoreItemCard.module.css | 2 +- .../WebsiteGroupItemCard.module.css | 2 +- .../src/context/TenantBrandingContext.tsx | 43 +- apps/business/src/i18n/messages.ts | 621 ++++++++++++++++++ apps/business/src/i18n/useT.ts | 13 + apps/business/src/index.css | 77 ++- apps/business/src/lib/routeTitles.ts | 48 +- apps/business/src/pages/AddNewProductPage.tsx | 8 +- .../src/pages/BusinessProfilePage.module.css | 2 +- apps/business/src/pages/HomePage.tsx | 186 ++++-- apps/business/src/pages/LoginPage.module.css | 13 +- apps/business/src/pages/LoginPage.tsx | 154 ++--- apps/business/src/pages/PortfolioListPage.tsx | 44 +- .../src/pages/ProductDetailsPage.module.css | 4 +- apps/business/src/pages/ProductsPage.tsx | 50 +- .../src/pages/StoreSettingsPage.module.css | 4 + apps/business/src/pages/StoreSettingsPage.tsx | 37 +- .../src/services/dailyActivityService.ts | 41 ++ apps/business/src/services/orderService.ts | 1 + .../business/src/services/portfolioService.ts | 1 + apps/business/src/services/settingsService.ts | 30 +- apps/business/src/services/tenantService.ts | 2 + apps/business/src/types/auth.ts | 2 + apps/business/src/types/portfolio.ts | 1 + apps/business/src/utils/applyBusinessTheme.ts | 8 + .../src/utils/businessPrimaryColors.ts | 26 + apps/business/src/utils/productActivity.ts | 15 +- apps/customer/index.html | 14 +- apps/customer/src/App.tsx | 4 +- .../components/AddressFormModal.module.css | 15 + .../src/components/AddressFormModal.tsx | 357 ++++++++++ .../src/components/DashboardDocumentTitle.tsx | 9 +- .../FavoriteStoreItemCard.module.css | 10 +- .../src/components/FavoriteStoreItemCard.tsx | 22 +- .../customer/src/components/Header.module.css | 22 +- apps/customer/src/components/Header.tsx | 56 +- .../src/components/OrderItemsModal.tsx | 45 +- .../src/components/OrderRow.module.css | 9 +- apps/customer/src/components/OrderRow.tsx | 73 +- .../src/components/PageLayout.module.css | 4 +- .../src/components/Sidebar.module.css | 30 +- apps/customer/src/components/Sidebar.tsx | 41 +- .../checkout/CheckoutBackButton.module.css | 4 + .../src/context/TenantBrandingContext.tsx | 15 +- apps/customer/src/i18n/messages.ts | 506 ++++++++++++++ apps/customer/src/i18n/useT.ts | 13 + apps/customer/src/index.css | 4 +- .../src/pages/AddressesPage.module.css | 136 +++- apps/customer/src/pages/AddressesPage.tsx | 366 +++++------ apps/customer/src/pages/FavoritesPage.tsx | 24 +- apps/customer/src/pages/HomePage.tsx | 91 +-- apps/customer/src/pages/LoginPage.module.css | 13 +- apps/customer/src/pages/LoginPage.tsx | 136 ++-- apps/customer/src/pages/OrdersPage.module.css | 11 +- apps/customer/src/pages/OrdersPage.tsx | 58 +- apps/customer/src/pages/ProfilePage.tsx | 81 ++- apps/customer/src/services/authService.ts | 2 + apps/customer/src/services/orderService.ts | 1 + apps/customer/src/services/tenantService.ts | 2 + apps/customer/src/utils/applyBusinessTheme.ts | 8 + .../src/utils/businessPrimaryColors.ts | 26 + apps/customer/src/utils/orderSteps.ts | 66 +- apps/customer/src/utils/storeProductGroups.ts | 5 +- apps/super-admin/index.html | 2 +- .../src/components/Header.module.css | 7 - apps/super-admin/src/components/Header.tsx | 7 - .../src/components/SectionCard.module.css | 9 + apps/super-admin/src/index.css | 11 +- .../src/pages/BusinessesPage.module.css | 41 ++ apps/super-admin/src/pages/BusinessesPage.tsx | 114 +++- apps/super-admin/src/pages/ProfilePage.tsx | 34 +- .../src/services/businessSettingsService.ts | 27 + .../src/services/profileService.ts | 2 + apps/super-admin/src/types/auth.ts | 2 + apps/super-admin/src/types/business.ts | 2 + apps/super-admin/src/types/profile.ts | 2 + .../src/utils/applyBusinessTheme.ts | 42 ++ .../src/utils/businessPrimaryColors.ts | 42 ++ docs/PROJECT_CONTEXT.md | 41 +- packages/dashboard-core/src/index.ts | 10 + .../src/locale/dashboardLocale.ts | 37 ++ packages/dashboard-core/src/styles/tokens.css | 76 ++- packages/dashboard-core/src/types/auth.ts | 2 + .../components/AddressListEditor.module.css | 2 +- .../src/components/AddressListEditor.tsx | 68 +- .../src/components/LanguageSelect.module.css | 64 ++ .../src/components/LanguageSelect.tsx | 33 + .../components/PasswordResetModal.module.css | 2 +- .../src/components/SectionCard.module.css | 8 + .../src/context/LocaleContext.tsx | 66 ++ packages/dashboard-ui/src/index.ts | 3 + 112 files changed, 4338 insertions(+), 1061 deletions(-) create mode 100644 apps/business/src/components/DailyActivityChart.module.css create mode 100644 apps/business/src/components/DailyActivityChart.tsx create mode 100644 apps/business/src/i18n/messages.ts create mode 100644 apps/business/src/i18n/useT.ts create mode 100644 apps/business/src/services/dailyActivityService.ts create mode 100644 apps/customer/src/components/AddressFormModal.module.css create mode 100644 apps/customer/src/components/AddressFormModal.tsx create mode 100644 apps/customer/src/i18n/messages.ts create mode 100644 apps/customer/src/i18n/useT.ts create mode 100644 apps/super-admin/src/utils/applyBusinessTheme.ts create mode 100644 packages/dashboard-core/src/locale/dashboardLocale.ts create mode 100644 packages/dashboard-ui/src/components/LanguageSelect.module.css create mode 100644 packages/dashboard-ui/src/components/LanguageSelect.tsx create mode 100644 packages/dashboard-ui/src/context/LocaleContext.tsx diff --git a/apps/business/index.html b/apps/business/index.html index 715411a..730e9df 100644 --- a/apps/business/index.html +++ b/apps/business/index.html @@ -7,7 +7,7 @@ Business Dashboard +
diff --git a/apps/business/src/App.tsx b/apps/business/src/App.tsx index f0d9720..6e82b64 100644 --- a/apps/business/src/App.tsx +++ b/apps/business/src/App.tsx @@ -4,6 +4,7 @@ import { DashboardDocumentTitle } from './components/DashboardDocumentTitle' import { AuthProvider } from './context/AuthContext' import { BusinessThemeProvider } from './context/BusinessThemeContext' import { TenantBrandingProvider } from './context/TenantBrandingContext' +import { LocaleProvider } from '@meshkee/dashboard-ui' import { ToastProvider } from './context/ToastContext' import { ProtectedRoute } from './components/ProtectedRoute' import { GuestRoute } from './components/GuestRoute' @@ -50,6 +51,7 @@ import { WebsiteSpecialBrandsPage } from './pages/WebsiteSpecialBrandsPage' function App() { return ( + @@ -111,6 +113,7 @@ function App() { + ) } diff --git a/apps/business/src/components/Breadcrumbs.module.css b/apps/business/src/components/Breadcrumbs.module.css index be4529c..204e961 100644 --- a/apps/business/src/components/Breadcrumbs.module.css +++ b/apps/business/src/components/Breadcrumbs.module.css @@ -21,6 +21,10 @@ color: var(--text-muted); } +:global([dir='rtl']) .separator { + transform: scaleX(-1); +} + .link { font-size: 14px; font-weight: 500; diff --git a/apps/business/src/components/Breadcrumbs.tsx b/apps/business/src/components/Breadcrumbs.tsx index 1924ac9..4cab863 100644 --- a/apps/business/src/components/Breadcrumbs.tsx +++ b/apps/business/src/components/Breadcrumbs.tsx @@ -1,5 +1,8 @@ import { Link } from 'react-router-dom' import { ChevronRight } from 'lucide-react' +import { useLocale } from '@meshkee/dashboard-ui' +import { translateBreadcrumbLabel } from '../i18n/messages' +import { useT } from '../i18n/useT' import styles from './Breadcrumbs.module.css' export interface BreadcrumbItem { @@ -12,11 +15,15 @@ interface BreadcrumbsProps { } export function Breadcrumbs({ items }: BreadcrumbsProps) { + const { locale } = useLocale() + const t = useT() + return ( -