OrderTypesBottomSheet: initial commit
This commit is contained in:
@@ -189,7 +189,10 @@ export function CategoriesList({ categories }: CategoriesListProps) {
|
||||
data-category-id={category.id}
|
||||
style={{
|
||||
borderRadius: 8,
|
||||
border: "none",
|
||||
borderTop: "none",
|
||||
borderRight: "none",
|
||||
borderBottom: "none",
|
||||
borderLeft: "none",
|
||||
backgroundColor: isCategoriesSticky ? "transparent" : "var(--background)",
|
||||
}}
|
||||
styles={{
|
||||
@@ -232,7 +235,7 @@ export function CategoriesList({ categories }: CategoriesListProps) {
|
||||
)}
|
||||
|
||||
<Space
|
||||
direction="vertical"
|
||||
orientation="vertical"
|
||||
size="small"
|
||||
style={{
|
||||
flex: 1,
|
||||
@@ -274,7 +277,6 @@ export function CategoriesList({ categories }: CategoriesListProps) {
|
||||
width: 104,
|
||||
height: 30,
|
||||
marginBottom: 1,
|
||||
border: "none",
|
||||
}}
|
||||
>
|
||||
<ProText
|
||||
|
||||
@@ -11,7 +11,7 @@ import useBreakPoint from "hooks/useBreakPoint";
|
||||
import { useRestaurant } from "hooks/useRestaurant";
|
||||
import { OrderType } from "pages/checkout/hooks/types.ts";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useParams, useSearchParams } from "react-router-dom";
|
||||
import { useParams } from "react-router-dom";
|
||||
import {
|
||||
useGetMenuQuery,
|
||||
useGetRestaurantDetailsQuery,
|
||||
@@ -33,11 +33,10 @@ import NextIcon from "components/Icons/NextIcon";
|
||||
import { OpeningTimesBottomSheet } from "components/CustomBottomSheet/OpeningTimesBottomSheet";
|
||||
import { useState } from "react";
|
||||
import BackIcon from "components/Icons/BackIcon";
|
||||
import { OrderTypesBottomSheet } from "components/CustomBottomSheet/OrderTypesBottomSheet";
|
||||
|
||||
function MenuPage() {
|
||||
const { subdomain } = useParams();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const [_, setSearchParams] = useSearchParams();
|
||||
const { isRTL } = useAppSelector((state) => state.locale);
|
||||
const { orderType } = useAppSelector((state) => state.order);
|
||||
const { t } = useTranslation();
|
||||
@@ -55,6 +54,7 @@ function MenuPage() {
|
||||
const { isMobile, isTablet, isDesktop } = useBreakPoint();
|
||||
const isLoading = isLoadingRestaurant || isLoadingMenu;
|
||||
const [isOpeningTimesOpen, setIsOpeningTimesOpen] = useState(false);
|
||||
const [isOrderTypesOpen, setIsOrderTypesOpen] = useState(false);
|
||||
const orderTypeOptions = enumToSelectOptions(OrderType, t, "orderTypes");
|
||||
|
||||
// Automatically load restaurant taxes when restaurant data is available
|
||||
@@ -99,16 +99,18 @@ function MenuPage() {
|
||||
>
|
||||
<Select
|
||||
value={orderType}
|
||||
onChange={(value) => {
|
||||
setSearchParams({ orderType: value });
|
||||
}}
|
||||
options={orderTypeOptions}
|
||||
open={false}
|
||||
onOpenChange={() => false}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
setIsOrderTypesOpen(true);
|
||||
}}
|
||||
variant="borderless"
|
||||
size="small"
|
||||
className={styles.orderTypeSelect}
|
||||
classNames={{ popup: { root: "order-type-select-dropdown" } }}
|
||||
listHeight={150}
|
||||
disabled
|
||||
/>
|
||||
</div>
|
||||
<SearchButton />
|
||||
@@ -139,7 +141,7 @@ function MenuPage() {
|
||||
/>
|
||||
)
|
||||
}
|
||||
iconPosition="end"
|
||||
iconPlacement="end"
|
||||
onClick={() => setIsOpeningTimesOpen(true)}
|
||||
>
|
||||
{restaurant?.isOpened ? t("menu.open") : t("menu.close")}
|
||||
@@ -185,6 +187,10 @@ function MenuPage() {
|
||||
isOpen={isOpeningTimesOpen}
|
||||
onClose={() => setIsOpeningTimesOpen(false)}
|
||||
/>
|
||||
<OrderTypesBottomSheet
|
||||
isOpen={isOrderTypesOpen}
|
||||
onClose={() => setIsOrderTypesOpen(false)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user