Skip to content

Commit

Permalink
Merge pull request #298 from khomyakov/X2-8166
Browse files Browse the repository at this point in the history
X2-8166   Correct Currency not Appearing when Viewing the Customer's Reservation in the Purchases Tab
  • Loading branch information
ranjantanya authored Jan 9, 2024
2 parents df91881 + d39341b commit 6a615b4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Breakdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Breakdown.propTypes = {
};

const BreakdownItem = ({ children, info, methodIcon, secondary, value, className, color = "default", ...rest }) => {
const { currency, locale } = useContext(CurrencyContext);
/** When BreakdownItem is directly used without outer <Breakdown /> component, the context would be `undefined` */
const { currency, locale } = useContext(CurrencyContext) ?? {};

return (
<tr className={clsx("ui-breakdown-item", colors[color], className)} {...rest}>
Expand Down Expand Up @@ -78,7 +79,7 @@ Breakdown.Item = BreakdownItem;
Breakdown.Item.displayName = "Breakdown.Item";

const BreakdownSubtotalItem = ({ children, info, value, className, color = "black", ...rest }) => {
const { currency, locale } = useContext(CurrencyContext);
const { currency, locale } = useContext(CurrencyContext) ?? {};

return (
<tr className={clsx("ui-breakdown-subtotal-item", "font-bold", colors[color], className)} {...rest}>
Expand Down

0 comments on commit 6a615b4

Please sign in to comment.