nielsr HF staff commited on
Commit
b4035a2
·
1 Parent(s): f0d80f6

Update filters

Browse files
Files changed (1) hide show
  1. 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 items-center gap-2 bg-white p-1 rounded-lg shadow-sm">
361
- <Toggle
362
- pressed={!isYearView}
363
- onPressedChange={() => setIsYearView(false)}
364
- variant="outline"
365
- className="border-2 data-[state=on]:border-primary"
366
- >
367
- Month View
368
- </Toggle>
369
- <Toggle
370
- pressed={isYearView}
371
- onPressedChange={() => setIsYearView(true)}
372
- variant="outline"
373
- className="border-2 data-[state=on]:bg-primary data-[state=on]:text-white data-[state=on]:border-primary"
374
- >
375
- Year View
376
- </Toggle>
 
 
 
 
 
 
 
377
  </div>
378
 
379
- <TooltipProvider>
380
- <Tooltip>
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
- <div className="flex flex-col items-center mb-8">
527
- <h1 className="text-3xl font-bold mb-4">Calendar Overview</h1>
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">