Spaces:
Running
Running
gpt-engineer-app[bot]
commited on
Commit
·
50f641f
1
Parent(s):
1a97096
Refine calendar filters
Browse filesImprove the aesthetics of the filters on the calendar view and add a "deselect all" option.
- src/components/FilterBar.tsx +23 -7
- src/styles/globals.css +2 -1
src/components/FilterBar.tsx
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
|
2 |
import { useMemo } from "react";
|
3 |
import conferencesData from "@/data/conferences.yml";
|
|
|
4 |
|
5 |
interface FilterBarProps {
|
6 |
selectedTag: string;
|
@@ -27,23 +28,38 @@ const FilterBar = ({ selectedTag, onTagSelect }: FilterBarProps) => {
|
|
27 |
}, []);
|
28 |
|
29 |
return (
|
30 |
-
<div className="w-full py-
|
31 |
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
32 |
-
<div className="flex
|
33 |
{uniqueTags.map((filter) => (
|
34 |
<button
|
35 |
key={filter.id}
|
36 |
title={filter.description}
|
37 |
onClick={() => onTagSelect(filter.id)}
|
38 |
-
className={`
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
43 |
>
|
44 |
{filter.label}
|
45 |
</button>
|
46 |
))}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
</div>
|
48 |
</div>
|
49 |
</div>
|
|
|
1 |
|
2 |
import { useMemo } from "react";
|
3 |
import conferencesData from "@/data/conferences.yml";
|
4 |
+
import { X } from "lucide-react";
|
5 |
|
6 |
interface FilterBarProps {
|
7 |
selectedTag: string;
|
|
|
28 |
}, []);
|
29 |
|
30 |
return (
|
31 |
+
<div className="w-full py-6 bg-white border-b border-neutral-200 animate-fade-in shadow-sm">
|
32 |
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
33 |
+
<div className="flex flex-wrap gap-3">
|
34 |
{uniqueTags.map((filter) => (
|
35 |
<button
|
36 |
key={filter.id}
|
37 |
title={filter.description}
|
38 |
onClick={() => onTagSelect(filter.id)}
|
39 |
+
className={`
|
40 |
+
px-4 py-2 text-sm font-medium rounded-lg transition-all duration-200
|
41 |
+
filter-tag
|
42 |
+
${selectedTag === filter.id
|
43 |
+
? "bg-primary text-white shadow-sm filter-tag-active"
|
44 |
+
: "bg-neutral-50 text-neutral-600 hover:bg-neutral-100 hover:text-neutral-900"
|
45 |
+
}
|
46 |
+
`}
|
47 |
>
|
48 |
{filter.label}
|
49 |
</button>
|
50 |
))}
|
51 |
+
|
52 |
+
{selectedTag !== "All" && (
|
53 |
+
<button
|
54 |
+
onClick={() => onTagSelect("All")}
|
55 |
+
className="px-4 py-2 text-sm font-medium rounded-lg transition-all duration-200
|
56 |
+
bg-red-50 text-red-600 hover:bg-red-100 hover:text-red-700
|
57 |
+
flex items-center gap-2"
|
58 |
+
>
|
59 |
+
<X className="h-4 w-4" />
|
60 |
+
Deselect All
|
61 |
+
</button>
|
62 |
+
)}
|
63 |
</div>
|
64 |
</div>
|
65 |
</div>
|
src/styles/globals.css
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
/* Add these styles to make the filter tags more interactive */
|
2 |
.filter-tag {
|
3 |
@apply transition-all duration-200;
|
@@ -16,4 +17,4 @@
|
|
16 |
|
17 |
.filter-tag-active {
|
18 |
animation: subtle-pulse 2s infinite;
|
19 |
-
}
|
|
|
1 |
+
|
2 |
/* Add these styles to make the filter tags more interactive */
|
3 |
.filter-tag {
|
4 |
@apply transition-all duration-200;
|
|
|
17 |
|
18 |
.filter-tag-active {
|
19 |
animation: subtle-pulse 2s infinite;
|
20 |
+
}
|