Skip to content

Commit 9474727

Browse files
committed
theme: #97 refactor theme and add dark mode switcher
1 parent c66e79a commit 9474727

23 files changed

Lines changed: 427 additions & 113 deletions
28.5 KB
Loading
28.2 KB
Loading
28.5 KB
Loading
95 KB
Loading
94.3 KB
Loading

frontend/course/Course.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function Course() {
8989
>
9090
<Grid size={{xs: 12, md: 9}} py={2} pl={2}>
9191
<Box p={2} sx={{ border: '1px solid', borderColor: 'grey.300', borderRadius: 1, minHeight: 300 }}>
92-
<Button variant="outlined" startIcon={<DescriptionIcon />} sx={{ marginBottom: 2 }} onClick={() => {
92+
<Button variant="contained" startIcon={<DescriptionIcon />} sx={{ marginBottom: 2 }} onClick={() => {
9393
setDialogContent(<LessonForm
9494
header="New Lesson"
9595
initialContent={lessonCache}
@@ -98,7 +98,7 @@ function Course() {
9898
successCallback={resetDialog}
9999
courseId={course_id} />);
100100
setDialogOpen(true);}}>Add a Lesson</Button>
101-
<Button variant="outlined" startIcon={<BallotIcon />} sx={{ marginBottom: 2, marginLeft: 1 }} onClick={() => {
101+
<Button variant="contained" startIcon={<BallotIcon />} sx={{ marginBottom: 2, marginLeft: 1 }} onClick={() => {
102102
setDialogContent(<QuizForm
103103
cancelCallback={() => setDialogOpen(false)}
104104
successCallback={resetDialog}

frontend/course/components/ContentTable.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { TableContainer, Table, TableHead, TableRow, TableBody, TableCell, Paper, Typography } from '@mui/material';
1+
import { IconButton, TableContainer, Table, TableHead, TableRow, TableBody, TableCell, Paper, Typography } from '@mui/material';
22
import { useState, useEffect } from 'react';
33
import { getCookie } from '../../src/utils.js';
4-
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
4+
import DeleteIcon from '@mui/icons-material/Delete';
55

66
const ContentTable = ({ courseId, eventHandler, loaded = false }) => {
77
const [contentList, setContentList] = useState([]);
@@ -80,7 +80,9 @@ const ContentTable = ({ courseId, eventHandler, loaded = false }) => {
8080
<TableCell>{formatPeriod(content.waiting_period)}</TableCell>
8181
<TableCell>{content.type}</TableCell>
8282
<TableCell align='right'>
83-
<DeleteOutlineIcon sx={{ cursor: 'pointer', color: 'secondary.main' }} onClick={() => deleteContent(content.id)} />
83+
<IconButton aria-label="delete" onClick={() => deleteContent(content.id)}>
84+
<DeleteIcon />
85+
</IconButton>
8486
</TableCell>
8587
</TableRow>
8688
))}

frontend/course/components/LessonForm.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ function LessonForm({ header, initialTitle, initialContent, onContentChange, can
149149
</Select>
150150
</Tooltip>
151151
<Box mt={2} textAlign="right">
152-
<Button variant="outlined" sx={{ mr: 1, boxShadow: 'none' }} onClick={cancel}>
152+
<Button variant="outlined" sx={{ mr: 1 }} onClick={cancel}>
153153
Cancel
154154
</Button>
155-
<Button type="submit" variant="contained" color="primary" sx={{ boxShadow: 'none' }} onClick={() => {if(!lessonId) { addLesson(); } else { updateLesson(); }}}>
155+
<Button type="submit" variant="contained" onClick={() => {if(!lessonId) { addLesson(); } else { updateLesson(); }}}>
156156
Save Lesson
157157
</Button>
158158
</Box>

frontend/course/components/QuestionForm.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const QuestionForm = ({question, index, deleteCallback}) => {
6565
<Button variant="outlined" color="primary" sx={{ fontSize: '0.75rem', mt: 1 }} onClick={() => setAddingOption(true)} >
6666
<RuleIcon /><Typography variant="button" sx={{ ml: 1, fontSize: '0.75rem' }}>Add Option</Typography>
6767
</Button>
68-
<Button variant="outlined" color="secondary" onClick={deleteCallback} sx={{ ml: 1, mt: 1, fontSize: '0.75rem' }}>
68+
<Button variant="outlined" onClick={deleteCallback} sx={{ ml: 1, mt: 1, fontSize: '0.75rem' }}>
6969
Delete
7070
</Button>
7171
</Grid>
@@ -85,7 +85,7 @@ const QuestionForm = ({question, index, deleteCallback}) => {
8585
/>
8686
</Grid>
8787
<Grid size={{ xs: 3 }} sx={{ textAlign: 'left' }} alignItems={"center"}>
88-
<Button variant="outlined" color="primary" sx={{ mt: 1, mr: 1 }} onClick={() => {
88+
<Button variant="outlined" sx={{ mt: 1, mr: 1 }} onClick={() => {
8989
if (optionInputRef.current) {
9090
console.log(optionInputRef.current);
9191
addToOptions(optionInputRef.current.value);

frontend/course/components/QuizForm.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ const QuizForm = ({cancelCallback, successCallback, courseId, quizId }) => {
8585
}}/>
8686
</Grid>
8787
<Grid size={{ xs: 12, md: 4 }} sx={{ textAlign: 'right' }}>
88-
<Button variant="outlined" color="primary" onClick={() => {
88+
<Button variant="outlined" onClick={() => {
8989
addToQuestions();
9090
}}>
9191
Add Question
9292
</Button>
93-
<Button variant="outlined" sx={{ ml: 1 }} color="secondary" onClick={() => { setShowQuestionField(false); setNewQuestion(""); }}>
93+
<Button variant="outlined" sx={{ ml: 1 }} onClick={() => { setShowQuestionField(false); setNewQuestion(""); }}>
9494
Cancel
9595
</Button>
9696
</Grid>

0 commit comments

Comments
 (0)