Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 2 additions & 15 deletions components/app-footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import { useTranslation } from "@/components/language-provider";
import { cn } from "@/lib/utils";
import { Icon } from "./ui/button";
import { FaGithub } from "react-icons/fa";
import { GithubLink } from "./github-link";

export function AppFooter() {
const { t, dir } = useTranslation();
Expand Down Expand Up @@ -57,19 +56,7 @@ export function AppFooter() {
>
{t("footer.note")}
</p>
<a href="https://github.com/O2sa/DevImpact"
target="_blank"
rel="noopener noreferrer"
aria-label="GitHub Repository">
<Icon
type="button"
variant="ghost"
size="sm"
className="flex items-center gap-2"
>
<FaGithub className="text-black dark:text-white" />
</Icon>
</a>
<GithubLink />
</div>
</div>

Expand Down
24 changes: 24 additions & 0 deletions components/github-link.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"use client";

import { Button } from "./ui/button";
import { FaGithub } from "react-icons/fa";

export function GithubLink() {
return (
<a
href="https://github.com/O2sa/DevImpact"
target="_blank"
rel="noopener noreferrer"
aria-label="GitHub Repository"
>
<Button
type="button"
variant="ghost"
size="sm"
className="flex items-center gap-2"
>
<FaGithub className="text-black dark:text-white" />
</Button>
</a>
);
}
18 changes: 3 additions & 15 deletions components/theme-toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import { Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes";
import { Button, Icon } from "./ui/button";
import { useSyncExternalStore } from "react";
import { useTranslation } from "./language-provider";
import { FaGithub } from "react-icons/fa";
import { Button } from "./ui/button";
import { GithubLink } from "./github-link";

const emptySubscribe = () => () => { };

Expand Down Expand Up @@ -44,19 +44,7 @@ export function ThemeToggle() {
>
{mounted && current === "dark" ? <Sun size={16} /> : <Moon size={16} />}
</Button>
<a href="https://github.com/O2sa/DevImpact"
target="_blank"
rel="noopener noreferrer"
aria-label="GitHub Repository">
<Icon
type="button"
variant="ghost"
size="sm"
className="flex items-center gap-2"
>
<FaGithub className="text-black dark:text-white" />
</Icon>
</a>
<GithubLink />


</div>
Expand Down
11 changes: 1 addition & 10 deletions components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,4 @@ export function Button({ className, variant, size, ...props }: ButtonProps) {
{...props}
/>
);
}

export function Icon({ className, variant, size, ...props }: ButtonProps) {
return (
<button
className={cn(buttonVariants({ variant, size }), className)}
{...props}
/>
);
}
}
Loading