Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styling improvements for [sectionId] pages #233

Merged
merged 7 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions components/content/LearningOutcomes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export default function LearningOutcomes({ learningOutcomes }: { learningOutcome
const [open, setOpen] = React.useState(true)
if (learningOutcomes.length === 0) return null
return (
<Alert severity="success" sx={{ marginBottom: (t: Theme) => t.spacing(1) }}>
<Alert
severity="success"
className="max-w-2xl mx-auto dark:bg-indigo-950 dark:text-teal-50"
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
Expand All @@ -26,7 +30,7 @@ export default function LearningOutcomes({ learningOutcomes }: { learningOutcome
{learningOutcomes.map((o, i) => (
<ListItem key={i}>
<ListItemIcon>
<HiOutlineTrophy />
<HiOutlineTrophy color="#2e7d32" />
</ListItemIcon>
<ListItemText>{o}</ListItemText>
</ListItem>
Expand Down
6 changes: 5 additions & 1 deletion components/ui/LinkedSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export const LinkedSection = (sectionLink: SectionLink) => {
(sectionLink.course ? sectionLink.course + " - " : "") +
(sectionLink.section ? sectionLink.section : "")

const calcAnchorHeight = () => {
sectionLink.section!.length > 16 ? `h-[105px]` : `h-[80px]`
}

let stackDirection
let navIcon
if (sectionLink.direction === "prev") {
Expand All @@ -59,7 +63,7 @@ export const LinkedSection = (sectionLink: SectionLink) => {
<Tooltip title={tooltipTitle}>
<a href={`${sectionLink.url}`} className={`pointer-events-auto text-gray-600 hover:text-gray-500 opacity-50`}>
<div
className={`group rounded-md border-2 hover:border-4 ${borderColor} h-[55px] w-[150px] text-sm`}
className={`group rounded-md border-2 hover:border-4 ${borderColor} ${calcAnchorHeight} w-[150px] text-sm`}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annoyingly this breaks whatever I had to do to get them to not move when the hover border width changed:

old
versus new:

new

I have absolutely no idea why? There might be an easy fix but it could certainly be fixed using box shadow rather than border? well I am never certain about anything when it comes to frontend.

BUT, we will spin this into another issue cause I would rather have them move slightly than the current text-overflow that we have.

onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
>
Expand Down