Skip to content
Merged
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
7 changes: 6 additions & 1 deletion src/components/ContributionHeatmap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ export default function ContributionHeatmap({
const dayIndex = index % 7;
const isFuture = cell.date > today;
const showTooltipBelow = dayIndex < 2;
const isNearRightEdge = weekIndex >= weekCount - 3;
const tooltip = `${cell.date.toLocaleDateString("en-US", {
weekday: "short",
month: "short",
Expand Down Expand Up @@ -313,8 +314,12 @@ export default function ContributionHeatmap({
>
{!isFuture && (
<span
className={`pointer-events-none absolute left-1/2 z-50 hidden -translate-x-1/2 whitespace-nowrap rounded-md bg-[var(--foreground)] px-2 py-1 text-[11px] text-[var(--background)] shadow-lg group-hover:block group-focus:block ${
className={`pointer-events-none absolute z-50 hidden whitespace-nowrap rounded-md bg-[var(--foreground)] px-2 py-1 text-[11px] text-[var(--background)] shadow-lg group-hover:block group-focus:block ${
showTooltipBelow ? "top-full mt-2" : "bottom-full mb-2"
} ${
isNearRightEdge
? "right-0 translate-x-0"
: "left-1/2 -translate-x-1/2"
}`}
>
{tooltip}
Expand Down
Loading