Skip to content

Commit 61bb17e

Browse files
committed
added filter button (basic)
1 parent f769169 commit 61bb17e

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

app/issues/page.tsx

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
'use client';
12
import React from 'react';
23
import Collection from '@/comps/Collection';
34
import Link from 'next/link';
45
import { Button } from '@/components/ui/button';
6+
import {
7+
Dialog,
8+
DialogContent,
9+
DialogDescription,
10+
DialogHeader,
11+
DialogTitle,
12+
DialogTrigger,
13+
DialogFooter,
14+
DialogClose,
15+
} from '@/components/ui/dialog';
16+
import organizations from '@/public/organizations.json';
517

618
export default function Issues() {
719
return (
@@ -11,12 +23,38 @@ export default function Issues() {
1123
Beginner-Friendly GSOC Issues
1224
</h1>
1325
<p className="max-w-[42rem] leading-normal text-muted-foreground sm:text-xl sm:leading-8">
14-
Explore the list of beginner-friendly GSOC issues from various organizations. Get started on
15-
your open source journey!
26+
Explore the list of beginner-friendly GSOC issues from various
27+
organizations. Get started on your open source journey!
1628
</p>
1729
</div>
30+
<Filter />
1831
<Collection />
19-
2032
</div>
2133
);
2234
}
35+
36+
function Filter() {
37+
return (
38+
<Dialog>
39+
<DialogTrigger asChild>
40+
<Button variant="outline">Filters</Button>
41+
</DialogTrigger>
42+
<DialogContent className="sm:max-w-md">
43+
<DialogHeader className="dark:text-white">
44+
<DialogTitle className="dark:text-white">Filters</DialogTitle>
45+
</DialogHeader>
46+
47+
<div className="flex items-center flex-wrap space-x-2 gap-7">
48+
<Button size="sm" className="px-3" onClick={() => setOpt('')}>
49+
Remove filters
50+
</Button>
51+
{organizations.map((org) => (
52+
<Button size="sm" className="px-3" onClick={() => setOpt('')}>
53+
<Link href={`issues/${org.org}`}>{org.org}</Link>
54+
</Button>
55+
))}
56+
</div>
57+
</DialogContent>
58+
</Dialog>
59+
);
60+
}

0 commit comments

Comments
 (0)