From de7a782562a164f14ae516f6c040732f4151e7d7 Mon Sep 17 00:00:00 2001 From: Mahyar Khanbolooki Date: Tue, 12 Aug 2025 20:35:24 +0330 Subject: [PATCH] add: checkout, track and address map pages dark theme --- .../(Dialogs)/order/checkout/[id]/page.tsx | 16 +++++----- .../(Dialogs)/order/track/[id]/page.tsx | 5 +-- src/components/map/CustomMap.css | 12 ++++--- src/components/map/CustomMap.tsx | 32 +++++++++++-------- src/components/utils/Prompt.tsx | 4 +-- 5 files changed, 39 insertions(+), 30 deletions(-) diff --git a/src/app/[name]/(Dialogs)/order/checkout/[id]/page.tsx b/src/app/[name]/(Dialogs)/order/checkout/[id]/page.tsx index 7afc0c9..42bac58 100644 --- a/src/app/[name]/(Dialogs)/order/checkout/[id]/page.tsx +++ b/src/app/[name]/(Dialogs)/order/checkout/[id]/page.tsx @@ -90,11 +90,11 @@ function OrderDetailInex() {

{t("SectionAddress.Title")}

@@ -124,7 +124,7 @@ function OrderDetailInex() { > @@ -139,7 +139,7 @@ function OrderDetailInex() { @@ -222,7 +222,6 @@ function OrderDetailInex() {
{couponOptions.map(({ id, label, icon: Icon }) => (
- + changeCouponType(id)} @@ -246,7 +246,7 @@ function OrderDetailInex() { className={clsx( 'relative mt-6', couponType === '0' ? 'block' : 'hidden', - couponCode.length === 0 && 'text-border **:stroke-border' + couponCode.length === 0 && 'text-border **:stroke-border dark:text-neutral-500 dark:**:stroke-neutral-500' )} icon={TicketDiscount} placeholder={t("SectionCoupon.InputCouponCode.Placeholder")} @@ -279,11 +279,11 @@ function OrderDetailInex() {

{t("SectionSummary.Title")}

diff --git a/src/app/[name]/(Dialogs)/order/track/[id]/page.tsx b/src/app/[name]/(Dialogs)/order/track/[id]/page.tsx index 8d5960a..708762d 100644 --- a/src/app/[name]/(Dialogs)/order/track/[id]/page.tsx +++ b/src/app/[name]/(Dialogs)/order/track/[id]/page.tsx @@ -83,6 +83,7 @@ function OrderTrackingPage() { onZoomChange={handleZoomChange} onClick={handleMapClick} markerActive={false} + searchEnabled={false} />
@@ -103,7 +104,7 @@ function OrderTrackingPage() { >
-
+

ارسال توسط پیک رستوران


@@ -123,7 +124,7 @@ function OrderTrackingPage() { />
- + diff --git a/src/components/map/CustomMap.css b/src/components/map/CustomMap.css index a68bdfd..c8b1095 100644 --- a/src/components/map/CustomMap.css +++ b/src/components/map/CustomMap.css @@ -1,5 +1,5 @@ .map-google-style { - background-color: #f8f9fa; + background-color: var(--background); font-family: 'irancell', system-ui, -apple-system, sans-serif; } @@ -98,7 +98,7 @@ position: absolute; right: 20px; bottom: 40px; - background: rgba(255, 255, 255, 0.95); + background: var(--background); border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05); @@ -233,7 +233,7 @@ .map-search-results { margin-top: 12px; - background: rgba(255, 255, 255, 0.95); + background: var(--container); border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.05); @@ -248,7 +248,7 @@ border-bottom: 1px solid rgba(0,0,0,0.05); font-size: 13px; font-weight: 400; - color: #1f2937; + color: var(--foreground); cursor: pointer; display: block; width: 100%; @@ -264,6 +264,10 @@ color: #2563eb; } +[data-theme="dark"] .map-search-result-item:hover { + color: var(--disabled-text); +} + .map-search-result-item:active { background-color: rgba(59, 130, 246, 0.1); } diff --git a/src/components/map/CustomMap.tsx b/src/components/map/CustomMap.tsx index 9ffdcc7..53cbf76 100644 --- a/src/components/map/CustomMap.tsx +++ b/src/components/map/CustomMap.tsx @@ -20,6 +20,7 @@ interface CustomMapProps { onPositionSelect?: (position: [number, number]) => void; onZoomChange?: (zoom: number) => void; onClick?: (event: L.LeafletMouseEvent) => void; + searchEnabled?: boolean markerActive?: boolean } @@ -85,7 +86,8 @@ const CustomMap: React.FC = ({ onPositionSelect, onZoomChange, onClick, - markerActive = true + markerActive = true, + searchEnabled = true, }) => { const [selectedPosition, setSelectedPosition] = useState<[number, number] | null>(null); const [mapInstance, setMapInstance] = useState(null); @@ -208,19 +210,21 @@ const CustomMap: React.FC = ({ return (
- { - // Find the full result object with position - const result = searchResults.find(r => r.id === v.id && r.title === v.title); - if (result) { - handleSearchResultSelect(result); - } - }} - /> + {searchEnabled && + { + // Find the full result object with position + const result = searchResults.find(r => r.id === v.id && r.title === v.title); + if (result) { + handleSearchResultSelect(result); + } + }} + /> + }
-