diff --git a/frontends/mit-learn/src/page-components/TestimonialDisplay/AttestantBlock.tsx b/frontends/mit-learn/src/page-components/TestimonialDisplay/AttestantBlock.tsx index 9033a150cb..30b4d1086d 100644 --- a/frontends/mit-learn/src/page-components/TestimonialDisplay/AttestantBlock.tsx +++ b/frontends/mit-learn/src/page-components/TestimonialDisplay/AttestantBlock.tsx @@ -5,14 +5,16 @@ import { RiAccountCircleFill } from "@remixicon/react" import { TruncateText, styled, theme } from "ol-components" import type { Attestation } from "api/v0" -type AttestantBlockVariant = "start" | "end" +type AttestantAvatarPosition = "start" | "end" type AttestantBlockColor = "light" | "dark" type AttestantAvatarStyle = "homepage" | "unit" +type AttestantBlockVariant = "standard" | "condensed" type AttestantBlockChildProps = { - variant?: AttestantBlockVariant + avatarPosition?: AttestantAvatarPosition + avatarStyle?: AttestantAvatarStyle color?: AttestantBlockColor - avatar?: AttestantAvatarStyle + variant?: AttestantBlockVariant } type AttestantBlockProps = AttestantBlockChildProps & { @@ -26,20 +28,20 @@ const StyledRiAccountCircleFill = styled(RiAccountCircleFill)({ const AttestantBlockContainer = styled.cite( (props) => { - const flexDir = props.variant === "end" ? "row-reverse" : "row" + const flexDir = props.avatarPosition === "end" ? "row-reverse" : "row" return [ { display: "flex", flexShrink: 0, flexDirection: flexDir, - width: props.variant === "end" ? "100%" : "300px", - marginLeft: props.variant === "end" ? "0px" : "24px", + width: props.avatarPosition === "end" ? "100%" : "300px", + marginLeft: props.avatarPosition === "end" ? "0px" : "24px", ...theme.typography.body3, [theme.breakpoints.down("sm")]: { width: "100%", height: "56px", - marginTop: props.variant === "end" ? "0px" : "24px", + marginTop: props.avatarPosition === "end" ? "0px" : "24px", marginLeft: "0px", }, }, @@ -50,8 +52,8 @@ const AttestantBlockContainer = styled.cite( const AttestantAvatar = styled.div((props) => { return [ { - marginRight: props.variant === "end" ? "0px" : "12px", - marginLeft: props.variant === "end" ? "14px" : "0px", + marginRight: props.avatarPosition === "end" ? "0px" : "12px", + marginLeft: props.avatarPosition === "end" ? "14px" : "0px", img: { objectFit: "cover", borderRadius: "50%", @@ -62,7 +64,7 @@ const AttestantAvatar = styled.div((props) => { "0px 2px 4px 0px rgba(37, 38, 43, 0.10), 0px 2px 4px 0px rgba(37, 38, 43, 0.10)", }, [theme.breakpoints.down("sm")]: { - display: props.avatar === "homepage" ? "none" : "block", + display: props.avatarStyle === "homepage" ? "none" : "block", }, }, ] @@ -73,7 +75,7 @@ const AttestantNameBlock = styled.div((props) => { { flexGrow: "1", width: "auto", - textAlign: props.variant === "end" ? "end" : "start", + textAlign: props.avatarPosition === "end" ? "end" : "start", color: props.color === "light" ? theme.custom.colors.lightGray2 @@ -83,39 +85,76 @@ const AttestantNameBlock = styled.div((props) => { }) const AttestantName = styled.div((props) => { + const desktopFont = + props.variant === "standard" + ? theme.typography.h5 + : theme.typography.subtitle1 return [ { - ...theme.typography.subtitle1, + ...desktopFont, whiteSpace: "nowrap", color: props.color === "light" ? theme.custom.colors.white : theme.custom.colors.darkGray2, lineHeight: "125%", + [theme.breakpoints.down("sm")]: { + ...theme.typography.subtitle1, + }, + }, + ] +}) + +const AttestantTitle = styled.div((props) => { + const desktopFont = + props.variant === "standard" + ? theme.typography.body1 + : theme.typography.body3 + return [ + { + ...desktopFont, + color: + props.color === "light" + ? theme.custom.colors.lightGray2 + : theme.custom.colors.silverGrayDark, + [theme.breakpoints.down("sm")]: { + ...theme.typography.body2, + }, }, ] }) const AttestantBlock: React.FC = ({ attestation, - variant = "start", + avatarPosition = "start", + avatarStyle: avatar = "unit", color = "light", - avatar = "unit", + variant = "standard", }) => { return ( - - + + {attestation.avatar_medium ? ( ) : ( )} - - + + {attestation?.attestant_name} - {attestation.title} + + {attestation.title} + ) diff --git a/frontends/mit-learn/src/page-components/TestimonialDisplay/TestimonialDisplay.tsx b/frontends/mit-learn/src/page-components/TestimonialDisplay/TestimonialDisplay.tsx index bfb17703df..d7cd8c8609 100644 --- a/frontends/mit-learn/src/page-components/TestimonialDisplay/TestimonialDisplay.tsx +++ b/frontends/mit-learn/src/page-components/TestimonialDisplay/TestimonialDisplay.tsx @@ -16,10 +16,12 @@ import type { Attestation } from "api/v0" type TestimonialDisplayProps = { channels?: number[] offerors?: string[] + variant?: "standard" | "condensed" } type InternalTestimonialDisplayProps = { attestation: Attestation + variant?: "standard" | "condensed" } const TestimonialTruncateText = styled(TruncateText)({ @@ -110,6 +112,7 @@ const NoButtonsContainer = styled(ButtonsContainer)({ const InteriorTestimonialDisplay: React.FC = ({ attestation, + variant = "standard", }) => { return ( @@ -119,7 +122,11 @@ const InteriorTestimonialDisplay: React.FC = ({ {attestation?.quote.length >= 350 ? "..." : null} - + ) } @@ -127,6 +134,7 @@ const InteriorTestimonialDisplay: React.FC = ({ const TestimonialDisplay: React.FC = ({ channels, offerors, + variant = "standard", }) => { const { data } = useTestimonialList({ channels: channels, @@ -165,6 +173,7 @@ const TestimonialDisplay: React.FC = ({ ))} @@ -192,6 +201,7 @@ const TestimonialDisplay: React.FC = ({ diff --git a/frontends/mit-learn/src/pages/ChannelPage/UnitChannelTemplate.tsx b/frontends/mit-learn/src/pages/ChannelPage/UnitChannelTemplate.tsx index eeb699533b..3b42d65cbf 100644 --- a/frontends/mit-learn/src/pages/ChannelPage/UnitChannelTemplate.tsx +++ b/frontends/mit-learn/src/pages/ChannelPage/UnitChannelTemplate.tsx @@ -193,7 +193,7 @@ const UnitChannelTemplate: React.FC = ({
What Learners Say - +
{children} diff --git a/frontends/mit-learn/src/pages/HomePage/TestimonialsSection.tsx b/frontends/mit-learn/src/pages/HomePage/TestimonialsSection.tsx index f9b58f5d90..4cd56ba530 100644 --- a/frontends/mit-learn/src/pages/HomePage/TestimonialsSection.tsx +++ b/frontends/mit-learn/src/pages/HomePage/TestimonialsSection.tsx @@ -17,6 +17,18 @@ import AttestantBlock from "@/page-components/TestimonialDisplay/AttestantBlock" const MARKETING_IMAGE_IDX = _.shuffle([1, 2, 3, 4, 5, 6]) +const HeaderContainer = styled(Container)(({ theme }) => ({ + display: "flex", + flexDirection: "column", + alignItems: "center", + textAlign: "center", + gap: "8px", + paddingBottom: "60px", + [theme.breakpoints.down("md")]: { + paddingBottom: "28px", + }, +})) + const Section = styled.section(({ theme }) => ({ backgroundColor: theme.custom.colors.mitRed, color: theme.custom.colors.white, @@ -262,9 +274,9 @@ const SlickCarousel = () => { @@ -296,15 +308,15 @@ const SlickCarousel = () => { const TestimonialsSection: React.FC = () => { return (
- - + + From Our Community - + Millions of learners are reaching their goals with MIT's non-degree learning resources. Here's what they're saying. - +
)