Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Event filters #2687

Merged
merged 12 commits into from
Jan 7, 2023
17 changes: 12 additions & 5 deletions components/event/EventKey.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { IconContext } from "react-icons";
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({ events, onToggleEventType }) {
const inPersonEvents = events.filter((event) => event.isInPerson).length;
const virtualEvents = events.filter((event) => event.isVirtual).length;

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
onClick={() => onToggleEventType("in-person")}
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"
>
<div className="flex-shrink-0">
<IconContext.Provider value={{ size: "3em" }}>
<MdOutlinePeople />
Expand All @@ -21,7 +25,10 @@ export default function EventKey({ events }) {
</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
onClick={() => onToggleEventType("virtual")}
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"
>
<div className="flex-shrink-0">
<IconContext.Provider value={{ size: "3em" }}>
<MdOutlineOnlinePrediction />
Expand Down
7 changes: 4 additions & 3 deletions components/user/UserEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ export default function UserEvents({ data }) {
{!data.events && <Alert type="info" message="No events found" />}
<ul role="list" className="divide-y divide-gray-200">
{data.events &&
data.events.map((event, index) => (
<EventCard event={event} key={index} />
))}
data.events
.map((event, index) => (
<EventCard event={event} key={index} />
))}
</ul>
</div>
);
Expand Down
18 changes: 9 additions & 9 deletions data/juliafmorgado/events/2023-02-07-civo-navigate.json
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"
}
Loading