Skip to content

Commit c30800f

Browse files
nolarclaude
andcommitted
Add sponsor buttons for GitHub Sponsors and PayPal below the action bar with an intro message and tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a7a35aa commit c30800f

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

src/App.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,27 @@ function App() {
120120
className="hidden"
121121
/>
122122
</div>
123+
<div className="mt-3 text-center print:hidden">
124+
<p className="text-sm text-gray-500 mb-2">If you like the app, please support the author with bread &amp; beer:</p>
125+
<div className="flex gap-2 justify-center">
126+
<a
127+
href="https://github.com/sponsors/nolar/"
128+
target="_blank"
129+
rel="noopener noreferrer"
130+
className="rounded bg-gray-100 px-3 py-1.5 text-sm font-medium text-gray-700 hover:bg-gray-200"
131+
>
132+
Sponsor via GitHub
133+
</a>
134+
<a
135+
href="https://paypal.me/nolarinfo"
136+
target="_blank"
137+
rel="noopener noreferrer"
138+
className="rounded bg-gray-100 px-3 py-1.5 text-sm font-medium text-gray-700 hover:bg-gray-200"
139+
>
140+
Sponsor via PayPal
141+
</a>
142+
</div>
143+
</div>
123144
</main>
124145
<aside className="w-64 shrink-0 print:hidden">
125146
<DateForm

src/__tests__/App.test.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,23 @@ describe("App", () => {
5858
expect(downloadBtn.parentElement!.className).toContain("print:hidden");
5959
});
6060

61+
it("renders sponsor links with correct hrefs", () => {
62+
render(<MemoryRouter><App /></MemoryRouter>);
63+
64+
const github = screen.getByRole("link", { name: "Sponsor via GitHub" });
65+
expect(github).toHaveAttribute("href", "https://github.com/sponsors/nolar/");
66+
expect(github).toHaveAttribute("target", "_blank");
67+
68+
const paypal = screen.getByRole("link", { name: "Sponsor via PayPal" });
69+
expect(paypal).toHaveAttribute("href", "https://paypal.me/nolarinfo");
70+
expect(paypal).toHaveAttribute("target", "_blank");
71+
});
72+
73+
it("renders sponsor intro text", () => {
74+
render(<MemoryRouter><App /></MemoryRouter>);
75+
expect(screen.getByText(/support the author with bread & beer/)).toBeInTheDocument();
76+
});
77+
6178
it("applies print layout classes to root containers", () => {
6279
const { container } = render(<MemoryRouter><App /></MemoryRouter>);
6380
const root = container.firstElementChild!;

0 commit comments

Comments
 (0)