Skip to content

Commit 587760e

Browse files
committed
small changes
1 parent 68a1860 commit 587760e

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

frontends/main/src/app-pages/ProductPages/ProductSummary.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ const ProgramPaySection = styled.div(({ theme }) => ({
390390

391391
const ProgramPayLabel = styled.span(({ theme }) => ({
392392
...theme.typography.body4,
393+
fontSize: "12px",
393394
fontWeight: theme.typography.fontWeightMedium,
394395
color: theme.custom.colors.silverGrayDark,
395396
textTransform: "uppercase",
@@ -439,6 +440,7 @@ const ProgramDiscountBlock = styled.div(({ theme }) => ({
439440
const ProgramSavingsText = styled.span(({ theme }) => ({
440441
...theme.typography.subtitle2,
441442
color: theme.custom.colors.green,
443+
fontSize: "16px",
442444
}))
443445

444446
const ProgramListPriceText = styled.span(({ theme }) => ({
@@ -451,6 +453,7 @@ const ProgramPriceDivider = styled.div(({ theme }) => ({
451453
width: "100%",
452454
maxWidth: "346px",
453455
borderTop: `1px solid ${theme.custom.colors.lightGray2}`,
456+
marginBottom: "20px",
454457
flex: "none",
455458
alignSelf: "stretch",
456459
}))
@@ -734,15 +737,16 @@ type ProgramInfoRowProps = {
734737
program: V2ProgramDetail
735738
} & HTMLAttributes<HTMLDivElement>
736739

740+
const getTotalRequiredCourses = (program: V2ProgramDetail) => {
741+
const parsedReqs = parseReqTree(program.req_tree)
742+
return parsedReqs.reduce((sum, req) => sum + req.requiredCount, 0)
743+
}
744+
737745
const RequirementsRow: React.FC<ProgramInfoRowProps> = ({
738746
program,
739747
...others
740748
}) => {
741-
const parsedReqs = parseReqTree(program.req_tree)
742-
const totalRequired = parsedReqs.reduce(
743-
(sum, req) => sum + req.requiredCount,
744-
0,
745-
)
749+
const totalRequired = getTotalRequiredCourses(program)
746750
if (totalRequired === 0) return null
747751

748752
// Always say "Courses" here. Whether a child program should be labeled
@@ -891,6 +895,8 @@ const ProgramPriceRow: React.FC<ProgramPriceRowProps> = ({
891895
currentAmount !== null && listAmount !== null && listAmount > currentAmount
892896
const savingsAmount = hasSavings ? listAmount - currentAmount : null
893897

898+
const totalRequired = getTotalRequiredCourses(program)
899+
894900
const paidSection =
895901
enrollmentType === "paid" && currentPrice ? (
896902
<ProgramPaySection>
@@ -908,8 +914,9 @@ const ProgramPriceRow: React.FC<ProgramPriceRowProps> = ({
908914
Save {formatPrice(savingsAmount, { avoidCents: true })}
909915
</ProgramSavingsText>
910916
<ProgramListPriceText>
911-
{formatPrice(listAmount, { avoidCents: true })} total for
912-
courses purchased separately
917+
{formatPrice(listAmount, { avoidCents: true })} total for{" "}
918+
{totalRequired} {pluralize("course", totalRequired)} purchased
919+
separately
913920
</ProgramListPriceText>
914921
</ProgramDiscountBlock>
915922
) : null}
@@ -920,7 +927,7 @@ const ProgramPriceRow: React.FC<ProgramPriceRowProps> = ({
920927
)
921928

922929
return (
923-
<Stack {...others} gap="8px" width="100%">
930+
<Stack {...others} gap="0px" width="100%">
924931
{enrollmentType === "paid" ? <ProgramPriceDivider /> : null}
925932
<InfoRow>
926933
{enrollmentType === "paid" ? (

0 commit comments

Comments
 (0)