Skip to content

Commit 0163e62

Browse files
committed
refactor: seperate github owner from repo name
Signed-off-by: Seren_Modz 21 <seren@kings-world.net>
1 parent 4d498fe commit 0163e62

File tree

20 files changed

+339
-312
lines changed

20 files changed

+339
-312
lines changed

.github/hooks/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
22

3-
exec < /dev/tty
3+
[ -t 1 ] && exec < /dev/tty
44

55
yarn commitlint --edit $1

.github/hooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
exec < /dev/tty
3+
[ -t 1 ] && exec < /dev/tty
44

55
yarn pretty-quick --staged
66
git update-index --again

.github/renovate.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": ["github>Kings-World/.github:renovate-config"],
4-
"npm": {
5-
"packageRules": [
6-
{
7-
"matchPackageNames": ["prettier-plugin-tailwindcss"],
8-
"enabled": false
9-
}
10-
]
11-
}
3+
"extends": ["github>Kings-World/.github:renovate-config"]
124
}

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,8 @@ jobs:
7777

7878
- name: Validate PR commits with commitlint
7979
if: github.event_name == 'pull_request'
80-
run: yarn commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
80+
run: |
81+
yarn commitlint \
82+
--from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} \
83+
--to ${{ github.event.pull_request.head.sha }} \
84+
--verbose

astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ export default defineConfig({
99
site: "https://seren.dev",
1010
integrations: [react(), sitemap({ lastmod: new Date() })],
1111
vite: { plugins: [tailwindcss()] },
12+
image: { domains: ["avatars.githubusercontent.com"] },
1213
});

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@octokit/rest": "^22.0.1",
15-
"@radix-ui/react-dialog": "^1.1.15",
15+
"@radix-ui/react-popover": "^1.1.15",
1616
"@radix-ui/react-slot": "^1.2.4",
1717
"astro": "^5.16.6",
1818
"class-variance-authority": "^0.7.1",
@@ -34,7 +34,7 @@
3434
"@types/react-dom": "^19.2.3",
3535
"prettier": "^3.7.4",
3636
"prettier-plugin-astro": "^0.14.1",
37-
"prettier-plugin-tailwindcss": "^0.6.11",
37+
"prettier-plugin-tailwindcss": "^0.7.2",
3838
"pretty-quick": "^4.2.2",
3939
"tailwindcss": "^4.1.18",
4040
"tailwindcss-animate": "^1.0.7",

src/components/GithubCard.astro

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ import {
77
CardHeader,
88
CardTitle,
99
} from "./ui/card";
10-
import { Circle, Star, GitFork, ExternalLink } from "lucide-react";
10+
import {
11+
CircleIcon,
12+
StarIcon,
13+
GitForkIcon,
14+
ExternalLinkIcon,
15+
} from "lucide-react";
1116
import { Badge } from "./ui/badge";
17+
import { Image } from "astro:assets";
1218
1319
interface Props {
1420
repo: Awaited<ReturnType<typeof fetchUserRepos>>[number];
@@ -23,35 +29,51 @@ const languageColours: Record<string, string> = {
2329
Java: "#b07219",
2430
Kotlin: "#A97BFF",
2531
Astro: "#ff5a03",
32+
Shell: "#89e051",
2633
};
2734
2835
const repoLanguageColour = repo.language
2936
? languageColours[repo.language]
3037
: null;
3138
---
3239

33-
<Card className="overflow-hidden">
34-
<CardHeader className="pb-4">
35-
<CardTitle
36-
className="flex shrink items-center justify-between truncate text-lg"
37-
>
38-
<a
39-
href={repo.html_url}
40-
class="inline-flex items-center gap-2 hover:underline"
41-
target="_blank"
42-
rel="noopener noreferrer"
40+
<Card className="group overflow-hidden">
41+
<CardHeader className="pb-3">
42+
<div class="flex flex-col gap-y-1">
43+
<div class="flex flex-row items-center gap-1.5">
44+
<Image
45+
src={repo.owner.avatar_url}
46+
alt={repo.owner.login}
47+
width={24}
48+
height={24}
49+
class="rounded-full"
50+
/>
51+
<a href={repo.owner.html_url} class="text-xs hover:underline">
52+
{repo.owner.name ?? repo.owner.login}
53+
</a>
54+
{
55+
repo.archived && (
56+
<Badge variant="destructive" className="ml-auto">
57+
Archived
58+
</Badge>
59+
)
60+
}
61+
</div>
62+
<CardTitle
63+
className="flex shrink items-center justify-between truncate text-lg"
4364
>
44-
{repo.full_name}
45-
<ExternalLink className="size-4" />
46-
</a>
47-
{
48-
repo.archived && (
49-
<Badge variant="destructive" className="ml-4">
50-
Archived
51-
</Badge>
52-
)
53-
}
54-
</CardTitle>
65+
<a
66+
href={repo.html_url}
67+
class="inline-flex items-center gap-2"
68+
target="_blank"
69+
rel="noopener noreferrer"
70+
>
71+
<span class="hover:underline">{repo.name}</span>
72+
<ExternalLinkIcon className="size-4" />
73+
</a>
74+
</CardTitle>
75+
</div>
76+
5577
<CardDescription className="h-10 min-h-10 overflow-hidden">
5678
<p class="line-clamp-2 text-ellipsis">{repo.description}</p>
5779
</CardDescription>
@@ -61,7 +83,7 @@ const repoLanguageColour = repo.language
6183
repo.language && (
6284
<div class="flex items-center" title="Language">
6385
{repoLanguageColour && (
64-
<Circle
86+
<CircleIcon
6587
className="mr-1 size-3"
6688
style={{
6789
color: repoLanguageColour,
@@ -82,13 +104,13 @@ const repoLanguageColour = repo.language
82104
}
83105

84106
<div class="flex items-center" title="Stars">
85-
<Star className="mr-1 size-3" />
107+
<StarIcon className="mr-1 size-3" />
86108
{repo.stargazers_count}
87109
<span class="sr-only">Stars</span>
88110
</div>
89111

90112
<div class="flex items-center" title="Forks">
91-
<GitFork className="mr-1 size-3" />
113+
<GitForkIcon className="mr-1 size-3" />
92114
{repo.forks_count}
93115
<span class="sr-only">Forks</span>
94116
</div>

src/components/MainNav.astro

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,24 @@
11
---
2+
import { navbarLinks } from "~/lib/navigation";
23
import { cn } from "~/lib/utils";
34
---
45

56
<div class="hidden items-center md:flex">
67
<nav class="flex items-center gap-4 text-sm xl:gap-6">
7-
<a
8-
href="/"
9-
class={cn(
10-
"transition-colors hover:text-foreground/80",
11-
Astro.url.pathname === "/"
12-
? "text-foreground"
13-
: "text-foreground/60",
14-
)}
15-
>
16-
Home
17-
</a>
18-
<a
19-
href="/projects/"
20-
class={cn(
21-
"transition-colors hover:text-foreground/80",
22-
Astro.url.pathname === "/projects/"
23-
? "text-foreground"
24-
: "text-foreground/60",
25-
)}
26-
>
27-
Projects
28-
</a>
29-
<a
30-
href="/referrals/"
31-
class={cn(
32-
"transition-colors hover:text-foreground/80",
33-
Astro.url.pathname === "/referrals/"
34-
? "text-foreground"
35-
: "text-foreground/60",
36-
)}
37-
>
38-
Referrals
39-
</a>
8+
{
9+
navbarLinks.map((link) => (
10+
<a
11+
href={link.href}
12+
class={cn(
13+
"hover:text-foreground/80 transition-colors",
14+
Astro.url.pathname === link.href
15+
? "text-foreground"
16+
: "text-foreground/60",
17+
)}
18+
>
19+
{link.name}
20+
</a>
21+
))
22+
}
4023
</nav>
4124
</div>

src/components/MobileNav.tsx

Lines changed: 17 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,26 @@
1-
import { useState } from "react";
2-
import {
3-
Sheet,
4-
SheetContent,
5-
SheetHeader,
6-
SheetTitle,
7-
SheetTrigger,
8-
} from "./ui/sheet";
1+
import { MenuIcon } from "lucide-react";
92
import { Button } from "./ui/button";
10-
import { Menu } from "lucide-react";
11-
12-
export function MobileNav() {
13-
const [open, setOpen] = useState(false);
3+
import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
4+
import { navbarLinks } from "~/lib/navigation";
145

6+
export default function MobileNav() {
157
return (
16-
<Sheet open={open} onOpenChange={setOpen}>
17-
<SheetTrigger asChild>
8+
<Popover>
9+
<PopoverTrigger className="group" asChild>
1810
<Button variant="ghost" className="w-max md:hidden">
19-
<Menu />
20-
<span className="sr-only">Open mobile nav</span>
11+
<MenuIcon className="transition-transform duration-300 group-data-[state=open]:rotate-90" />
12+
<span className="sr-only">Toggle mobile nav</span>
2113
</Button>
22-
</SheetTrigger>
23-
<SheetContent side="left" aria-describedby={undefined}>
24-
<SheetHeader>
25-
<SheetTitle className="text-center">
26-
Seren_Modz 21
27-
</SheetTitle>
28-
</SheetHeader>
29-
<nav className="mt-4 flex flex-col gap-4">
30-
<a href="/">
31-
<Button variant="ghost" className="w-full">
32-
Home
33-
</Button>
34-
</a>
35-
36-
<a href="/projects">
37-
<Button variant="ghost" className="w-full">
38-
Projects
39-
</Button>
40-
</a>
41-
42-
<a href="/referrals">
43-
<Button variant="ghost" className="w-full">
44-
Referrals
14+
</PopoverTrigger>
15+
<PopoverContent className="bg-popover/80 w-screen rounded-none border-x-0 backdrop-blur-lg">
16+
<nav className="flex flex-col gap-2">
17+
{navbarLinks.map((link) => (
18+
<Button variant="ghost" asChild>
19+
<a href={link.href}>{link.name}</a>
4520
</Button>
46-
</a>
21+
))}
4722
</nav>
48-
</SheetContent>
49-
</Sheet>
23+
</PopoverContent>
24+
</Popover>
5025
);
5126
}

src/components/Navbar.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
import ThemeToggle from "./ThemeToggle.astro";
33
import MainNav from "./MainNav.astro";
4-
import { MobileNav } from "./MobileNav";
4+
import MobileNav from "./MobileNav";
55
---
66

77
<header
8-
class="container flex h-14 w-full flex-row items-center justify-between"
8+
class="bg-background/80 sticky top-0 container flex h-14 w-full flex-row items-center justify-between backdrop-blur-lg"
99
>
1010
<MainNav />
1111
<MobileNav client:visible />

0 commit comments

Comments
 (0)