change url param name to "subdomain"

This commit is contained in:
2025-10-31 13:56:20 +03:00
parent 42d0b2cacf
commit 3dddc78dda
24 changed files with 89 additions and 116 deletions

View File

@@ -1,10 +1,10 @@
import {
BgColorsOutlined,
HomeOutlined,
LoginOutlined,
LogoutOutlined,
MenuOutlined,
TranslationOutlined,
BgColorsOutlined,
HomeOutlined,
LoginOutlined,
LogoutOutlined,
MenuOutlined,
TranslationOutlined,
} from "@ant-design/icons";
import { logoutThunk } from "features/auth/authSlice";
import { setLocale, setLocalesThunk } from "features/locale/localeSlice";
@@ -16,7 +16,7 @@ import { useAppDispatch, useAppSelector } from "redux/hooks";
import { ACCESS_TOKEN } from "utils/constants";
export default function useHeaderMenu() {
const { id } = useParams();
const { subdomain } = useParams();
const dispatch = useAppDispatch();
const { t } = useTranslation();
const { isRTL } = useAppSelector((state) => state.locale);
@@ -63,9 +63,9 @@ export default function useHeaderMenu() {
style={{ color: themeName === "dark" ? "white" : "#1f2937" }}
/>
),
label: <Link to={`/${id}/orders`}>{t("common.myOrder")}</Link>,
label: <Link to={`/${subdomain}/orders`}>{t("common.myOrder")}</Link>,
onClick: () => {
navigate(`/${id}/orders`);
navigate(`/${subdomain}/orders`);
},
},
{
@@ -75,7 +75,7 @@ export default function useHeaderMenu() {
style={{ color: themeName === "dark" ? "white" : "#1f2937" }}
/>
),
label: <Link to={`/${id}/menu`}>{t("common.branches")}</Link>,
label: <Link to={`/${subdomain}/menu`}>{t("common.branches")}</Link>,
},
...(!token ? [{
key: "login",
@@ -84,9 +84,9 @@ export default function useHeaderMenu() {
style={{ color: themeName === "dark" ? "white" : "#1f2937" }}
/>
),
label: <Link to={`/${id}/login`}>{t("common.login")}</Link>,
label: <Link to={`/${subdomain}/login`}>{t("common.login")}</Link>,
onClick: () => {
navigate(`/${id}/login`);
navigate(`/${subdomain}/login`);
},
}] : []),
...(token ? [{