From a14be45b76973429cf224f00a376f03935046d37 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Mon, 29 Jun 2026 12:15:52 +0330 Subject: [PATCH] multi phones --- src/app/[name]/(Main)/about/AboutPage.tsx | 16 +++++++++++----- src/app/[name]/(Main)/about/types/Types.ts | 3 ++- src/config/const.ts | 4 ++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/app/[name]/(Main)/about/AboutPage.tsx b/src/app/[name]/(Main)/about/AboutPage.tsx index df93658..d619b02 100644 --- a/src/app/[name]/(Main)/about/AboutPage.tsx +++ b/src/app/[name]/(Main)/about/AboutPage.tsx @@ -30,6 +30,11 @@ function AboutPage() { const restaurant = aboutData?.data; const schedules = schedulesData?.data || []; + const phoneList = Array.isArray(restaurant?.phones) + ? restaurant.phones.filter((phone): phone is string => Boolean(phone)) + : restaurant?.phone + ? [restaurant.phone] + : []; const isLoading = aboutLoading || reviewsLoading || schedulesLoading; @@ -122,16 +127,17 @@ function AboutPage() { )} - {(restaurant.phone || restaurant.telegram || restaurant.whatsapp || restaurant.instagram) && ( + {(phoneList.length > 0 || restaurant.telegram || restaurant.whatsapp || restaurant.instagram) && (

ارتباط

-
- {restaurant.phone && - +
+ {phoneList.map((phone) => ( + + {phone} - } + ))} {restaurant.telegram && diff --git a/src/app/[name]/(Main)/about/types/Types.ts b/src/app/[name]/(Main)/about/types/Types.ts index e8acdbd..f6cc196 100644 --- a/src/app/[name]/(Main)/about/types/Types.ts +++ b/src/app/[name]/(Main)/about/types/Types.ts @@ -32,7 +32,8 @@ export interface Restaurant { isActive: boolean; establishedYear: number | null; phoneNumber: string | null; - phone: string; + phone?: string | null; + phones?: string[]; instagram: string | null; telegram: string | null; whatsapp: string | null; diff --git a/src/config/const.ts b/src/config/const.ts index c7007b2..d6c6c30 100644 --- a/src/config/const.ts +++ b/src/config/const.ts @@ -1,5 +1,5 @@ // export const API_BASE_URL = "https://dmenuplus-api-production.dev.danakcorp.com"; -export const API_BASE_URL = "https://dmenu-api.danakcorp.com"; -// export const API_BASE_URL = "http://192.168.99.131:2000"; +// export const API_BASE_URL = "https://dmenu-api.danakcorp.com"; +export const API_BASE_URL = "http://192.168.99.131:2000"; export const TOKEN_NAME = "dmenu-t"; export const REFRESH_TOKEN_NAME = "dmenu-rt";