multi phones
This commit is contained in:
@@ -30,6 +30,11 @@ function AboutPage() {
|
|||||||
|
|
||||||
const restaurant = aboutData?.data;
|
const restaurant = aboutData?.data;
|
||||||
const schedules = schedulesData?.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;
|
const isLoading = aboutLoading || reviewsLoading || schedulesLoading;
|
||||||
|
|
||||||
@@ -122,16 +127,17 @@ function AboutPage() {
|
|||||||
)}
|
)}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{(restaurant.phone || restaurant.telegram || restaurant.whatsapp || restaurant.instagram) && (
|
{(phoneList.length > 0 || restaurant.telegram || restaurant.whatsapp || restaurant.instagram) && (
|
||||||
<section
|
<section
|
||||||
className={glassSurfaceCard('pt-3 pb-3.5 px-[16px] mt-4 grid grid-cols-3 items-center')}>
|
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>
|
<h2 className='text-sm2 font-medium leading-5'>ارتباط</h2>
|
||||||
<div className='col-span-1 text-center flex justify-center gap-4'>
|
<div className='col-span-2 text-center flex justify-center flex-wrap gap-2'>
|
||||||
{restaurant.phone &&
|
{phoneList.map((phone) => (
|
||||||
<a href={`tel://${restaurant.phone}`} className='bg-[#EAEDF5] dark:bg-neutral-700 p-2 rounded-normal'>
|
<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} />
|
<CallCalling className='stroke-foreground' size={24} />
|
||||||
|
<span dir='ltr' className='text-xs leading-5'>{phone}</span>
|
||||||
</a>
|
</a>
|
||||||
}
|
))}
|
||||||
{restaurant.telegram &&
|
{restaurant.telegram &&
|
||||||
<a href={`https://t.me/${restaurant.telegram}`} className='bg-[#EAEDF5] dark:bg-neutral-700 p-2 rounded-normal'>
|
<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} />
|
<TelegramIcon className='stroke-foreground' width={24} height={24} />
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ export interface Restaurant {
|
|||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
establishedYear: number | null;
|
establishedYear: number | null;
|
||||||
phoneNumber: string | null;
|
phoneNumber: string | null;
|
||||||
phone: string;
|
phone?: string | null;
|
||||||
|
phones?: string[];
|
||||||
instagram: string | null;
|
instagram: string | null;
|
||||||
telegram: string | null;
|
telegram: string | null;
|
||||||
whatsapp: string | null;
|
whatsapp: string | null;
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
// export const API_BASE_URL = "https://dmenuplus-api-production.dev.danakcorp.com";
|
// 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 = "https://dmenu-api.danakcorp.com";
|
||||||
// export const API_BASE_URL = "http://192.168.99.131:2000";
|
export const API_BASE_URL = "http://192.168.99.131:2000";
|
||||||
export const TOKEN_NAME = "dmenu-t";
|
export const TOKEN_NAME = "dmenu-t";
|
||||||
export const REFRESH_TOKEN_NAME = "dmenu-rt";
|
export const REFRESH_TOKEN_NAME = "dmenu-rt";
|
||||||
|
|||||||
Reference in New Issue
Block a user