Skip to content

Commit

Permalink
fix: adds conditional small class to price ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
brobro10000 committed Oct 2, 2024
1 parent b1a9e7f commit 65ad72c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/course/CourseSidebarPrice.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const CourseSidebarPrice = () => {
return <Skeleton containerTestId="course-price-skeleton" height={24} />;
}
const originalPriceDisplay = getContentPriceDisplay(coursePrice.listRange);
const hasPriceRange = coursePrice.listRange.length > 1;
const showOrigPrice = !enterpriseCustomer.hideCourseOriginalPrice;
const crossedOutOriginalPrice = (
<del>
Expand All @@ -36,7 +37,8 @@ const CourseSidebarPrice = () => {
defaultMessage="Priced reduced from:"
description="Message to indicate that the price has been reduced."
/>
</span>${originalPriceDisplay} {currency}
</span>
${originalPriceDisplay} {currency}
</del>
);

Expand Down Expand Up @@ -66,7 +68,9 @@ const CourseSidebarPrice = () => {
if (!hasDiscountedPrice && canRequestSubsidy) {
return (
<span style={{ whiteSpace: 'pre-wrap' }} data-testid="browse-and-request-pricing">
<s>${originalPriceDisplay} {currency}</s><br />
<s>
${originalPriceDisplay} {currency}
</s><br />
<FormattedMessage
id="enterprise.course.about.course.sidebar.price.free.when.approved"
defaultMessage="Free to me{br}(when approved)"
Expand Down Expand Up @@ -112,6 +116,7 @@ const CourseSidebarPrice = () => {
}
}
const discountedPriceDisplay = `${getContentPriceDisplay(coursePrice.discounted)} ${currency}`;
const hasDiscountedPriceRange = coursePrice.discounted.length > 1;
return (
<>
<div className={classNames({ 'mb-2': coursePrice.discounted > 0 || showOrigPrice })}>
Expand All @@ -125,7 +130,8 @@ const CourseSidebarPrice = () => {
defaultMessage="Discounted price:"
description="Message to indicate that the price has been discounted."
/>
</span>${discountedPriceDisplay}
</span>
${discountedPriceDisplay}
</>
)}
</div>
Expand Down

0 comments on commit 65ad72c

Please sign in to comment.