use restaurant currency

This commit is contained in:
2025-11-12 23:34:21 +03:00
parent df43d46ed2
commit 17b2f18957

View File

@@ -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>