fix line-through styles
This commit is contained in:
@@ -25,6 +25,10 @@ const ArabicPrice: React.FC<ArabicPriceProps> = ({
|
|||||||
|
|
||||||
// Format the price to ensure it has 2 decimal places
|
// Format the price to ensure it has 2 decimal places
|
||||||
const formattedPrice = typeof price === "number" ? price.toFixed(2) : price;
|
const formattedPrice = typeof price === "number" ? price.toFixed(2) : price;
|
||||||
|
const { textDecoration, ...restStyle } = style;
|
||||||
|
const decorationStyle = textDecoration
|
||||||
|
? ({ textDecoration } as React.CSSProperties)
|
||||||
|
: undefined;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ProText
|
<ProText
|
||||||
@@ -36,7 +40,7 @@ const ArabicPrice: React.FC<ArabicPriceProps> = ({
|
|||||||
alignItems: "baseline",
|
alignItems: "baseline",
|
||||||
gap: "0.2em",
|
gap: "0.2em",
|
||||||
lineHeight: 1,
|
lineHeight: 1,
|
||||||
...style,
|
...restStyle,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{isRTL && !hideCurrency ? (
|
{isRTL && !hideCurrency ? (
|
||||||
@@ -45,6 +49,7 @@ const ArabicPrice: React.FC<ArabicPriceProps> = ({
|
|||||||
style={{
|
style={{
|
||||||
verticalAlign: "baseline",
|
verticalAlign: "baseline",
|
||||||
lineHeight: 1,
|
lineHeight: 1,
|
||||||
|
...(decorationStyle ?? {}),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{formattedPrice}
|
{formattedPrice}
|
||||||
@@ -56,6 +61,7 @@ const ArabicPrice: React.FC<ArabicPriceProps> = ({
|
|||||||
lineHeight: 1,
|
lineHeight: 1,
|
||||||
position: "relative",
|
position: "relative",
|
||||||
top: -3,
|
top: -3,
|
||||||
|
...(decorationStyle ?? {}),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("common.omanCurrency")}
|
{t("common.omanCurrency")}
|
||||||
@@ -68,6 +74,7 @@ const ArabicPrice: React.FC<ArabicPriceProps> = ({
|
|||||||
verticalAlign: "baseline",
|
verticalAlign: "baseline",
|
||||||
lineHeight: 1,
|
lineHeight: 1,
|
||||||
display: "inline-block",
|
display: "inline-block",
|
||||||
|
...(decorationStyle ?? {}),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{formattedPrice}
|
{formattedPrice}
|
||||||
@@ -78,13 +85,14 @@ const ArabicPrice: React.FC<ArabicPriceProps> = ({
|
|||||||
verticalAlign: "baseline",
|
verticalAlign: "baseline",
|
||||||
lineHeight: 1,
|
lineHeight: 1,
|
||||||
display: "inline-block",
|
display: "inline-block",
|
||||||
|
...(decorationStyle ?? {}),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("common.omanCurrency")}
|
{t("common.omanCurrency")}
|
||||||
</span>
|
</span>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>{formattedPrice}</>
|
<span style={decorationStyle}>{formattedPrice}</span>
|
||||||
)}
|
)}
|
||||||
</ProText>
|
</ProText>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -14,33 +14,29 @@ import { updateOrderType } from "features/order/orderSlice";
|
|||||||
import { OrderType } from "pages/checkout/hooks/types.ts";
|
import { OrderType } from "pages/checkout/hooks/types.ts";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Link, useParams } from "react-router-dom";
|
import { Link, useParams } from "react-router-dom";
|
||||||
|
import { useGetRestaurantDetailsQuery } from "redux/api/others";
|
||||||
import { useAppDispatch, useAppSelector } from "redux/hooks";
|
import { useAppDispatch, useAppSelector } from "redux/hooks";
|
||||||
import styles from "./restaurant.module.css";
|
import styles from "./restaurant.module.css";
|
||||||
|
|
||||||
interface RestaurantServicesProps {
|
export default function RestaurantServices() {
|
||||||
dineIn?: boolean;
|
|
||||||
pickup?: boolean;
|
|
||||||
gift?: boolean;
|
|
||||||
delivery?: boolean;
|
|
||||||
toRoom?: boolean;
|
|
||||||
toOffice?: boolean;
|
|
||||||
is_booking_enabled?: boolean;
|
|
||||||
params: { locale: string; id: string };
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function RestaurantServices({
|
|
||||||
dineIn,
|
|
||||||
pickup,
|
|
||||||
gift,
|
|
||||||
delivery,
|
|
||||||
toRoom,
|
|
||||||
toOffice,
|
|
||||||
is_booking_enabled,
|
|
||||||
}: RestaurantServicesProps) {
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { isRTL } = useAppSelector((state) => state.locale);
|
const { isRTL } = useAppSelector((state) => state.locale);
|
||||||
const { subdomain } = useParams();
|
const { subdomain } = useParams();
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
const { data: restaurant } = useGetRestaurantDetailsQuery(subdomain, {
|
||||||
|
skip: !subdomain,
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
dineIn,
|
||||||
|
pickup,
|
||||||
|
gift,
|
||||||
|
toRoom,
|
||||||
|
toOffice,
|
||||||
|
is_booking_enabled,
|
||||||
|
delivery,
|
||||||
|
is_schedule_order_enabled,
|
||||||
|
} = restaurant || {};
|
||||||
|
|
||||||
const services = [
|
const services = [
|
||||||
...((dineIn && [
|
...((dineIn && [
|
||||||
@@ -146,21 +142,21 @@ export default function RestaurantServices({
|
|||||||
},
|
},
|
||||||
]) ||
|
]) ||
|
||||||
[]),
|
[]),
|
||||||
...((true && [
|
...((is_schedule_order_enabled === 1 && [
|
||||||
{
|
{
|
||||||
id: OrderType.ScheduledOrder,
|
id: OrderType.ScheduledOrder,
|
||||||
title: t("common.scheduledOrder"),
|
title: t("common.scheduledOrder"),
|
||||||
description: t("home.services.scheduledOrder"),
|
description: t("home.services.scheduledOrder"),
|
||||||
icon: (
|
icon: (
|
||||||
<ScheduleFilled
|
<ScheduleFilled
|
||||||
className={styles.serviceIcon + " " + styles.scheduledOrderIcon}
|
className={styles.serviceIcon + " " + styles.scheduledOrderIcon}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
color: "bg-indigo-50 text-indigo-600",
|
color: "bg-indigo-50 text-indigo-600",
|
||||||
href: `/${subdomain}/menu?orderType=${OrderType.ScheduledOrder}`,
|
href: `/${subdomain}/menu?orderType=${OrderType.ScheduledOrder}`,
|
||||||
},
|
},
|
||||||
]) ||
|
]) ||
|
||||||
[]),
|
[]),
|
||||||
];
|
];
|
||||||
|
|
||||||
// Determine grid class based on number of services
|
// Determine grid class based on number of services
|
||||||
|
|||||||
@@ -104,16 +104,7 @@ export default function RestaurantPage() {
|
|||||||
</ProText>
|
</ProText>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<RestaurantServices
|
<RestaurantServices />
|
||||||
dineIn={restaurant?.dineIn}
|
|
||||||
pickup={restaurant?.pickup}
|
|
||||||
gift={restaurant?.gift}
|
|
||||||
delivery={restaurant?.delivery}
|
|
||||||
toRoom={restaurant?.toRoom}
|
|
||||||
toOffice={restaurant?.toOffice}
|
|
||||||
is_booking_enabled={restaurant?.is_booking_enabled === 1}
|
|
||||||
params={{ id: "1", locale: "en" }}
|
|
||||||
/>
|
|
||||||
<div
|
<div
|
||||||
ref={containerRef}
|
ref={containerRef}
|
||||||
onTouchStart={handleTouchStart}
|
onTouchStart={handleTouchStart}
|
||||||
|
|||||||
@@ -484,6 +484,7 @@ export interface RestaurantDetails {
|
|||||||
closingTime: string;
|
closingTime: string;
|
||||||
isOpened: boolean;
|
isOpened: boolean;
|
||||||
isFav: boolean;
|
isFav: boolean;
|
||||||
|
is_schedule_order_enabled: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Banner {
|
export interface Banner {
|
||||||
|
|||||||
Reference in New Issue
Block a user