-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from OxfordRSE/learning-outcomes
feat: learning outcomes
- Loading branch information
Showing
5 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Section } from "../../lib/material" | ||
import ListItem from "@mui/material/ListItem" | ||
import ListItemText from "@mui/material/ListItemText" | ||
import List from "@mui/material/List" | ||
import Alert from "@mui/material/Alert" | ||
import Typography from "@mui/material/Typography" | ||
import Collapse from "@mui/material/Collapse" | ||
import Tooltip from "@mui/material/Tooltip" | ||
import { HiOutlineTrophy } from "react-icons/hi2" | ||
import ListItemIcon from "@mui/material/ListItemIcon" | ||
import React from "react" | ||
import { type Theme } from "@mui/system" | ||
|
||
export default function LearningOutcomes({ learningOutcomes }: { learningOutcomes: Section["learningOutcomes"] }) { | ||
const [open, setOpen] = React.useState(true) | ||
if (learningOutcomes.length === 0) return null | ||
return ( | ||
<Alert severity="success" sx={{ marginBottom: (t: Theme) => t.spacing(1) }}> | ||
<Tooltip title={`Click to ${open ? "hide" : "show"} learning outcomes`}> | ||
<Typography variant="body2" onClick={() => setOpen(!open)} sx={{ cursor: "pointer" }}> | ||
Learning outcomes | ||
</Typography> | ||
</Tooltip> | ||
<Collapse in={open}> | ||
<List> | ||
{learningOutcomes.map((o, i) => ( | ||
<ListItem key={i}> | ||
<ListItemIcon> | ||
<HiOutlineTrophy /> | ||
</ListItemIcon> | ||
<ListItemText>{o}</ListItemText> | ||
</ListItem> | ||
))} | ||
</List> | ||
</Collapse> | ||
</Alert> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters