Skip to content

Commit 2ef9c5a

Browse files
nolarclaude
andcommitted
Add "Generated with mmmotivator.com" footer below the grid with a clickable link, top/bottom padding for PNG export, and a unit test for the footer
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8a04169 commit 2ef9c5a

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed
1.2 KB
Loading
1.83 KB
Loading

src/__tests__/WeekGrid.test.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,22 @@ describe("WeekGrid", () => {
119119
expect(yearCells.length).toBeGreaterThan(0);
120120
});
121121

122+
it("renders the footer with a link to mmmotivator.com", () => {
123+
render(
124+
<WeekGrid
125+
birthdate={birthdate}
126+
totalYears={2}
127+
periods={periods}
128+
colorMap={colorMap}
129+
dates={[]}
130+
/>
131+
);
132+
const link = screen.getByRole("link", { name: "mmmotivator.com" });
133+
expect(link).toBeInTheDocument();
134+
expect(link).toHaveAttribute("href", "https://mmmotivator.com");
135+
expect(link).toHaveClass("text-black", "underline");
136+
});
137+
122138
it("does not render stars when dates array is empty", () => {
123139
const { container } = render(
124140
<WeekGrid

src/components/WeekGrid.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const WeekGrid = forwardRef<HTMLDivElement, WeekGridProps>(function WeekGrid({
5353
}, [dates, birthdate, totalYears]);
5454

5555
return (
56-
<div ref={ref} className="overflow-x-auto">
56+
<div ref={ref} className="overflow-x-auto pt-4 pb-4">
5757
<div className="inline-grid gap-px" style={{ gridTemplateColumns: `5ch 1ch repeat(52, 1fr) 5ch` }}>
5858
{/* Title row */}
5959
<div className="col-span-2" />
@@ -140,6 +140,13 @@ const WeekGrid = forwardRef<HTMLDivElement, WeekGridProps>(function WeekGrid({
140140
</>
141141
);
142142
})}
143+
144+
{/* Footer */}
145+
<div className="col-span-2" />
146+
<div className="col-span-52 text-right">
147+
<span className="text-[10px] text-black" style={{ fontFamily: "Verdana" }}>Generated with <a href="https://mmmotivator.com" className="text-black underline">mmmotivator.com</a></span>
148+
</div>
149+
<div />
143150
</div>
144151
</div>
145152
);

0 commit comments

Comments
 (0)