Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
ichub committed Jul 24, 2024
1 parent 38b5dce commit 9d9f300
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
16 changes: 16 additions & 0 deletions apps/passport-client/components/screens/HomeScreen/Folder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 (
<FolderEntryContainer
style={style}
Expand All @@ -32,6 +42,12 @@ export function FolderCard({
{getNameFromPath(folder)}
<div className="font-normal text-sm">
{pcds.length} ticket{pcds.length > 1 ? "s" : ""}
{dateStr && (
<span>
{" · "}
{dateStr}
</span>
)}
</div>
</FolderEntryContainer>
);
Expand Down
9 changes: 9 additions & 0 deletions apps/passport-client/components/screens/HomeScreen/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const EVENT_DATES: Record<string, { start: string; end: string }> = {
"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" }
};

0 comments on commit 9d9f300

Please sign in to comment.