Skip to content

Commit 5909134

Browse files
authored
init(design-system): centralized design system (#2)
* init(design-system): centralized design system * small changes * small changes * self-review: removing unused stuff * small changes
1 parent 192bbc4 commit 5909134

76 files changed

Lines changed: 7460 additions & 816 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.todo

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
- Fix kick ratelimit
1+
✔ migrate @lgamila/web to use @lgamila/design-system @done(25-08-03 23:32)
2+
☐ Fix kick ratelimit
3+
☐ [good-first-issue] migrate @lgamila/extension to use @lgamila/design-system
4+
☐ @lgamila/analytics
5+
☐ @lgamila/observability
6+
☐ @lgamila/auth

apps/web/components.json

Lines changed: 0 additions & 21 deletions
This file was deleted.

apps/web/package.json

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"type": "module",
44
"version": "0.0.1",
55
"scripts": {
6+
"clean": "rimraf .turbo node_modules .astro",
67
"dev": "astro dev",
78
"build": "astro build",
89
"preview": "astro preview",
@@ -11,32 +12,24 @@
1112
"format": "npx ultracite format"
1213
},
1314
"dependencies": {
15+
"@lgamila/design-system": "workspace:*",
1416
"@astrojs/react": "^4.3.0",
1517
"@astrojs/vercel": "^8.2.5",
1618
"@hookform/resolvers": "^4.1.3",
17-
"@radix-ui/react-label": "^2.1.7",
18-
"@radix-ui/react-separator": "^1.1.7",
19-
"@radix-ui/react-slot": "^1.2.3",
2019
"@tailwindcss/vite": "^4.1.11",
2120
"@tanstack/react-query": "^5.83.0",
2221
"@types/react": "^19.1.8",
2322
"@types/react-dom": "^19.1.6",
2423
"astro": "^5.12.8",
2524
"astro-favicons": "^3.1.5",
26-
"class-variance-authority": "^0.7.1",
27-
"clsx": "^2.1.1",
2825
"lucide-react": "^0.525.0",
2926
"next-themes": "^0.4.6",
3027
"react": "^19.1.0",
3128
"react-dom": "^19.1.0",
3229
"react-hook-form": "^7.60.0",
3330
"react-icons": "^5.5.0",
3431
"sonner": "^2.0.6",
35-
"tailwind-merge": "^3.3.1",
3632
"tailwindcss": "^4.0.0",
37-
"zod": "^4.0.5"
38-
},
39-
"devDependencies": {
40-
"tw-animate-css": "^1.3.5"
33+
"zod": "^3.25.28"
4134
}
4235
}

apps/web/src/components/atoms/logo.tsx

Lines changed: 156 additions & 159 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
export default function PixelHeart({ className }: { className?: string }) {
2-
return (<svg className={className} fill="none" height="19" viewBox="0 0 18 19" width="18" xmlns="http://www.w3.org/2000/svg">
3-
<path d="M6.75 2.21631H3.75V3.71631H2.25V5.21631H0.75V9.71631H2.25V11.2163H3.75V12.7163H5.25V14.2163H6.75V15.7163H8.25V17.2163H9.75V15.7163H11.25V14.2163H12.75V12.7163H14.25V11.2163H15.75V9.71631H17.25V5.21631H15.75V3.71631H14.25V2.21631H11.25V3.71631H9.75V5.21631H8.25V3.71631H6.75V2.21631ZM6.75 3.71631V5.21631H8.25V6.71631H9.75V5.21631H11.25V3.71631H14.25V5.21631H15.75V9.71631H14.25V11.2163H12.75V12.7163H11.25V14.2163H9.75V15.7163H8.25V14.2163H6.75V12.7163H5.25V11.2163H3.75V9.71631H2.25V5.21631H3.75V3.71631H6.75Z" fill="currentColor" />
4-
</svg>
5-
);
6-
}
1+
export default function PixelHeart({ className }: { className?: string }) {
2+
return (
3+
<svg
4+
className={className}
5+
fill="none"
6+
height="19"
7+
viewBox="0 0 18 19"
8+
width="18"
9+
xmlns="http://www.w3.org/2000/svg"
10+
>
11+
<path
12+
d="M6.75 2.21631H3.75V3.71631H2.25V5.21631H0.75V9.71631H2.25V11.2163H3.75V12.7163H5.25V14.2163H6.75V15.7163H8.25V17.2163H9.75V15.7163H11.25V14.2163H12.75V12.7163H14.25V11.2163H15.75V9.71631H17.25V5.21631H15.75V3.71631H14.25V2.21631H11.25V3.71631H9.75V5.21631H8.25V3.71631H6.75V2.21631ZM6.75 3.71631V5.21631H8.25V6.71631H9.75V5.21631H11.25V3.71631H14.25V5.21631H15.75V9.71631H14.25V11.2163H12.75V12.7163H11.25V14.2163H9.75V15.7163H8.25V14.2163H6.75V12.7163H5.25V11.2163H3.75V9.71631H2.25V5.21631H3.75V3.71631H6.75Z"
13+
fill="currentColor"
14+
/>
15+
</svg>
16+
);
17+
}
Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
1-
import { AiOutlineChrome } from 'react-icons/ai';
2-
import { FaBraveReverse } from 'react-icons/fa6';
3-
import { RiFirefoxLine } from 'react-icons/ri';
4-
import { SiOperagx } from 'react-icons/si';
5-
import { TbBrandEdge } from 'react-icons/tb';
6-
import { Button } from '@/components/ui/button';
7-
8-
export const DownloadExtension = () => {
9-
return (
10-
<div className="flex flex-col items-center justify-center gap-4">
11-
<div className="space-x-4">
12-
<Button
13-
className="w-fit mt-4"
14-
onClick={() => {
15-
window.open('/chrome', '_blank');
16-
}}
17-
variant="outline"
18-
>
19-
<AiOutlineChrome className="size-4" />
20-
Download for Chrome
21-
</Button>
22-
<Button
23-
className="w-fit mt-4"
24-
onClick={() => {
25-
window.open('/firefox', '_blank');
26-
}}
27-
variant="outline"
28-
>
29-
<RiFirefoxLine className="size-4" />
30-
Download for Firefox
31-
</Button>
32-
</div>
33-
<div className="text-sm text-muted-foreground">
34-
Also works for these browsers:
35-
</div>
36-
<div className="flex flex-row items-center justify-center gap-2">
37-
<Button
38-
icon={<FaBraveReverse className="size-4" />}
39-
variant="outline"
40-
/>
41-
<Button icon={<SiOperagx className="size-4" />} variant="outline" />{' '}
42-
<Button icon={<TbBrandEdge className="size-4" />} variant="outline" />
43-
</div>
44-
</div>
45-
);
46-
};
1+
import { Button } from '@lgamila/design-system/components/ui/button';
2+
import { AiOutlineChrome } from 'react-icons/ai';
3+
import { FaBraveReverse } from 'react-icons/fa6';
4+
import { RiFirefoxLine } from 'react-icons/ri';
5+
import { SiOperagx } from 'react-icons/si';
6+
import { TbBrandEdge } from 'react-icons/tb';
7+
8+
export const DownloadExtension = () => {
9+
return (
10+
<div className="flex flex-col items-center justify-center gap-4">
11+
<div className="space-x-4">
12+
<Button
13+
className="w-fit mt-4"
14+
onClick={() => {
15+
window.open('/chrome', '_blank');
16+
}}
17+
variant="outline"
18+
>
19+
<AiOutlineChrome className="size-4" />
20+
Download for Chrome
21+
</Button>
22+
<Button
23+
className="w-fit mt-4"
24+
onClick={() => {
25+
window.open('/firefox', '_blank');
26+
}}
27+
variant="outline"
28+
>
29+
<RiFirefoxLine className="size-4" />
30+
Download for Firefox
31+
</Button>
32+
</div>
33+
<div className="text-sm text-muted-foreground">
34+
Also works for these browsers:
35+
</div>
36+
<div className="flex flex-row items-center justify-center gap-2">
37+
<Button
38+
icon={<FaBraveReverse className="size-4" />}
39+
variant="outline"
40+
/>
41+
<Button icon={<SiOperagx className="size-4" />} variant="outline" />{' '}
42+
<Button icon={<TbBrandEdge className="size-4" />} variant="outline" />
43+
</div>
44+
</div>
45+
);
46+
};

apps/web/src/components/molecules/footer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { cn } from '@/lib/utils';
1+
import { cn } from '@lgamila/design-system/lib/utils';
22
import PixelHeart from '../icons/pixel-heart';
33

44
export default function Footer({ className }: { className?: string }) {
@@ -31,4 +31,4 @@ export default function Footer({ className }: { className?: string }) {
3131
</div>
3232
</footer>
3333
);
34-
}
34+
}
Lines changed: 85 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,85 @@
1-
import { QueryClientProvider, useQuery } from '@tanstack/react-query';
2-
import { API_URL } from '@/lib/constants';
3-
import { queryClient } from '@/store';
4-
5-
interface Streamer {
6-
id: string;
7-
name: string;
8-
isLive: boolean;
9-
livePlatform: string | null;
10-
viewerCount: number;
11-
}
12-
13-
interface StreamerData {
14-
streamers: Streamer[];
15-
}
16-
17-
async function fetchStreamers(): Promise<StreamerData> {
18-
const response = await fetch(`${API_URL}/api/streamers`);
19-
if (!response.ok) {
20-
throw new Error('Failed to fetch streamers');
21-
}
22-
return response.json();
23-
}
24-
25-
function StreamerStatsClient() {
26-
const { data, isLoading, error } = useQuery({
27-
queryKey: ['streamers'],
28-
queryFn: fetchStreamers,
29-
});
30-
31-
const totalStreamers = data?.streamers.length || 0;
32-
const liveStreamers = data?.streamers.filter((s) => s.isLive).length || 0;
33-
const viewers = data?.streamers.reduce((acc, s) => acc + s.viewerCount, 0) || 0;
34-
35-
if (error) {
36-
// Fallback to static numbers if API fails
37-
return (
38-
<div className="grid grid-cols-1 md:grid-cols-3 gap-8 text-center">
39-
<div className="space-y-2">
40-
<div className="text-4xl font-bold text-accent">50+</div>
41-
<div className="text-muted-foreground">Streamers Supported</div>
42-
</div>
43-
<div className="space-y-2">
44-
<div className="text-4xl font-bold text-accent">2</div>
45-
<div className="text-muted-foreground">Platforms Supported</div>
46-
</div>
47-
<div className="space-y-2">
48-
<div className="text-4xl font-bold text-accent"></div>
49-
<div className="text-muted-foreground">Potential to Unlock</div>
50-
</div>
51-
</div>
52-
);
53-
}
54-
55-
return (
56-
<div className="grid grid-cols-1 md:grid-cols-3 gap-8 text-center">
57-
<div className="space-y-2">
58-
<div className="text-4xl font-bold text-accent">
59-
{isLoading ? "..." : totalStreamers}
60-
</div>
61-
<div className="text-muted-foreground">Streamers Supported</div>
62-
</div>
63-
<div className="space-y-2">
64-
<div className="text-4xl font-bold text-accent">
65-
{isLoading ? "..." : liveStreamers}
66-
</div>
67-
<div className="text-muted-foreground">Currently Live</div>
68-
</div>
69-
<div className="space-y-2">
70-
<div className="text-4xl font-bold text-accent">
71-
{isLoading ? "..." : viewers}
72-
</div>
73-
<div className="text-muted-foreground">Live Viewers</div>
74-
</div>
75-
</div>
76-
);
77-
}
78-
export function StreamerStats() {
79-
return (
80-
<QueryClientProvider client={queryClient}>
81-
<StreamerStatsClient />
82-
</QueryClientProvider>
83-
);
84-
}
1+
import { QueryClientProvider, useQuery } from '@tanstack/react-query';
2+
import { API_URL } from '@/lib/constants';
3+
import { queryClient } from '@/store';
4+
5+
interface Streamer {
6+
id: string;
7+
name: string;
8+
isLive: boolean;
9+
livePlatform: string | null;
10+
viewerCount: number;
11+
}
12+
13+
interface StreamerData {
14+
streamers: Streamer[];
15+
}
16+
17+
async function fetchStreamers(): Promise<StreamerData> {
18+
const response = await fetch(`${API_URL}/api/streamers`);
19+
if (!response.ok) {
20+
throw new Error('Failed to fetch streamers');
21+
}
22+
return response.json();
23+
}
24+
25+
function StreamerStatsClient() {
26+
const { data, isLoading, error } = useQuery({
27+
queryKey: ['streamers'],
28+
queryFn: fetchStreamers,
29+
});
30+
31+
const totalStreamers = data?.streamers.length || 0;
32+
const liveStreamers = data?.streamers.filter((s) => s.isLive).length || 0;
33+
const viewers =
34+
data?.streamers.reduce((acc, s) => acc + s.viewerCount, 0) || 0;
35+
36+
if (error) {
37+
// Fallback to static numbers if API fails
38+
return (
39+
<div className="grid grid-cols-1 md:grid-cols-3 gap-8 text-center">
40+
<div className="space-y-2">
41+
<div className="text-4xl font-bold text-accent">50+</div>
42+
<div className="text-muted-foreground">Streamers Supported</div>
43+
</div>
44+
<div className="space-y-2">
45+
<div className="text-4xl font-bold text-accent">2</div>
46+
<div className="text-muted-foreground">Platforms Supported</div>
47+
</div>
48+
<div className="space-y-2">
49+
<div className="text-4xl font-bold text-accent"></div>
50+
<div className="text-muted-foreground">Potential to Unlock</div>
51+
</div>
52+
</div>
53+
);
54+
}
55+
56+
return (
57+
<div className="grid grid-cols-1 md:grid-cols-3 gap-8 text-center">
58+
<div className="space-y-2">
59+
<div className="text-4xl font-bold text-accent">
60+
{isLoading ? '...' : totalStreamers}
61+
</div>
62+
<div className="text-muted-foreground">Streamers Supported</div>
63+
</div>
64+
<div className="space-y-2">
65+
<div className="text-4xl font-bold text-accent">
66+
{isLoading ? '...' : liveStreamers}
67+
</div>
68+
<div className="text-muted-foreground">Currently Live</div>
69+
</div>
70+
<div className="space-y-2">
71+
<div className="text-4xl font-bold text-accent">
72+
{isLoading ? '...' : viewers}
73+
</div>
74+
<div className="text-muted-foreground">Live Viewers</div>
75+
</div>
76+
</div>
77+
);
78+
}
79+
export function StreamerStats() {
80+
return (
81+
<QueryClientProvider client={queryClient}>
82+
<StreamerStatsClient />
83+
</QueryClientProvider>
84+
);
85+
}

0 commit comments

Comments
 (0)