menu: make back btn navigate to service page if token existed

This commit is contained in:
2026-01-14 15:28:39 +03:00
parent a337ee11e2
commit 41605781f4
2 changed files with 13 additions and 4 deletions

View File

@@ -38,6 +38,7 @@ function MenuPage() {
const { subdomain } = useParams();
const { isRTL } = useAppSelector((state) => state.locale);
const { orderType } = useAppSelector((state) => state.order);
const { token } = useAppSelector((state) => state.auth);
const { t } = useTranslation();
const { data: restaurant, isLoading: isLoadingRestaurant } =
useGetRestaurantDetailsQuery(subdomain, {
@@ -91,7 +92,9 @@ function MenuPage() {
<div
className={`${styles.headerFloatingBtn} ${styles.backButtonContainer}`}
>
<BackButton />
<BackButton
{...(token ? { customRoute: `/${subdomain}` } : {})}
/>
</div>
<div
className={`${styles.headerFloatingBtn} ${styles.orderTypeSelectContainer} order-type-select-container`}