Spaces:
Running
Running
Update filters
Browse files- src/pages/Calendar.tsx +57 -62
src/pages/Calendar.tsx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
|
| 2 |
import { useState } from "react";
|
| 3 |
import conferencesData from "@/data/conferences.yml";
|
| 4 |
import { Conference } from "@/types/conference";
|
|
@@ -357,49 +356,34 @@ const CalendarPage = () => {
|
|
| 357 |
const renderLegend = () => {
|
| 358 |
return (
|
| 359 |
<div className="flex flex-wrap gap-3 justify-center items-center mb-4">
|
| 360 |
-
<div className="flex
|
| 361 |
-
<
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 377 |
</div>
|
| 378 |
|
| 379 |
-
<
|
| 380 |
-
|
| 381 |
-
<TooltipTrigger asChild>
|
| 382 |
-
<button
|
| 383 |
-
onClick={() => setShowDeadlines(!showDeadlines)}
|
| 384 |
-
className={`
|
| 385 |
-
flex items-center gap-2 px-3 py-1.5
|
| 386 |
-
rounded-lg border border-red-200
|
| 387 |
-
bg-white hover:bg-red-50
|
| 388 |
-
transition-all duration-200
|
| 389 |
-
cursor-pointer
|
| 390 |
-
${showDeadlines ? 'ring-2 ring-primary ring-offset-2' : ''}
|
| 391 |
-
`}
|
| 392 |
-
>
|
| 393 |
-
<div className="w-3 h-3 bg-red-500 rounded-full" />
|
| 394 |
-
<span className="text-sm">Submission Deadlines</span>
|
| 395 |
-
</button>
|
| 396 |
-
</TooltipTrigger>
|
| 397 |
-
<TooltipContent>
|
| 398 |
-
<p>Click to toggle submission deadlines</p>
|
| 399 |
-
</TooltipContent>
|
| 400 |
-
</Tooltip>
|
| 401 |
-
</TooltipProvider>
|
| 402 |
-
|
| 403 |
{categories.map(([tag, color]) => (
|
| 404 |
<TooltipProvider key={tag}>
|
| 405 |
<Tooltip>
|
|
@@ -451,6 +435,35 @@ const CalendarPage = () => {
|
|
| 451 |
);
|
| 452 |
};
|
| 453 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 454 |
return (
|
| 455 |
<div className="min-h-screen bg-neutral-light">
|
| 456 |
<Header onSearch={setSearchQuery} />
|
|
@@ -523,26 +536,8 @@ const CalendarPage = () => {
|
|
| 523 |
|
| 524 |
<div className="p-6">
|
| 525 |
<div className="max-w-7xl mx-auto">
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
<div className="flex items-center gap-4 mb-6">
|
| 529 |
-
<Toggle
|
| 530 |
-
pressed={!isYearView}
|
| 531 |
-
onPressedChange={() => setIsYearView(false)}
|
| 532 |
-
variant="outline"
|
| 533 |
-
>
|
| 534 |
-
Month View
|
| 535 |
-
</Toggle>
|
| 536 |
-
<Toggle
|
| 537 |
-
pressed={isYearView}
|
| 538 |
-
onPressedChange={() => setIsYearView(true)}
|
| 539 |
-
variant="outline"
|
| 540 |
-
>
|
| 541 |
-
Year View
|
| 542 |
-
</Toggle>
|
| 543 |
-
</div>
|
| 544 |
-
{renderLegend()}
|
| 545 |
-
</div>
|
| 546 |
|
| 547 |
<div className="grid grid-cols-1 gap-8">
|
| 548 |
<div className="mx-auto w-full max-w-4xl">
|
|
|
|
|
|
|
| 1 |
import { useState } from "react";
|
| 2 |
import conferencesData from "@/data/conferences.yml";
|
| 3 |
import { Conference } from "@/types/conference";
|
|
|
|
| 356 |
const renderLegend = () => {
|
| 357 |
return (
|
| 358 |
<div className="flex flex-wrap gap-3 justify-center items-center mb-4">
|
| 359 |
+
<div className="flex gap-3 items-center">
|
| 360 |
+
<TooltipProvider>
|
| 361 |
+
<Tooltip>
|
| 362 |
+
<TooltipTrigger asChild>
|
| 363 |
+
<button
|
| 364 |
+
onClick={() => setShowDeadlines(!showDeadlines)}
|
| 365 |
+
className={`
|
| 366 |
+
flex items-center gap-2 px-3 py-1.5
|
| 367 |
+
rounded-lg border border-red-200
|
| 368 |
+
bg-white hover:bg-red-50
|
| 369 |
+
transition-all duration-200
|
| 370 |
+
cursor-pointer
|
| 371 |
+
${showDeadlines ? 'ring-2 ring-primary ring-offset-2' : ''}
|
| 372 |
+
`}
|
| 373 |
+
>
|
| 374 |
+
<div className="w-3 h-3 bg-red-500 rounded-full" />
|
| 375 |
+
<span className="text-sm">Submission Deadlines</span>
|
| 376 |
+
</button>
|
| 377 |
+
</TooltipTrigger>
|
| 378 |
+
<TooltipContent>
|
| 379 |
+
<p>Click to toggle submission deadlines</p>
|
| 380 |
+
</TooltipContent>
|
| 381 |
+
</Tooltip>
|
| 382 |
+
</TooltipProvider>
|
| 383 |
</div>
|
| 384 |
|
| 385 |
+
<div className="h-6 w-px bg-neutral-200" /> {/* Divider */}
|
| 386 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 387 |
{categories.map(([tag, color]) => (
|
| 388 |
<TooltipProvider key={tag}>
|
| 389 |
<Tooltip>
|
|
|
|
| 435 |
);
|
| 436 |
};
|
| 437 |
|
| 438 |
+
const renderViewToggle = () => {
|
| 439 |
+
return (
|
| 440 |
+
<div className="flex justify-center mb-6">
|
| 441 |
+
<div className="bg-neutral-100 rounded-lg p-1 inline-flex">
|
| 442 |
+
<button
|
| 443 |
+
onClick={() => setIsYearView(false)}
|
| 444 |
+
className={`px-4 py-2 rounded-md text-sm font-medium transition-colors ${
|
| 445 |
+
!isYearView
|
| 446 |
+
? 'bg-white shadow-sm text-primary'
|
| 447 |
+
: 'text-neutral-600 hover:text-neutral-900'
|
| 448 |
+
}`}
|
| 449 |
+
>
|
| 450 |
+
Month View
|
| 451 |
+
</button>
|
| 452 |
+
<button
|
| 453 |
+
onClick={() => setIsYearView(true)}
|
| 454 |
+
className={`px-4 py-2 rounded-md text-sm font-medium transition-colors ${
|
| 455 |
+
isYearView
|
| 456 |
+
? 'bg-white shadow-sm text-primary'
|
| 457 |
+
: 'text-neutral-600 hover:text-neutral-900'
|
| 458 |
+
}`}
|
| 459 |
+
>
|
| 460 |
+
Year View
|
| 461 |
+
</button>
|
| 462 |
+
</div>
|
| 463 |
+
</div>
|
| 464 |
+
);
|
| 465 |
+
};
|
| 466 |
+
|
| 467 |
return (
|
| 468 |
<div className="min-h-screen bg-neutral-light">
|
| 469 |
<Header onSearch={setSearchQuery} />
|
|
|
|
| 536 |
|
| 537 |
<div className="p-6">
|
| 538 |
<div className="max-w-7xl mx-auto">
|
| 539 |
+
{renderViewToggle()}
|
| 540 |
+
{renderLegend()}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 541 |
|
| 542 |
<div className="grid grid-cols-1 gap-8">
|
| 543 |
<div className="mx-auto w-full max-w-4xl">
|