Skip to content

Commit eaf4361

Browse files
Ananta2003Ananta
andauthored
feat: add GitHub repository icons to header and footer (#107)
Co-authored-by: Ananta <anantavigave@gmail.com>
1 parent bd9f6cd commit eaf4361

7 files changed

Lines changed: 72 additions & 42 deletions

File tree

components/app-footer.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import { useTranslation } from "@/components/language-provider";
44
import { cn } from "@/lib/utils";
5+
import { Icon } from "./ui/button";
6+
import { FaGithub } from "react-icons/fa";
57

68
export function AppFooter() {
79
const { t, dir } = useTranslation();
@@ -55,6 +57,19 @@ export function AppFooter() {
5557
>
5658
{t("footer.note")}
5759
</p>
60+
<a href="https://github.com/O2sa/DevImpact"
61+
target="_blank"
62+
rel="noopener noreferrer"
63+
aria-label="GitHub Repository">
64+
<Icon
65+
type="button"
66+
variant="ghost"
67+
size="sm"
68+
className="flex items-center gap-2"
69+
>
70+
<FaGithub className="text-black dark:text-white" />
71+
</Icon>
72+
</a>
5873
</div>
5974
</div>
6075

components/app-header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ export function AppHeader() {
1515
</div>
1616
</header>
1717
);
18-
}
18+
}

components/theme-toggle.tsx

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
import { Moon, Sun } from "lucide-react";
44
import { useTheme } from "next-themes";
5-
import { Button } from "./ui/button";
5+
import { Button, Icon } from "./ui/button";
66
import { useSyncExternalStore } from "react";
77
import { useTranslation } from "./language-provider";
8+
import { FaGithub } from "react-icons/fa";
89

9-
const emptySubscribe = () => () => {};
10+
const emptySubscribe = () => () => { };
1011

1112
export function ThemeToggle() {
1213
const { t } = useTranslation();
@@ -32,15 +33,35 @@ export function ThemeToggle() {
3233
};
3334

3435
return (
35-
<Button
36-
type="button"
37-
variant="ghost"
38-
size="sm"
39-
onClick={handleToggle}
40-
className="flex items-center gap-2"
41-
aria-label={t("theme.toggle")}
42-
>
43-
{mounted && current === "dark" ? <Sun size={16} /> : <Moon size={16} />}
44-
</Button>
36+
<div className="flex items-center">
37+
<Button
38+
type="button"
39+
variant="ghost"
40+
size="sm"
41+
onClick={handleToggle}
42+
className="flex items-center gap-2"
43+
aria-label={t("theme.toggle")}
44+
>
45+
{mounted && current === "dark" ? <Sun size={16} /> : <Moon size={16} />}
46+
</Button>
47+
<a href="https://github.com/O2sa/DevImpact"
48+
target="_blank"
49+
rel="noopener noreferrer"
50+
aria-label="GitHub Repository">
51+
<Icon
52+
type="button"
53+
variant="ghost"
54+
size="sm"
55+
className="flex items-center gap-2"
56+
>
57+
<FaGithub className="text-black dark:text-white" />
58+
</Icon>
59+
</a>
60+
61+
62+
</div>
63+
64+
65+
4566
);
4667
}

components/ui/button.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ export function Button({ className, variant, size, ...props }: ButtonProps) {
3838
/>
3939
);
4040
}
41+
42+
export function Icon({ className, variant, size, ...props }: ButtonProps) {
43+
return (
44+
<button
45+
className={cn(buttonVariants({ variant, size }), className)}
46+
{...props}
47+
/>
48+
);
49+
}

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/types/routes.d.ts";
3+
import "./.next/dev/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"radix-ui": "^1.4.3",
1919
"react": "^19.2.4",
2020
"react-dom": "^19.2.4",
21+
"react-icons": "^5.6.0",
2122
"recharts": "^2.12.7",
2223
"tailwind-merge": "^2.5.3"
2324
},

pnpm-lock.yaml

Lines changed: 12 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)