gift: enhance items flow
This commit is contained in:
@@ -16,6 +16,7 @@ import TimeEstimateCard from "pages/cart/components/timeEstimate/TimeEstimateCar
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
import GiftAmountCard from "./components/GiftAmountCard/GiftAmountCard";
|
||||
import { GiftAmountBottomSheet } from "./components/GiftAmountBottomSheet";
|
||||
import PickupTimeCard from "pages/checkout/components/pickupEstimate/TimeEstimateCard";
|
||||
|
||||
export default function CardDetailsPage() {
|
||||
const { t } = useTranslation();
|
||||
@@ -168,7 +169,7 @@ export default function CardDetailsPage() {
|
||||
)}
|
||||
<ReceivernformationCard />
|
||||
<SenderformationCard />
|
||||
<TimeEstimateCard />
|
||||
<PickupTimeCard />
|
||||
</Form>
|
||||
</Layout.Content>
|
||||
<Layout.Footer className={styles.checkoutButtonContainer}>
|
||||
|
||||
@@ -15,6 +15,7 @@ import { useMemo, useState } from "react";
|
||||
import CardAmountIcon from "components/Icons/CardAmountIcon";
|
||||
import ArabicPrice from "components/ArabicPrice";
|
||||
import { GiftAmountBottomSheet } from "pages/CardDetails/components/GiftAmountBottomSheet";
|
||||
import { GiftType } from "components/CustomBottomSheet/GiftTypeBottomSheet";
|
||||
|
||||
export function GiftCard() {
|
||||
const { t } = useTranslation();
|
||||
@@ -32,6 +33,8 @@ export function GiftCard() {
|
||||
const [isGiftAmountBottomSheetOpen, setIsGiftAmountBottomSheetOpen] =
|
||||
useState(false);
|
||||
|
||||
console.log(giftDetails?.giftType);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ProInputCard title={t("address.giftDetails")}>
|
||||
@@ -108,10 +111,12 @@ export function GiftCard() {
|
||||
</div>
|
||||
{isRTL ? <BackIcon iconSize={24} /> : <NextIcon iconSize={24} />}
|
||||
</div>
|
||||
|
||||
<Divider style={{ margin: "10px 0" }} />
|
||||
|
||||
{giftDetails?.giftType === "vouchers" ||
|
||||
(giftDetails?.giftType === "itemsAndVouchers" && (
|
||||
{(giftDetails?.giftType === GiftType.Vouchers ||
|
||||
giftDetails?.giftType === GiftType.ItemsAndVouchers) && (
|
||||
<>
|
||||
<div
|
||||
className={styles.orderNotes}
|
||||
onClick={() => {
|
||||
@@ -164,46 +169,49 @@ export function GiftCard() {
|
||||
</div>
|
||||
{isRTL ? <BackIcon iconSize={24} /> : <NextIcon iconSize={24} />}
|
||||
</div>
|
||||
))}
|
||||
{giftDetails?.giftType === GiftType.ItemsAndVouchers && (
|
||||
<Divider style={{ margin: "10px 0" }} />
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
<Divider style={{ margin: "10px 0" }} />
|
||||
{giftDetails?.giftType === "items" ||
|
||||
(giftDetails?.giftType === "itemsAndVouchers" && (
|
||||
<div
|
||||
{(giftDetails?.giftType === GiftType.Items ||
|
||||
giftDetails?.giftType === GiftType.ItemsAndVouchers) && (
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "row",
|
||||
justifyContent: "space-between",
|
||||
}}
|
||||
onClick={() => {
|
||||
navigate(`/${subdomain}/cart`);
|
||||
}}
|
||||
>
|
||||
<ProText
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "row",
|
||||
justifyContent: "space-between",
|
||||
}}
|
||||
onClick={() => {
|
||||
navigate(`/${subdomain}/cart`);
|
||||
fontWeight: 400,
|
||||
fontStyle: "Regular",
|
||||
fontSize: 12,
|
||||
lineHeight: "140%",
|
||||
letterSpacing: "0%",
|
||||
color: "#777580",
|
||||
cursor: "pointer",
|
||||
}}
|
||||
>
|
||||
<ProText
|
||||
<span
|
||||
style={{
|
||||
fontWeight: 400,
|
||||
fontStyle: "Regular",
|
||||
fontSize: 12,
|
||||
lineHeight: "140%",
|
||||
letterSpacing: "0%",
|
||||
color: "#777580",
|
||||
cursor: "pointer",
|
||||
[isRTL ? "marginLeft" : "marginRight"]: 5,
|
||||
position: "relative",
|
||||
top: 3.5,
|
||||
}}
|
||||
>
|
||||
<span
|
||||
style={{
|
||||
[isRTL ? "marginLeft" : "marginRight"]: 5,
|
||||
position: "relative",
|
||||
top: 3.5,
|
||||
}}
|
||||
>
|
||||
<InvoiceIcon />
|
||||
</span>
|
||||
{t("checkout.viewOrder")} ( {totalItems} {t("cart.items")} )
|
||||
</ProText>
|
||||
{isRTL ? <BackIcon /> : <NextIcon />}
|
||||
</div>
|
||||
))}
|
||||
<InvoiceIcon />
|
||||
</span>
|
||||
{t("checkout.viewOrder")} ( {totalItems} {t("cart.items")} )
|
||||
</ProText>
|
||||
{isRTL ? <BackIcon /> : <NextIcon />}
|
||||
</div>
|
||||
)}
|
||||
</ProInputCard>
|
||||
<GiftAmountBottomSheet
|
||||
isOpen={isGiftAmountBottomSheetOpen}
|
||||
|
||||
@@ -85,7 +85,7 @@ export default function CheckoutPage() {
|
||||
<OfficeDetails /> */}
|
||||
{/* <GiftDetails /> */}
|
||||
{/* <BriefMenu /> */}
|
||||
{orderType !== OrderType.Redeem && <CouponCard />}
|
||||
{orderType !== OrderType.Redeem && orderType !== OrderType.Gift && <CouponCard />}
|
||||
|
||||
{/* Collection Method */}
|
||||
{orderType === OrderType.Pickup && (
|
||||
@@ -123,7 +123,7 @@ export default function CheckoutPage() {
|
||||
)}
|
||||
|
||||
{/* Reward Your Waiter */}
|
||||
{orderType !== OrderType.Redeem && <RewardWaiterCard />}
|
||||
{orderType !== OrderType.Redeem && orderType !== OrderType.Gift && <RewardWaiterCard />}
|
||||
<BriefMenuCard />
|
||||
<Ads1 />
|
||||
<OrderSummary />
|
||||
|
||||
@@ -44,13 +44,7 @@ export function MenuFooter() {
|
||||
}}
|
||||
>
|
||||
<Link
|
||||
to={
|
||||
totalItems === 0
|
||||
? "#"
|
||||
: orderType === OrderType.Pay
|
||||
? `/${subdomain}/pay`
|
||||
: `/${subdomain}/cart`
|
||||
}
|
||||
to={totalItems === 0 ? "#" : `/${subdomain}/cart`}
|
||||
onClick={(e) => {
|
||||
if (totalItems === 0) {
|
||||
e.preventDefault();
|
||||
@@ -106,9 +100,7 @@ export function MenuFooter() {
|
||||
margin: "0 10px",
|
||||
}}
|
||||
>
|
||||
{orderType === OrderType.Pay
|
||||
? t("menu.pay")
|
||||
: t("menu.viewCart")}
|
||||
{t("menu.viewCart")}
|
||||
</ProText>
|
||||
</Button>
|
||||
<div
|
||||
|
||||
@@ -260,7 +260,6 @@ export default function RestaurantServices() {
|
||||
onClose={() => setIsGiftTypeBottomSheetOpen(false)}
|
||||
onSave={() => {
|
||||
setIsGiftTypeBottomSheetOpen(false);
|
||||
navigate(`/${subdomain}/menu?orderType=${OrderType.Gift}`);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user