Skip to content

Commit

Permalink
add class title on hover
Browse files Browse the repository at this point in the history
  • Loading branch information
dtemkin1 committed Dec 16, 2024
1 parent 4f2813b commit 0cc73fd
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions src/components/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import interactionPlugin from "@fullcalendar/interaction";
import { Activity, NonClass, Timeslot } from "../lib/activity";
import { Slot } from "../lib/dates";
import { State } from "../lib/state";
import { Class } from "../lib/class";

import "./Calendar.scss";
import { Tooltip } from "./ui/tooltip";

/**
* Calendar showing all the activities, including the buttons on top that
Expand All @@ -30,15 +32,33 @@ export function Calendar(props: {
cursor="pointer"
height="100%"
>
<Text
fontSize="sm"
fontWeight="medium"
overflow="hidden"
textOverflow="clip"
whiteSpace="nowrap"
>
{event.title}
</Text>
{event.extendedProps.activity instanceof Class ? (
<Tooltip
content={event.extendedProps.activity.name}
portalled
positioning={{ placement: "top" }}
>
<Text
fontSize="sm"
fontWeight="medium"
overflow="hidden"
textOverflow="clip"
whiteSpace="nowrap"
>
{event.title}
</Text>
</Tooltip>
) : (
<Text
fontSize="sm"
fontWeight="medium"
overflow="hidden"
textOverflow="clip"
whiteSpace="nowrap"
>
{event.title}
</Text>
)}
<Text fontSize="xs">{event.extendedProps.room}</Text>
</Box>
);
Expand Down

0 comments on commit 0cc73fd

Please sign in to comment.