diff --git a/apps/passport-client/components/screens/HomeScreen/Folder.tsx b/apps/passport-client/components/screens/HomeScreen/Folder.tsx index f70d7c6210..6af5a391e6 100644 --- a/apps/passport-client/components/screens/HomeScreen/Folder.tsx +++ b/apps/passport-client/components/screens/HomeScreen/Folder.tsx @@ -3,7 +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"; +import { EVENTS } from "./utils"; export function FolderCard({ folder, @@ -20,8 +20,8 @@ export function FolderCard({ const pcds = usePCDsInFolder(folder); - const startDate = EVENT_DATES[folder]?.start; - const endDate = EVENT_DATES[folder]?.end; + const startDate = EVENTS[folder]?.start; + const endDate = EVENTS[folder]?.end; let dateStr = null; diff --git a/apps/passport-client/components/screens/HomeScreen/HomeScreen.tsx b/apps/passport-client/components/screens/HomeScreen/HomeScreen.tsx index 73a61a9ce8..f756b9ab35 100644 --- a/apps/passport-client/components/screens/HomeScreen/HomeScreen.tsx +++ b/apps/passport-client/components/screens/HomeScreen/HomeScreen.tsx @@ -44,6 +44,7 @@ import { FolderEntryContainer, FolderExplorerContainer } from "./Folder"; +import { isEvent } from "./utils"; export const HomeScreen = React.memo(HomeScreenImpl); @@ -187,6 +188,7 @@ export function HomeScreenImpl(): JSX.Element | null { // /FrogCrypto is a special and rendered by (folder) => folder !== FrogCryptoFolderName ) + .filter(isEvent) .sort((a, b) => a.localeCompare(b)) .map((folder) => { return ( diff --git a/apps/passport-client/components/screens/HomeScreen/utils.ts b/apps/passport-client/components/screens/HomeScreen/utils.ts index b49f8008be..0978cfde0a 100644 --- a/apps/passport-client/components/screens/HomeScreen/utils.ts +++ b/apps/passport-client/components/screens/HomeScreen/utils.ts @@ -1,4 +1,9 @@ -export const EVENT_DATES: Record = { +export interface EventInfo { + start: string; + end: string; +} + +export const EVENTS: 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" }, @@ -7,3 +12,7 @@ export const EVENT_DATES: Record = { "ETH Berlin 09": { start: "2023-09-18", end: "2023-09-21" }, "Edge City": { start: "2023-10-18", end: "2023-10-21" } }; + +export function isEvent(folder: string): folder is keyof typeof EVENTS { + return EVENTS[folder] !== undefined; +}