Browse Source

truck routeboard default navigation

production
tommy 1 week ago
parent
commit
e79b1ed018
3 changed files with 12 additions and 5 deletions
  1. +8
    -1
      src/components/NavigationContent/NavigationContent.tsx
  2. +3
    -3
      src/components/Shop/ShopDetail.tsx
  3. +1
    -1
      src/components/Shop/TruckLaneDetail.tsx

+ 8
- 1
src/components/NavigationContent/NavigationContent.tsx View File

@@ -363,7 +363,7 @@ const NavigationContent: React.FC = () => {
id: "nav.settings.shopAndTruck",
icon: <Storefront />,
labelKey: "nav.settings.shopAndTruck",
path: "/settings/shop",
path: "/settings/shop/board",
},
{
id: "nav.settings.deliveryOrderFloor",
@@ -495,6 +495,13 @@ const NavigationContent: React.FC = () => {
if (!pathname.startsWith(p + "/")) return false;
// `/doworkbench` must not claim `/doworkbenchsearch` (prefix without trailing slash)
if (p === "/doworkbench" && pathname.startsWith("/doworkbenchsearch")) return false;
// Shop sub-routes (detail, truckdetail, legacy tab page) share one nav entry → board
if (
p === "/settings/shop/board" &&
(pathname === "/settings/shop" || pathname.startsWith("/settings/shop/"))
) {
return true;
}
return true;
});
matches.sort((a, b) => b.length - a.length);


+ 3
- 3
src/components/Shop/ShopDetail.tsx View File

@@ -325,7 +325,7 @@ const ShopDetail: React.FC = () => {
<Alert severity="error" sx={{ mb: 2 }}>
{error}
</Alert>
<Button onClick={() => router.push("/settings/shop?tab=0")}>{t("Back")}</Button>
<Button onClick={() => router.push("/settings/shop/board")}>{t("Back")}</Button>
</Box>
);
}
@@ -336,7 +336,7 @@ const ShopDetail: React.FC = () => {
<Alert severity="warning" sx={{ mb: 2 }}>
{t("Shop not found")}
</Alert>
<Button onClick={() => router.push("/settings/shop?tab=0")}>{t("Back")}</Button>
<Button onClick={() => router.push("/settings/shop/board")}>{t("Back")}</Button>
</Box>
);
}
@@ -347,7 +347,7 @@ const ShopDetail: React.FC = () => {
<CardContent>
<Box sx={{ display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2 }}>
<Typography variant="h6">{t("Shop Information")}</Typography>
<Button onClick={() => router.push("/settings/shop?tab=0")}>{t("Back")}</Button>
<Button onClick={() => router.push("/settings/shop/board")}>{t("Back")}</Button>
</Box>
<Box sx={{ display: "flex", flexDirection: "column", gap: 2 }}>


+ 1
- 1
src/components/Shop/TruckLaneDetail.tsx View File

@@ -493,7 +493,7 @@ const TruckLaneDetail: React.FC = () => {
};

const handleBack = () => {
router.push("/settings/shop?tab=1");
router.push("/settings/shop/board");
};

const handleOpenAddShopDialog = () => {


Loading…
Cancel
Save