Skip to content

Commit 0895700

Browse files
authored
Merge pull request #366 from cornell-dti/fix-faq-pr-merge-issues
[Minor Fix] Removed inner styling useStyles and unused style names in FAQPage and CollapsibleQuestion.
2 parents 2efdf2b + 5b6e030 commit 0895700

File tree

2 files changed

+38
-202
lines changed

2 files changed

+38
-202
lines changed

frontend/src/components/FAQ/CollapsibleQuestion.tsx

Lines changed: 38 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -15,87 +15,48 @@ type Props = {
1515
readonly answer: string;
1616
};
1717

18-
const useStyles = makeStyles(
19-
() => ({
20-
questionTitle: {
21-
fontSize: '20px',
22-
fontWeight: 600,
23-
lineHeight: '32px',
24-
color: colors.red1,
25-
},
26-
answerBlurb: {
27-
fontSize: '16px',
28-
fontWeight: 400,
29-
lineHeight: '24px',
30-
color: colors.black,
31-
padding: 0,
32-
},
33-
questionContainer: {
34-
borderRadius: '8px',
35-
border: '1px solid' + colors.gray5,
36-
background: colors.white,
37-
marginBottom: '16px!important' as '16px',
38-
padding: '2px',
39-
},
40-
summary: {
41-
padding: '5px 16px',
18+
const useStyles = makeStyles(() => ({
19+
questionTitle: {
20+
fontSize: '20px',
21+
fontWeight: 600,
22+
lineHeight: '32px',
23+
color: colors.red1,
24+
},
25+
answerBlurb: {
26+
fontSize: '16px',
27+
fontWeight: 400,
28+
lineHeight: '24px',
29+
color: colors.black,
30+
padding: 0,
31+
},
32+
questionContainer: {
33+
borderRadius: '8px',
34+
border: '1px solid' + colors.gray5,
35+
background: colors.white,
36+
marginBottom: '16px!important' as '16px',
37+
padding: '2px',
38+
},
39+
summary: {
40+
padding: '5px 16px',
41+
minHeight: 15,
42+
'&.Mui-expanded': {
4243
minHeight: 15,
43-
'&.Mui-expanded': {
44-
minHeight: 15,
45-
},
46-
'& .MuiAccordionSummary-content': {
47-
padding: '0 0',
48-
'&.Mui-expanded': {
49-
margin: '12px 0',
50-
},
51-
},
52-
'& .MuiButtonBase-root': {
53-
padding: '0 12px',
54-
},
55-
},
56-
details: {
57-
display: 'flex',
58-
padding: '0px 16px 16px 16px',
5944
},
60-
questionTitleMobile: {
61-
fontSize: '10px',
62-
fontWeight: 600,
63-
lineHeight: '14px',
64-
color: colors.red1,
65-
},
66-
answerBlurbMobile: {
67-
fontSize: '10px',
68-
fontWeight: 400,
69-
lineHeight: '14px',
70-
color: colors.black,
71-
padding: 0,
72-
},
73-
questionContainerMobile: {
74-
borderRadius: '8px',
75-
border: '1px solid' + colors.gray5,
76-
background: colors.white,
77-
marginBottom: '8px!important' as '8px',
78-
padding: '0px',
79-
},
80-
summaryMobile: {
81-
padding: '0px 10px',
82-
minHeight: 15,
45+
'& .MuiAccordionSummary-content': {
46+
padding: '0 0',
8347
'&.Mui-expanded': {
84-
minHeight: 15,
85-
},
86-
'& .MuiAccordionSummary-content': {
87-
padding: '0 0',
88-
'&.Mui-expanded': {
89-
margin: '12px 0',
90-
},
91-
},
92-
'& .MuiButtonBase-root': {
93-
padding: '0 12px',
48+
margin: '12px 0',
9449
},
9550
},
96-
}),
97-
{}
98-
);
51+
'& .MuiButtonBase-root': {
52+
padding: '0 12px',
53+
},
54+
},
55+
details: {
56+
display: 'flex',
57+
padding: '0px 16px 16px 16px',
58+
},
59+
}));
9960

10061
/**
10162
* CollapsableQuestion Component
@@ -117,17 +78,7 @@ export default function CollapsableQuestion({ answer, question }: Props): ReactE
11778
return () => window.removeEventListener('resize', handleResize);
11879
}, []);
11980

120-
const {
121-
questionTitle,
122-
answerBlurb,
123-
questionContainer,
124-
summary,
125-
details,
126-
questionTitleMobile,
127-
answerBlurbMobile,
128-
questionContainerMobile,
129-
summaryMobile,
130-
} = useStyles(isMobile);
81+
const { questionTitle, answerBlurb, questionContainer, summary, details } = useStyles(isMobile);
13182
return (
13283
<Grid item>
13384
<Accordion

frontend/src/pages/FAQPage.tsx

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -70,63 +70,6 @@ const useStyles = makeStyles(() => ({
7070
lineHeight: '25px',
7171
paddingBottom: '18px',
7272
},
73-
pageBackgroundMobile: {
74-
backgroundColor: colors.gray3,
75-
padding: '24px 34px 0',
76-
minHeight: 'calc(120vh - 96px)',
77-
},
78-
titleMobile: {
79-
color: colors.black,
80-
fontSize: '18px',
81-
fontWeight: 600,
82-
lineHeight: '28px',
83-
marginBottom: '1px',
84-
},
85-
subtitleMobile: {
86-
color: colors.black,
87-
fontSize: '12px',
88-
fontWeight: 400,
89-
lineHeight: '16px',
90-
marginBottom: '24px',
91-
},
92-
squareButtonMobile: {
93-
backgroundColor: colors.red1,
94-
color: 'white',
95-
'&:hover': {
96-
backgroundColor: colors.red7, // dark-red color on Figma
97-
},
98-
padding: '8px 12px',
99-
fontFamily: 'Work Sans, sans-serif',
100-
fontWeight: 600,
101-
fontSize: '12px',
102-
borderRadius: '10px',
103-
lineHeight: '16px',
104-
},
105-
sideBarMobile: {
106-
backgroundColor: colors.white,
107-
padding: '20px',
108-
borderRadius: '8px',
109-
width: 'auto',
110-
height: '200px',
111-
marginLeft: '0',
112-
'@media only screen and (max-width: 960px)': {
113-
marginLeft: '0',
114-
},
115-
border: '1px solid' + colors.gray5,
116-
marginTop: '16px',
117-
},
118-
sideBarTitleMobile: {
119-
fontSize: '10px',
120-
fontWeight: 600,
121-
lineHeight: '14px',
122-
paddingBottom: '6px',
123-
},
124-
sideBarBlurbMobile: {
125-
fontSize: '10px',
126-
fontWeight: 400,
127-
lineHeight: '14px',
128-
paddingBottom: '18px',
129-
},
13073
}));
13174

13275
/**
@@ -143,64 +86,6 @@ const FAQPage = (): ReactElement => {
14386
const [data, setData] = useState<FAQ[]>([]);
14487
const [isMobile, setIsMobile] = useState<boolean>(false);
14588
const { openModal } = useModal();
146-
const useStyles = makeStyles(() => ({
147-
pageBackground: {
148-
backgroundColor: colors.gray3,
149-
padding: '96px 135px 0',
150-
minHeight: 'calc(120vh - 96px)',
151-
},
152-
title: {
153-
color: colors.black,
154-
fontSize: '42px',
155-
fontWeight: 600,
156-
lineHeight: '60px',
157-
marginBottom: '20px',
158-
},
159-
subtitle: {
160-
color: colors.black,
161-
fontSize: '20px',
162-
fontWeight: 400,
163-
lineHeight: '28px',
164-
marginBottom: '32px',
165-
},
166-
squareButton: {
167-
backgroundColor: colors.red1,
168-
color: 'white',
169-
'&:hover': {
170-
backgroundColor: colors.red7, //dark-red on figma
171-
},
172-
padding: '8px 18px',
173-
fontWeight: 600,
174-
fontSize: '16px',
175-
borderRadius: '10px',
176-
lineHeight: '26px',
177-
},
178-
sideBar: {
179-
backgroundColor: colors.white,
180-
padding: '20px',
181-
borderRadius: '8px',
182-
width: '275px',
183-
height: 'fit-content',
184-
marginLeft: '48px',
185-
'@media only screen and (max-width: 960px)': {
186-
marginLeft: '0',
187-
},
188-
border: '1px solid' + colors.gray5,
189-
marginTop: '0',
190-
},
191-
sideBarTitle: {
192-
fontSize: '20px',
193-
fontWeight: 600,
194-
lineHeight: '26px',
195-
paddingBottom: '6px',
196-
},
197-
sideBarBlurb: {
198-
fontSize: '16px',
199-
fontWeight: 400,
200-
lineHeight: '25px',
201-
paddingBottom: '18px',
202-
},
203-
}));
20489
const { squareButton, sideBar, pageBackground, title, subtitle, sideBarTitle, sideBarBlurb } =
20590
useStyles();
20691

0 commit comments

Comments
 (0)