multi phones

This commit is contained in:
hamid zarghami
2026-06-29 12:15:52 +03:30
parent 6bdb3c80af
commit a14be45b76
3 changed files with 15 additions and 8 deletions
+11 -5
View File
@@ -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() {
)}
</section>
{(restaurant.phone || restaurant.telegram || restaurant.whatsapp || restaurant.instagram) && (
{(phoneList.length > 0 || restaurant.telegram || restaurant.whatsapp || restaurant.instagram) && (
<section
className={glassSurfaceCard('pt-3 pb-3.5 px-[16px] mt-4 grid grid-cols-3 items-center')}>
<h2 className='text-sm2 font-medium leading-5'>ارتباط</h2>
<div className='col-span-1 text-center flex justify-center gap-4'>
{restaurant.phone &&
<a href={`tel://${restaurant.phone}`} className='bg-[#EAEDF5] dark:bg-neutral-700 p-2 rounded-normal'>
<div className='col-span-2 text-center flex justify-center flex-wrap gap-2'>
{phoneList.map((phone) => (
<a key={phone} href={`tel://${phone}`} className='bg-[#EAEDF5] dark:bg-neutral-700 px-2 py-1.5 rounded-normal inline-flex items-center gap-1.5'>
<CallCalling className='stroke-foreground' size={24} />
<span dir='ltr' className='text-xs leading-5'>{phone}</span>
</a>
}
))}
{restaurant.telegram &&
<a href={`https://t.me/${restaurant.telegram}`} className='bg-[#EAEDF5] dark:bg-neutral-700 p-2 rounded-normal'>
<TelegramIcon className='stroke-foreground' width={24} height={24} />
+2 -1
View File
@@ -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;
+2 -2
View File
@@ -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";