Skip to content

Commit

Permalink
Add sponsor button
Browse files Browse the repository at this point in the history
  • Loading branch information
albingroen committed Mar 31, 2023
1 parent 79ede50 commit 2dfdaa5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 13 deletions.
32 changes: 19 additions & 13 deletions components/Links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
CodeBracketIcon,
} from "@heroicons/react/24/outline";
import SidebarItem from "./SidebarItem";
import SponsorButton from "./SponsorButton";
import Stack from "./Stack";

export const LINKS = [
{
Expand All @@ -24,19 +26,23 @@ export const LINKS = [
];

const Links = () => (
<ul className="mt-3 w-full">
{LINKS.map((LINK) => (
<SidebarItem
key={LINK.label}
href={LINK.href}
icon={LINK.icon}
target="_blank"
rel="noopener"
>
{LINK.label}
</SidebarItem>
))}
</ul>
<Stack direction="vertical" spacing="large" className="mt-3">
<ul className="w-full">
{LINKS.map((LINK) => (
<SidebarItem
key={LINK.label}
href={LINK.href}
icon={LINK.icon}
target="_blank"
rel="noopener"
>
{LINK.label}
</SidebarItem>
))}
</ul>

<SponsorButton />
</Stack>
);

export default Links;
21 changes: 21 additions & 0 deletions components/SponsorButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { HeartIcon } from "@heroicons/react/20/solid";
import classNames from "../lib/classNames";

export default function SponsorButton() {
return (
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/sponsors/albingroen"
className={classNames(
"text-center w-full select-none font-medium rounded-md py-2 px-4 text-sm relative disabled:opacity-50 flex items-center justify-center gap-2",
"focus:outline-none focus-visible:ring-1",
"bg-gray-900 hover:bg-gray-700 text-white focus-visible:ring-white focus-visible:bg-gray-700",
"dark:bg-white dark:hover:bg-neutral-200 dark:text-black dark:focus-visible:ring-white dark:focus-visible:bg-neutral-200"
)}
>
<span>Sponsor the developer</span>
<HeartIcon className="w-4 text-red-500" />
</a>
);
}

1 comment on commit 2dfdaa5

@vercel
Copy link

@vercel vercel bot commented on 2dfdaa5 Mar 31, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.