This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* I have added filter options to see events virtual/in person * resolving issues renamed descriptive variables and removed unused variables * Update events.js * removing package-lock file * removed unused import * removing unused changes * feat: events filter (#2605) * adding useState at required page * removing unused index variable Co-authored-by: Abhi Jain <[email protected]> Co-authored-by: Eddie Jaoude <[email protected]> * fix: remove unrequired changes * feat: filter events by cfp #2677 * fix: user events list * fix: cfp filter for events Co-authored-by: abhi jain <[email protected]> Co-authored-by: Abhi jain <[email protected]>
- Loading branch information
1 parent
169d12f
commit 574412d
Showing
7 changed files
with
105 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,60 @@ | ||
import { IconContext } from "react-icons"; | ||
import { FaListUl, FaMicrophoneAlt } from "react-icons/fa"; | ||
import { MdOutlineOnlinePrediction, MdOutlinePeople } from "react-icons/md"; | ||
|
||
export default function EventKey({ events }) { | ||
const inPersonEvents = events.filter(event => event.isInPerson).length; | ||
const virtualEvents = events.filter(event => event.isVirtual).length; | ||
export default function EventKey({ categorisedEvents, onToggleEventType }) { | ||
const filters = [ | ||
{ | ||
title: "Show all", | ||
description: "List all events with no filters", | ||
key: "all", | ||
icon: FaListUl, | ||
}, | ||
{ | ||
title: "CFP open", | ||
description: "You can submit a talk to this conference", | ||
key: "cfpOpen", | ||
icon: FaMicrophoneAlt, | ||
}, | ||
{ | ||
title: "In person", | ||
description: "These are in person events", | ||
key: "inPerson", | ||
icon: MdOutlinePeople, | ||
}, | ||
{ | ||
title: "Virtual", | ||
description: "Held virtually online event", | ||
key: "virtual", | ||
icon: MdOutlineOnlinePrediction, | ||
}, | ||
]; | ||
|
||
return ( | ||
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 mb-6"> | ||
<div className="relative flex items-center space-x-3 rounded-lg border border-gray-300 bg-white px-6 py-5 shadow-sm focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2"> | ||
<div className="flex-shrink-0"> | ||
<IconContext.Provider value={{ size: "3em" }}> | ||
<MdOutlinePeople /> | ||
</IconContext.Provider> | ||
</div> | ||
<div className="min-w-0 flex-1"> | ||
<span className="absolute inset-0" aria-hidden="true" /> | ||
<p className="text-sm font-medium text-gray-900">In person</p> | ||
<p className="truncate text-sm text-gray-500"> | ||
These are in person events | ||
</p> | ||
</div> | ||
<div className="text-2xl font-semibold">{inPersonEvents}</div> | ||
</div> | ||
<div className="relative flex items-center space-x-3 rounded-lg border border-gray-300 bg-white px-6 py-5 shadow-sm focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2"> | ||
<div className="flex-shrink-0"> | ||
<IconContext.Provider value={{ size: "3em" }}> | ||
<MdOutlineOnlinePrediction /> | ||
</IconContext.Provider> | ||
</div> | ||
<div className="min-w-0 flex-1"> | ||
<span className="absolute inset-0" aria-hidden="true" /> | ||
<p className="text-sm font-medium text-gray-900">Virtual</p> | ||
<p className="truncate text-sm text-gray-500"> | ||
These are virtual events held online | ||
</p> | ||
{filters.map((filter) => ( | ||
<div | ||
onClick={() => onToggleEventType(filter.key)} | ||
className="hover:scale-105 cursor-pointer transition-all 3s relative flex items-center space-x-3 rounded-lg border border-gray-300 bg-white px-6 py-5 shadow-sm focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2" | ||
key={filter.key} | ||
> | ||
<div className="flex-shrink-0"> | ||
<IconContext.Provider value={{ size: "3em" }}> | ||
<filter.icon /> | ||
</IconContext.Provider> | ||
</div> | ||
<div className="min-w-0 flex-1"> | ||
<span className="absolute inset-0" aria-hidden="true" /> | ||
<p className="text-sm font-medium text-gray-900">{filter.title}</p> | ||
<p className="truncate text-sm text-gray-500"> | ||
{filter.description} | ||
</p> | ||
</div> | ||
<div className="text-2xl font-semibold"> | ||
{categorisedEvents[filter.key].length} | ||
</div> | ||
</div> | ||
<div className="text-2xl font-semibold">{virtualEvents}</div> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"isInPerson": true, | ||
"color": "red", | ||
"name": "CIVO Navigate", | ||
"description": "A two-day conference in **Tampa, FL**, revolving around topics such as **Kubernetes**, **Edge Computing**, **Machine Learning**, **Dev/GitOps**, **Observability**, **Security**, and **Cloud Native Transformation**, where I will be delivering a workshop on Open Source developer tool **Acorn**.", | ||
"date": { | ||
"start": "2023-02-07T08:30:00.000-05:00", | ||
"end": "2023-02-08T17:40:00.000-05:00" | ||
}, | ||
"url": "https://civo.com/navigate" | ||
"isInPerson": true, | ||
"color": "red", | ||
"name": "CIVO Navigate", | ||
"description": "A two-day conference in **Tampa, FL**, revolving around topics such as **Kubernetes**, **Edge Computing**, **Machine Learning**, **Dev/GitOps**, **Observability**, **Security**, and **Cloud Native Transformation**, where I will be delivering a workshop on Open Source developer tool **Acorn**.", | ||
"date": { | ||
"start": "2023-02-07T08:30:00.000-05:00", | ||
"end": "2023-02-08T17:40:00.000-05:00" | ||
}, | ||
"url": "https://civo.com/navigate" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters