From 9d9f300476752e67e0303dd73676c0f9c361378c Mon Sep 17 00:00:00 2001 From: Ivan Chub Date: Wed, 24 Jul 2024 15:02:04 -0700 Subject: [PATCH] more --- .../components/screens/HomeScreen/Folder.tsx | 16 ++++++++++++++++ .../components/screens/HomeScreen/utils.ts | 9 +++++++++ 2 files changed, 25 insertions(+) create mode 100644 apps/passport-client/components/screens/HomeScreen/utils.ts diff --git a/apps/passport-client/components/screens/HomeScreen/Folder.tsx b/apps/passport-client/components/screens/HomeScreen/Folder.tsx index 422278771e..f70d7c6210 100644 --- a/apps/passport-client/components/screens/HomeScreen/Folder.tsx +++ b/apps/passport-client/components/screens/HomeScreen/Folder.tsx @@ -3,6 +3,7 @@ import { CSSProperties, useCallback } from "react"; import styled from "styled-components"; import { usePCDsInFolder } from "../../../src/appHooks"; import { cn } from "../../../src/util"; +import { EVENT_DATES } from "./utils"; export function FolderCard({ folder, @@ -19,6 +20,15 @@ export function FolderCard({ const pcds = usePCDsInFolder(folder); + const startDate = EVENT_DATES[folder]?.start; + const endDate = EVENT_DATES[folder]?.end; + + let dateStr = null; + + if (startDate && endDate) { + dateStr = `${new Date(startDate).toLocaleDateString()}`; + } + return ( {pcds.length} ticket{pcds.length > 1 ? "s" : ""} + {dateStr && ( + + {" ยท "} + {dateStr} + + )} ); diff --git a/apps/passport-client/components/screens/HomeScreen/utils.ts b/apps/passport-client/components/screens/HomeScreen/utils.ts new file mode 100644 index 0000000000..b49f8008be --- /dev/null +++ b/apps/passport-client/components/screens/HomeScreen/utils.ts @@ -0,0 +1,9 @@ +export const EVENT_DATES: Record = { + "ETH Berlin 04": { start: "2023-04-01", end: "2023-04-03" }, + "0xPARC Summer '24": { start: "2023-05-15", end: "2023-05-18" }, + "Edge Esmeralda": { start: "2023-06-10", end: "2023-06-12" }, + "ETH Prague 2024": { start: "2023-07-22", end: "2023-07-25" }, + "ETH LATAM SPS": { start: "2023-08-05", end: "2023-08-07" }, + "ETH Berlin 09": { start: "2023-09-18", end: "2023-09-21" }, + "Edge City": { start: "2023-10-18", end: "2023-10-21" } +};