change url param name to "subdomain"
This commit is contained in:
@@ -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 ? [{
|
||||
|
||||
Reference in New Issue
Block a user