Skip to content

Commit b964e39

Browse files
committed
Publish Module in Sidebar and title editor
1 parent a36d1cf commit b964e39

File tree

3 files changed

+320
-188
lines changed

3 files changed

+320
-188
lines changed

frontend/src/APIClients/ActivityAPIClient.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ const updateActivity = async <ActivityType extends Activity>(
4545
);
4646
return data;
4747
} catch (error) {
48+
// eslint-disable-next-line no-alert
49+
alert(
50+
"Failed to update activity. Please refresh the page, try again later, or contact us.",
51+
);
4852
return null;
4953
}
5054
};

frontend/src/components/course_authoring/editorComponents/TypographyTextField.tsx

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,61 @@ export const BodyMediumTextField = ({
106106
/>
107107
);
108108
};
109+
110+
export const HeaderLargeTextField = ({
111+
defaultValue,
112+
onChange,
113+
placeholder,
114+
minRows,
115+
maxRows,
116+
rows,
117+
color,
118+
onBlur,
119+
}: {
120+
defaultValue: string;
121+
onChange: (newValue: string) => void;
122+
placeholder?: string;
123+
minRows?: number;
124+
maxRows?: number;
125+
rows?: number;
126+
color?: string;
127+
onBlur?: () => void;
128+
}) => {
129+
return (
130+
<TextField
131+
variant="outlined"
132+
fullWidth
133+
multiline
134+
minRows={minRows}
135+
maxRows={maxRows}
136+
rows={rows}
137+
placeholder={placeholder}
138+
defaultValue={defaultValue}
139+
onChange={(e) => onChange(e.target.value)}
140+
onBlur={onBlur}
141+
sx={{
142+
"& .MuiInputBase-input": {
143+
fontSize: "28px",
144+
fontWeight: 600,
145+
lineHeight: "120%",
146+
textTransform: "none",
147+
letterSpacing: "0.2px",
148+
fontFamily: "Lexend Deca, sans-serif",
149+
color,
150+
},
151+
"& .MuiOutlinedInput-notchedOutline": {
152+
border: "none",
153+
},
154+
"& .MuiOutlinedInput-root": {
155+
padding: 0,
156+
"&:hover .MuiOutlinedInput-notchedOutline": {
157+
border: "none",
158+
},
159+
"&.Mui-focused .MuiOutlinedInput-notchedOutline": {
160+
border: "none",
161+
},
162+
},
163+
}}
164+
/>
165+
);
166+
};

0 commit comments

Comments
 (0)