Spaces:
Running
Running
Update notification when there are no results
Browse files- src/pages/Index.tsx +21 -9
src/pages/Index.tsx
CHANGED
|
@@ -129,11 +129,7 @@ const Index = () => {
|
|
| 129 |
<div className="min-h-screen bg-neutral-light">
|
| 130 |
<Header
|
| 131 |
onSearch={setSearchQuery}
|
| 132 |
-
showEmptyMessage={
|
| 133 |
-
(selectedTags.size > 0 || selectedCountries.size > 0) &&
|
| 134 |
-
filteredConferences.length === 0 &&
|
| 135 |
-
!showPastConferences
|
| 136 |
-
}
|
| 137 |
/>
|
| 138 |
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 139 |
<div className="space-y-4 py-4">
|
|
@@ -144,11 +140,19 @@ const Index = () => {
|
|
| 144 |
<button
|
| 145 |
key={category.id}
|
| 146 |
className={`px-4 py-2 rounded-md text-sm font-medium transition-colors ${
|
| 147 |
-
selectedTags.has(category.id)
|
| 148 |
-
? 'bg-blue-100 text-blue-800'
|
| 149 |
-
: 'bg-
|
| 150 |
}`}
|
| 151 |
-
onClick={() =>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
>
|
| 153 |
{category.label}
|
| 154 |
</button>
|
|
@@ -249,6 +253,14 @@ const Index = () => {
|
|
| 249 |
</div>
|
| 250 |
</div>
|
| 251 |
<main className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 252 |
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
| 253 |
{filteredConferences.map((conference: Conference) => (
|
| 254 |
<ConferenceCard key={conference.id} {...conference} />
|
|
|
|
| 129 |
<div className="min-h-screen bg-neutral-light">
|
| 130 |
<Header
|
| 131 |
onSearch={setSearchQuery}
|
| 132 |
+
showEmptyMessage={false}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
/>
|
| 134 |
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 135 |
<div className="space-y-4 py-4">
|
|
|
|
| 140 |
<button
|
| 141 |
key={category.id}
|
| 142 |
className={`px-4 py-2 rounded-md text-sm font-medium transition-colors ${
|
| 143 |
+
selectedTags.has(category.id)
|
| 144 |
+
? 'bg-blue-100 text-blue-800 hover:bg-blue-200'
|
| 145 |
+
: 'bg-neutral-100 text-neutral-700 hover:bg-neutral-200'
|
| 146 |
}`}
|
| 147 |
+
onClick={() => {
|
| 148 |
+
const newTags = new Set(selectedTags);
|
| 149 |
+
if (newTags.has(category.id)) {
|
| 150 |
+
newTags.delete(category.id);
|
| 151 |
+
} else {
|
| 152 |
+
newTags.add(category.id);
|
| 153 |
+
}
|
| 154 |
+
handleTagsChange(newTags);
|
| 155 |
+
}}
|
| 156 |
>
|
| 157 |
{category.label}
|
| 158 |
</button>
|
|
|
|
| 253 |
</div>
|
| 254 |
</div>
|
| 255 |
<main className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
| 256 |
+
{filteredConferences.length === 0 && (
|
| 257 |
+
<div className="bg-amber-50 border border-amber-200 text-amber-800 rounded-md p-4 mb-6">
|
| 258 |
+
<p className="text-center">
|
| 259 |
+
There are no upcoming conferences for the selected categories - enable "Show past conferences" to see previous ones
|
| 260 |
+
</p>
|
| 261 |
+
</div>
|
| 262 |
+
)}
|
| 263 |
+
|
| 264 |
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
| 265 |
{filteredConferences.map((conference: Conference) => (
|
| 266 |
<ConferenceCard key={conference.id} {...conference} />
|