From 788b05d6f4786170a8e4d0a0786ff3b67457fa93 Mon Sep 17 00:00:00 2001 From: Mohammed Al-yaseen Date: Thu, 15 Jan 2026 11:51:19 +0300 Subject: [PATCH] enhance openening times UI styles --- .../OpeningTimesBottomSheet.tsx | 240 ++++++++++++------ 1 file changed, 169 insertions(+), 71 deletions(-) diff --git a/src/components/CustomBottomSheet/OpeningTimesBottomSheet.tsx b/src/components/CustomBottomSheet/OpeningTimesBottomSheet.tsx index 5ddf76a..844fb86 100644 --- a/src/components/CustomBottomSheet/OpeningTimesBottomSheet.tsx +++ b/src/components/CustomBottomSheet/OpeningTimesBottomSheet.tsx @@ -1,4 +1,4 @@ -import { Button } from "antd"; +import { Card } from "antd"; import { useTranslation } from "react-i18next"; import { ProBottomSheet } from "../ProBottomSheet/ProBottomSheet"; import ProText from "components/ProText"; @@ -6,28 +6,13 @@ import ProTitle from "components/ProTitle"; import { useAppSelector } from "redux/hooks"; import { useGetOpeningTimesQuery } from "redux/api/others"; import { useMemo } from "react"; +import TimeIcon from "components/Icons/order/TimeIcon"; interface OpeningTimesBottomSheetProps { isOpen: boolean; onClose: () => void; } -const dayTextStyle: React.CSSProperties = { - fontWeight: 400, - fontStyle: "Regular", - fontSize: 14, - lineHeight: "140%", - letterSpacing: "0%", -}; - -const todayTextStyle: React.CSSProperties = { - fontWeight: 700, - fontStyle: "Bold", - fontSize: 14, - lineHeight: "140%", - letterSpacing: "0%", -}; - // Helper function to format time (HH:mm to 12h format) const formatTime = (time: string | null | undefined): string => { if (!time) return ""; @@ -107,87 +92,200 @@ export function OpeningTimesBottomSheet({ title={t("menu.openingTimes")} showCloseButton={false} initialSnap={1} - height={500} - snapPoints={[500]} + height={600} + snapPoints={[600]} >
{/* Address Section */} -
- - {t("menu.address")} - - - {isRTL ? restaurant?.addressAR : restaurant?.address} - -
- - {/* Opening Times Section */} -
- - {t("menu.openingTimes")} - +
+ + {t("menu.address")} + + + {isRTL ? restaurant?.addressAR : restaurant?.address} + +
+
+ + {/* Opening Times Section */} +
+
+ + + {t("menu.openingTimes")} + +
+ +
{days.map((day, index) => { const isToday = index === todayIndex; const { shift1, shift2 } = dayTimes[index]; const hasShifts = shift1 || shift2; - const timeDisplay = shift2 - ? `${shift1}, ${shift2}` - : shift1 || t("menu.closed"); return ( -
- - {t(`menu.${day}`)} - - - {timeDisplay} - -
+
+ {isToday && ( +
+ )} + + {t(`menu.${day}`)} + +
+ +
+ {hasShifts ? ( + <> + + {shift1} + + {shift2 && ( + + {shift2} + + )} + + ) : ( + + {t("menu.closed")} + + )} +
+
+ ); })}