Skip to content

Commit b7c2567

Browse files
authored
Testimonial spacing to allow 2 line attestation title (#2344)
* Testimonial spacing to allow 2 line attestation title * Opener adjustment. Line clamp on mobile
1 parent 1484ab4 commit b7c2567

File tree

2 files changed

+86
-101
lines changed

2 files changed

+86
-101
lines changed

frontends/main/src/app-pages/HomePage/TestimonialsSection.tsx

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,9 @@ const TestimonialCardQuote = styled.div({
124124
backgroundColor: theme.custom.colors.white,
125125
color: theme.custom.colors.black,
126126
padding: "0 32px 32px",
127-
flexDirection: "column",
128-
justifyContent: "space-between",
129-
alignItems: "flex-start",
130-
flex: "1 0 0",
131127
alignSelf: "stretch",
132128
alignContent: "center",
133129
borderRadius: "8px",
134-
display: "flex",
135130
[theme.breakpoints.down("md")]: {
136131
width: "100%",
137132
height: "161px",
@@ -145,24 +140,23 @@ const TestimonialCardQuote = styled.div({
145140
flexGrow: "1",
146141
...theme.typography.subtitle1,
147142
},
143+
})
148144

149-
"div.testimonial-quote-opener": {
150-
color: theme.custom.colors.mitRed,
151-
fontStyle: "normal",
152-
fontWeight: theme.typography.fontWeightBold,
153-
height: pxToRem(60),
154-
width: "100%",
155-
fontSize: pxToRem(60),
156-
lineHeight: pxToRem(120),
157-
[theme.breakpoints.down("md")]: {
158-
fontSize: pxToRem(60),
159-
fontWeight: theme.typography.fontWeightLight,
160-
height: pxToRem(20),
161-
lineHeight: "normal",
162-
transform: "translateY(-8px)",
163-
},
145+
const TestimonialQuoteOpener = styled.div(({ theme }) => ({
146+
color: theme.custom.colors.mitRed,
147+
fontStyle: "normal",
148+
fontWeight: theme.typography.fontWeightBold,
149+
height: pxToRem(56),
150+
width: "100%",
151+
fontSize: pxToRem(60),
152+
lineHeight: pxToRem(108),
153+
[theme.breakpoints.down("md")]: {
154+
fontWeight: theme.typography.fontWeightLight,
155+
height: pxToRem(20),
156+
lineHeight: pxToRem(64),
157+
transform: "translateY(-8px)",
164158
},
165-
})
159+
}))
166160

167161
const TestimonialFadeLeft = styled.div({
168162
position: "absolute",
@@ -209,25 +203,28 @@ const ButtonsContainer = styled.div({
209203
const TestimonialTruncateText = styled(TruncateText)({
210204
margin: "0px",
211205
textOverflow: "none",
206+
overflow: "hidden",
212207
...theme.typography.h4,
213208
fontSize: pxToRem(20), // This is a unicorn font size per the Figma design - it's not used anywhere else.
214209
lineHeight: pxToRem(26),
215210
height: "182px",
216211
alignContent: "center",
212+
marginBottom: "0.75rem",
217213
[theme.breakpoints.down("md")]: {
218214
WebkitLineClamp: 7,
219215
["@supports (-webkit-line-clamp: 7)"]: {
220216
WebkitLineClamp: 7,
221217
},
222218
},
223219
[theme.breakpoints.down("sm")]: {
224-
height: "224px",
220+
height: "208px",
225221
flexShrink: "0",
226222
...theme.typography.subtitle1,
227-
WebkitLineClamp: 11,
228-
["@supports (-webkit-line-clamp: 11)"]: {
229-
WebkitLineClamp: 11,
223+
WebkitLineClamp: 10,
224+
["@supports (-webkit-line-clamp: 10)"]: {
225+
WebkitLineClamp: 10,
230226
},
227+
marginBottom: 0,
231228
},
232229
})
233230

@@ -287,9 +284,9 @@ const SlickCarousel = () => {
287284
/>
288285
</TestimonialCardImage>
289286
<TestimonialCardQuote>
290-
<div className="testimonial-quote-opener" aria-hidden>
287+
<TestimonialQuoteOpener aria-hidden>
291288
&ldquo;
292-
</div>
289+
</TestimonialQuoteOpener>
293290
<TestimonialTruncateText as="blockquote" lineClamp={7}>
294291
{resource.quote.slice(0, 350)}
295292
{resource.quote.length >= 350 ? "..." : ""}

frontends/main/src/page-components/TestimonialDisplay/AttestantBlock.tsx

Lines changed: 62 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -26,102 +26,90 @@ const StyledRiAccountCircleFill = styled(RiAccountCircleFill)({
2626
})
2727

2828
const AttestantBlockContainer = styled.cite<AttestantBlockChildProps>(
29-
(props) => {
30-
const flexDir = props.avatarPosition === "end" ? "row-reverse" : "row"
31-
32-
return [
33-
{
34-
display: "flex",
35-
flexShrink: 0,
36-
flexDirection: flexDir,
37-
width: props.avatarPosition === "end" ? "100%" : "300px",
38-
marginLeft: props.avatarPosition === "end" ? "0px" : "24px",
39-
...theme.typography.body3,
40-
[theme.breakpoints.down("sm")]: {
41-
width: "100%",
42-
height: "56px",
43-
marginTop: props.avatarPosition === "end" ? "0px" : "24px",
44-
marginLeft: "0px",
45-
},
46-
},
47-
]
48-
},
29+
({ avatarPosition }) => ({
30+
display: "flex",
31+
flexShrink: 0,
32+
flexDirection: avatarPosition === "end" ? "row-reverse" : "row",
33+
width: avatarPosition === "end" ? "100%" : "300px",
34+
marginLeft: avatarPosition === "end" ? "0px" : "24px",
35+
...theme.typography.body3,
36+
[theme.breakpoints.down("sm")]: {
37+
width: "100%",
38+
height: "56px",
39+
marginTop: avatarPosition === "end" ? "4px" : "24px",
40+
marginLeft: "0px",
41+
},
42+
}),
4943
)
5044

51-
const AttestantAvatar = styled.div<AttestantBlockChildProps>((props) => {
52-
return [
53-
{
54-
marginRight: props.avatarPosition === "end" ? "0px" : "12px",
55-
marginLeft: props.avatarPosition === "end" ? "14px" : "0px",
56-
img: {
57-
objectFit: "cover",
58-
borderRadius: "50%",
59-
background: theme.custom.colors.white,
60-
width: "40px",
61-
height: "40px",
62-
boxShadow:
63-
"0px 2px 4px 0px rgba(37, 38, 43, 0.10), 0px 2px 4px 0px rgba(37, 38, 43, 0.10)",
64-
},
65-
[theme.breakpoints.down("sm")]: {
66-
display: props.avatarStyle === "homepage" ? "none" : "block",
67-
},
45+
const AttestantAvatar = styled.div<AttestantBlockChildProps>(
46+
({ avatarPosition, avatarStyle }) => ({
47+
marginRight: avatarPosition === "end" ? "0px" : "12px",
48+
marginLeft: avatarPosition === "end" ? "14px" : "0px",
49+
display: "flex",
50+
alignItems: "center",
51+
img: {
52+
objectFit: "cover",
53+
borderRadius: "50%",
54+
background: theme.custom.colors.white,
55+
width: "40px",
56+
height: "40px",
57+
boxShadow:
58+
"0px 2px 4px 0px rgba(37, 38, 43, 0.10), 0px 2px 4px 0px rgba(37, 38, 43, 0.10)",
6859
},
69-
]
70-
})
71-
72-
const AttestantNameBlock = styled.div<AttestantBlockChildProps>((props) => {
73-
return [
74-
{
75-
flexGrow: "1",
76-
width: "auto",
77-
textAlign: props.avatarPosition === "end" ? "end" : "start",
78-
color:
79-
props.color === "light"
80-
? theme.custom.colors.lightGray2
81-
: theme.custom.colors.silverGrayDark,
60+
[theme.breakpoints.down("sm")]: {
61+
display: avatarStyle === "homepage" ? "none" : "block",
8262
},
83-
]
84-
})
63+
}),
64+
)
65+
66+
const AttestantNameBlock = styled.div<AttestantBlockChildProps>(
67+
({ avatarPosition, color }) => ({
68+
flexGrow: "1",
69+
width: "auto",
70+
textAlign: avatarPosition === "end" ? "end" : "start",
71+
color:
72+
color === "light"
73+
? theme.custom.colors.lightGray2
74+
: theme.custom.colors.silverGrayDark,
75+
}),
76+
)
8577

86-
const AttestantName = styled.div<AttestantBlockChildProps>((props) => {
87-
const desktopFont =
88-
props.variant === "standard"
89-
? theme.typography.h5
90-
: theme.typography.subtitle1
91-
return [
92-
{
78+
const AttestantName = styled.div<AttestantBlockChildProps>(
79+
({ variant, color }) => {
80+
const desktopFont =
81+
variant === "standard" ? theme.typography.h5 : theme.typography.subtitle1
82+
return {
9383
...desktopFont,
9484
whiteSpace: "nowrap",
9585
color:
96-
props.color === "light"
86+
color === "light"
9787
? theme.custom.colors.white
9888
: theme.custom.colors.darkGray2,
9989
lineHeight: "125%",
10090
[theme.breakpoints.down("sm")]: {
10191
...theme.typography.subtitle1,
10292
},
103-
},
104-
]
105-
})
93+
}
94+
},
95+
)
10696

107-
const AttestantTitle = styled.div<AttestantBlockChildProps>((props) => {
108-
const desktopFont =
109-
props.variant === "standard"
110-
? theme.typography.body1
111-
: theme.typography.body3
112-
return [
113-
{
97+
const AttestantTitle = styled.div<AttestantBlockChildProps>(
98+
({ variant, color }) => {
99+
const desktopFont =
100+
variant === "standard" ? theme.typography.body1 : theme.typography.body3
101+
return {
114102
...desktopFont,
115103
color:
116-
props.color === "light"
104+
color === "light"
117105
? theme.custom.colors.lightGray2
118106
: theme.custom.colors.silverGrayDark,
119107
[theme.breakpoints.down("sm")]: {
120108
...theme.typography.body2,
121109
},
122-
},
123-
]
124-
})
110+
}
111+
},
112+
)
125113

126114
const AttestantBlock: React.FC<AttestantBlockProps> = ({
127115
attestation,

0 commit comments

Comments
 (0)