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