Skip to content

Commit 920b441

Browse files
committed
✨ Add GitHub repo link in the nav bar and stylize it
and refactor corporate icons
1 parent 4ada4ae commit 920b441

7 files changed

Lines changed: 84 additions & 29 deletions

File tree

components/auth/CurrentUserAvatar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const CurrentUserAvatar = () => {
1212
?.toUpperCase();
1313

1414
return (
15-
<Avatar>
15+
<Avatar className="size-6.5">
1616
{profileImage && <AvatarImage src={profileImage} alt={initials} />}
1717
<AvatarFallback>{initials}</AvatarFallback>
1818
</Avatar>

components/auth/LoginButtons.tsx

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { useState } from "react";
44
import { cn } from "@/lib/utils";
55
import { getClient } from "@/lib/supabase/client";
66
import { Button } from "@/components/ui/button";
7+
import GitHub from "@/components/icons/GitHub";
8+
import Google from "@/components/icons/Google";
79

810
export function LoginButtons({
911
className,
@@ -47,15 +49,7 @@ export function LoginButtons({
4749
className="w-full"
4850
disabled={isLoading}
4951
>
50-
<svg
51-
role="img"
52-
fill="currentColor"
53-
viewBox="0 0 24 24"
54-
xmlns="http://www.w3.org/2000/svg"
55-
>
56-
<title>GitHub</title>
57-
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
58-
</svg>
52+
<GitHub />
5953
GitHub로 로그인
6054
</Button>
6155
<Button
@@ -64,15 +58,7 @@ export function LoginButtons({
6458
className="w-full"
6559
disabled={isLoading}
6660
>
67-
<svg
68-
role="img"
69-
fill="currentColor"
70-
viewBox="0 0 24 24"
71-
xmlns="http://www.w3.org/2000/svg"
72-
>
73-
<title>Google</title>
74-
<path d="M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z" />
75-
</svg>
61+
<Google />
7662
Google로 로그인
7763
</Button>
7864
</div>

components/icons/GitHub.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import * as React from "react";
2+
import { cn } from "@/lib/utils";
3+
4+
export type GitHubProps = React.SVGProps<SVGSVGElement> & {
5+
title?: string;
6+
};
7+
8+
export default function GitHub({
9+
title = "GitHub",
10+
className,
11+
...props
12+
}: GitHubProps) {
13+
return (
14+
<svg
15+
role="img"
16+
viewBox="0 0 24 24"
17+
fill="currentColor"
18+
aria-label={title}
19+
className={cn("size-4", className)}
20+
xmlns="http://www.w3.org/2000/svg"
21+
{...props}
22+
>
23+
<title>{title}</title>
24+
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
25+
</svg>
26+
);
27+
}

components/icons/Google.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import * as React from "react";
2+
import { cn } from "@/lib/utils";
3+
4+
export type GoogleProps = React.SVGProps<SVGSVGElement> & {
5+
title?: string;
6+
};
7+
8+
export default function Google({
9+
title = "Google",
10+
className,
11+
...props
12+
}: GoogleProps) {
13+
return (
14+
<svg
15+
role="img"
16+
viewBox="0 0 24 24"
17+
fill="currentColor"
18+
aria-label={title}
19+
className={cn("size-4", className)}
20+
xmlns="http://www.w3.org/2000/svg"
21+
{...props}
22+
>
23+
<title>{title}</title>
24+
<path d="M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z" />{" "}
25+
</svg>
26+
);
27+
}

components/jargon/JargonInfiniteList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export default function JargonInfiniteList({
189189
<Button
190190
variant="outline"
191191
size="sm"
192-
className="hidden transition-all ease-in-out hover:rounded-3xl sm:inline-flex"
192+
className="hidden size-8.5 transition-all ease-in-out hover:rounded-3xl sm:inline-flex"
193193
onClick={openFilterDialog}
194194
>
195195
<Filter className="size-4" />
@@ -198,7 +198,7 @@ export default function JargonInfiniteList({
198198
{/* Mobile FABs are rendered globally */}
199199
<DropdownMenu>
200200
<DropdownMenuTrigger asChild>
201-
<Button className="hidden transition-all ease-in-out hover:rounded-3xl sm:inline-flex">
201+
<Button className="hidden size-8.5 transition-all ease-in-out hover:rounded-3xl sm:inline-flex">
202202
<SlidersHorizontal />
203203
</Button>
204204
</DropdownMenuTrigger>

components/navigation/NavBar.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
1+
import Link from "next/link";
12
import NavBarAvatar from "@/components/navigation/NavBarAvatar";
23
import NavBarSearchDialog from "@/components/navigation/NavBarSearchDialog";
34
import NavBarTitle from "@/components/navigation/NavBarTitle";
45
import SuggestJargonDialog from "@/components/dialogs/SuggestJargonDialog";
6+
import GitHub from "@/components/icons/GitHub";
7+
import { Separator } from "@/components/ui/separator";
58

69
export default function NavBar() {
710
return (
811
<nav className="sticky top-0 z-50">
9-
<div className="mb-4 flex items-start justify-between pt-4">
12+
<div className="bg-accent-f mb-4 flex items-start justify-between pt-4">
1013
<NavBarTitle />
11-
<div className="flex items-center gap-4.5">
14+
<div className="bg-background/10 flex items-center gap-2.5 rounded-xl p-1 backdrop-blur-xs">
1215
<NavBarSearchDialog />
1316
<SuggestJargonDialog />
17+
<Separator
18+
orientation="vertical"
19+
className="data-[orientation=vertical]:!h-5.5"
20+
/>
21+
<Link
22+
href="https://github.com/Zeta611/easyword"
23+
target="_blank"
24+
rel="noopener noreferrer"
25+
aria-label="GitHub Repository"
26+
>
27+
<GitHub className="text-foreground/70 size-5" />
28+
</Link>
1429
<NavBarAvatar />
1530
</div>
1631
</div>

components/navigation/NavBarAvatar.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { User } from "lucide-react";
55
import { CurrentUserAvatar } from "@/components/auth/CurrentUserAvatar";
66
import { useUserQuery } from "@/hooks/useUserQuery";
77
import { useLoginDialog } from "@/components/auth/LoginDialogProvider";
8+
import { Button } from "@/components/ui/button";
89

910
export default function NavBarAvatar() {
1011
const { data: user, isLoading } = useUserQuery();
@@ -13,20 +14,19 @@ export default function NavBarAvatar() {
1314
switch (isLoading ? null : !!user) {
1415
case null:
1516
return (
16-
<div className="rounded-sm bg-black p-2 text-white transition-all ease-in-out hover:rounded-3xl">
17+
<Button className="size-8.5 rounded-sm bg-black p-2 text-white transition-all ease-in-out hover:rounded-3xl">
1718
<User />
18-
</div>
19+
</Button>
1920
);
2021

2122
case false:
2223
return (
23-
<button
24-
type="button"
24+
<Button
2525
onClick={() => openLogin()}
26-
className="rounded-sm bg-black p-2 text-white transition-all ease-in-out hover:rounded-3xl"
26+
className="size-8.5 rounded-sm bg-black p-2 text-white transition-all ease-in-out hover:rounded-3xl"
2727
>
2828
<User />
29-
</button>
29+
</Button>
3030
);
3131

3232
case true:

0 commit comments

Comments
 (0)