cart: Special request > move files
This commit is contained in:
@@ -15,7 +15,7 @@ import { selectCart } from "features/order/orderSlice.ts";
|
|||||||
import CarPlateCard from "pages/cart/components/CarPlateCard.tsx";
|
import CarPlateCard from "pages/cart/components/CarPlateCard.tsx";
|
||||||
import CouponCard from "pages/cart/components/CouponCard.tsx";
|
import CouponCard from "pages/cart/components/CouponCard.tsx";
|
||||||
import RewardWaiterCard from "pages/cart/components/RewardWaiterCard.tsx";
|
import RewardWaiterCard from "pages/cart/components/RewardWaiterCard.tsx";
|
||||||
import SpecialRequestCard from "pages/cart/components/SpecialRequestCard.tsx";
|
import SpecialRequestCard from "pages/cart/components/specialRequest/SpecialRequestCard.tsx";
|
||||||
import TableNumberCard from "pages/cart/components/TableNumberCard.tsx";
|
import TableNumberCard from "pages/cart/components/TableNumberCard.tsx";
|
||||||
import TimeEstimateCard from "pages/cart/components/timeEstimate/TimeEstimateCard.tsx";
|
import TimeEstimateCard from "pages/cart/components/timeEstimate/TimeEstimateCard.tsx";
|
||||||
import YouMightAlsoLike from "pages/cart/components/youMayLike/YouMightAlsoLike.tsx";
|
import YouMightAlsoLike from "pages/cart/components/youMayLike/YouMightAlsoLike.tsx";
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import OrderSummary from "components/OrderSummary/OrderSummary.tsx";
|
|||||||
import { useAppSelector } from "redux/hooks.ts";
|
import { useAppSelector } from "redux/hooks.ts";
|
||||||
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import SpecialRequestCard from "pages/cart/components/SpecialRequestCard.tsx";
|
import SpecialRequestCard from "pages/cart/components/specialRequest/SpecialRequestCard.tsx";
|
||||||
import useBreakPoint from "hooks/useBreakPoint.ts";
|
import useBreakPoint from "hooks/useBreakPoint.ts";
|
||||||
import CouponCard from "pages/cart/components/CouponCard.tsx";
|
import CouponCard from "pages/cart/components/CouponCard.tsx";
|
||||||
import RewardWaiterCard from "pages/cart/components/RewardWaiterCard.tsx";
|
import RewardWaiterCard from "pages/cart/components/RewardWaiterCard.tsx";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Button, Input } from "antd";
|
import { Button, Input } from "antd";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { ProBottomSheet } from "../ProBottomSheet/ProBottomSheet";
|
import { ProBottomSheet } from "components/ProBottomSheet/ProBottomSheet.tsx";
|
||||||
|
|
||||||
const { TextArea } = Input;
|
const { TextArea } = Input;
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ interface SpecialRequestBottomSheetProps {
|
|||||||
onSave: (value: string) => void;
|
onSave: (value: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SpecialRequestBottomSheet({
|
export function BottomSheet({
|
||||||
isOpen,
|
isOpen,
|
||||||
onClose,
|
onClose,
|
||||||
initialValue,
|
initialValue,
|
||||||
@@ -11,7 +11,7 @@ interface SpecialRequestDialogProps {
|
|||||||
onSave: (value: string) => void;
|
onSave: (value: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SpecialRequestDialog({
|
export function Dialog({
|
||||||
isOpen,
|
isOpen,
|
||||||
onClose,
|
onClose,
|
||||||
initialValue,
|
initialValue,
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
.inputField {
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editButton {
|
||||||
|
color: var(--primary, #FFB700);
|
||||||
|
font-size: 14px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
@@ -3,12 +3,12 @@ import { message, Input } from "antd";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useAppDispatch, useAppSelector } from "redux/hooks.ts";
|
import { useAppDispatch, useAppSelector } from "redux/hooks.ts";
|
||||||
import ProInputCard from "components/ProInputCard/ProInputCard.tsx";
|
import ProInputCard from "components/ProInputCard/ProInputCard.tsx";
|
||||||
import { colors } from "ThemeConstants.ts";
|
|
||||||
import { RightOutlined } from "@ant-design/icons";
|
import { RightOutlined } from "@ant-design/icons";
|
||||||
import { SpecialRequestBottomSheet } from "components/CustomBottomSheet/SpecialRequestBottomSheet.tsx";
|
import { BottomSheet } from "pages/cart/components/specialRequest/BottomSheet.tsx";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import useBreakPoint from "hooks/useBreakPoint.ts";
|
import useBreakPoint from "hooks/useBreakPoint.ts";
|
||||||
import { SpecialRequestDialog } from "components/CustomBottomSheet/SpecialRequestDialog.tsx";
|
import { Dialog } from "pages/cart/components/specialRequest/Dialog.tsx";
|
||||||
|
import styles from "./SpecialRequestCard.module.css";
|
||||||
|
|
||||||
export default function SpecialRequestCard() {
|
export default function SpecialRequestCard() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -34,14 +34,10 @@ export default function SpecialRequestCard() {
|
|||||||
placeholder={t("cart.specialRequest")}
|
placeholder={t("cart.specialRequest")}
|
||||||
size="large"
|
size="large"
|
||||||
autoFocus={false}
|
autoFocus={false}
|
||||||
style={{ height: 50 }}
|
className={styles.inputField}
|
||||||
suffix={
|
suffix={
|
||||||
<div
|
<div
|
||||||
style={{
|
className={styles.editButton}
|
||||||
color: colors.primary,
|
|
||||||
fontSize: 14,
|
|
||||||
cursor: "pointer",
|
|
||||||
}}
|
|
||||||
onClick={() => setIsSpecialRequestOpen(true)}
|
onClick={() => setIsSpecialRequestOpen(true)}
|
||||||
>
|
>
|
||||||
<u>{t("cart.editNote")}</u> <RightOutlined />
|
<u>{t("cart.editNote")}</u> <RightOutlined />
|
||||||
@@ -50,14 +46,14 @@ export default function SpecialRequestCard() {
|
|||||||
/>
|
/>
|
||||||
</ProInputCard>
|
</ProInputCard>
|
||||||
{isDesktop ? (
|
{isDesktop ? (
|
||||||
<SpecialRequestDialog
|
<Dialog
|
||||||
isOpen={isSpecialRequestOpen}
|
isOpen={isSpecialRequestOpen}
|
||||||
onClose={handleSpecialRequestClose}
|
onClose={handleSpecialRequestClose}
|
||||||
initialValue={specialRequest}
|
initialValue={specialRequest}
|
||||||
onSave={handleSpecialRequestSave}
|
onSave={handleSpecialRequestSave}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<SpecialRequestBottomSheet
|
<BottomSheet
|
||||||
isOpen={isSpecialRequestOpen}
|
isOpen={isSpecialRequestOpen}
|
||||||
onClose={handleSpecialRequestClose}
|
onClose={handleSpecialRequestClose}
|
||||||
initialValue={specialRequest}
|
initialValue={specialRequest}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ShoppingCartOutlined } from "@ant-design/icons";
|
import { ShoppingCartOutlined } from "@ant-design/icons";
|
||||||
import { Button, Grid, message, Row } from "antd";
|
import { Button, Grid, message, Row } from "antd";
|
||||||
import { SpecialRequestBottomSheet } from "components/CustomBottomSheet/SpecialRequestBottomSheet";
|
import { BottomSheet } from "pages/cart/components/specialRequest/BottomSheet.tsx";
|
||||||
import {
|
import {
|
||||||
addItem,
|
addItem,
|
||||||
selectCart,
|
selectCart,
|
||||||
@@ -59,7 +59,7 @@ export default function ProductFooter({
|
|||||||
extrasgroup: selectedGroups,
|
extrasgroup: selectedGroups,
|
||||||
},
|
},
|
||||||
quantity: quantity,
|
quantity: quantity,
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
// Navigate back to menu - scroll position will be restored automatically
|
// Navigate back to menu - scroll position will be restored automatically
|
||||||
window.history.back();
|
window.history.back();
|
||||||
@@ -132,7 +132,7 @@ export default function ProductFooter({
|
|||||||
</div>
|
</div>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<SpecialRequestBottomSheet
|
<BottomSheet
|
||||||
isOpen={isSpecialRequestOpen}
|
isOpen={isSpecialRequestOpen}
|
||||||
onClose={handleSpecialRequestClose}
|
onClose={handleSpecialRequestClose}
|
||||||
initialValue={specialRequest}
|
initialValue={specialRequest}
|
||||||
|
|||||||
Reference in New Issue
Block a user