use restaurant currency
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { useAppSelector } from "redux/hooks";
|
import { useAppSelector } from "redux/hooks";
|
||||||
import ProText from "../ProText";
|
import ProText from "../ProText";
|
||||||
|
|
||||||
@@ -20,8 +19,9 @@ const ArabicPrice: React.FC<ArabicPriceProps> = ({
|
|||||||
className,
|
className,
|
||||||
hideCurrency = false,
|
hideCurrency = false,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
|
||||||
const { isRTL } = useAppSelector((state) => state.locale);
|
const { isRTL } = useAppSelector((state) => state.locale);
|
||||||
|
const {restaurant} = useAppSelector(state => state.order)
|
||||||
|
|
||||||
|
|
||||||
// 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;
|
||||||
@@ -64,7 +64,7 @@ const ArabicPrice: React.FC<ArabicPriceProps> = ({
|
|||||||
...(decorationStyle ?? {}),
|
...(decorationStyle ?? {}),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("common.omanCurrency")}
|
{isRTL ? restaurant.local_currency : restaurant.global_currency}
|
||||||
</span>
|
</span>
|
||||||
</>
|
</>
|
||||||
) : !hideCurrency ? (
|
) : !hideCurrency ? (
|
||||||
@@ -88,8 +88,8 @@ const ArabicPrice: React.FC<ArabicPriceProps> = ({
|
|||||||
...(decorationStyle ?? {}),
|
...(decorationStyle ?? {}),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("common.omanCurrency")}
|
{isRTL ? restaurant.local_currency : restaurant.global_currency}
|
||||||
</span>
|
</span>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<span style={decorationStyle}>{formattedPrice}</span>
|
<span style={decorationStyle}>{formattedPrice}</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user