work on order type "select" in menu header

This commit is contained in:
2025-10-28 15:24:24 +03:00
parent 788bdc061d
commit 85ec18f6bb

View File

@@ -14,7 +14,7 @@ import {
useGetMenuQuery,
useGetRestaurantDetailsQuery,
} from "redux/api/others";
import { useAppSelector } from "redux/hooks";
import { useAppSelector, useAppDispatch } from "redux/hooks";
import { default_image } from "utils/constants";
import BackButton from "./components/BackButton";
import { CartButton } from "./components/CartButton/CartButton";
@@ -28,10 +28,13 @@ import SearchButton from "./components/SearchButton";
import styles from "./menu.module.css";
import { enumToSelectOptions } from "utils/helpers/helperFunctions.ts";
import { OrderType } from "pages/checkout/hooks/types.ts";
import { updateOrderType } from "features/order/orderSlice.ts";
function MenuPage() {
const { id } = useParams();
const dispatch = useAppDispatch();
const { isRTL } = useAppSelector((state) => state.locale);
const { orderType } = useAppSelector((state) => state.order);
const { t } = useTranslation();
const { data: restaurant, isLoading: isLoadingRestaurant } =
useGetRestaurantDetailsQuery("595", {
@@ -101,6 +104,10 @@ function MenuPage() {
className={`${styles.headerFloatingBtn} ${styles.orderTypeSelectContainer}`}
>
<Select
value={orderType}
onChange={(value) => {
dispatch(updateOrderType(value));
}}
options={orderTypeOptions}
variant="borderless"
size="small"