-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
88 additions
and
50 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
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ import { useSignal } from "@preact/signals"; | |
import { useEffect } from "preact/hooks"; | ||
import { qrcode } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { QR } from "@/components/svgs/qr.tsx"; | ||
import { ClientDate } from "@/islands/events/viewing/dates.tsx"; | ||
|
||
export default function Ticket({ | ||
showTime, | ||
|
@@ -51,7 +52,11 @@ export default function Ticket({ | |
<div class="grid gap-2 mt-4 font-medium "> | ||
<div> | ||
<div class="bg-gray-100 border px-1.5 rounded-md text-center"> | ||
{fmtDate(new Date(showTime.startDate!))} | ||
{showTime.startTime ? ( | ||
fmtDate(new Date(showTime.startDate)) | ||
) : ( | ||
<ClientDate date={showTime.startDate} /> | ||
)} | ||
</div> | ||
</div> | ||
<div class="flex justify-center"> | ||
|
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
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
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,21 +1,22 @@ | ||
import { ShowTime } from "@/utils/db/kv.ts"; | ||
|
||
export const fixDate = (showTimes: ShowTime[]) => showTimes.map((showTime) => { | ||
if (!showTime.startTime) return showTime; | ||
const date = new Date(showTime.startDate); | ||
const time = new Date(showTime.startTime); | ||
export const fixDate = (showTimes: ShowTime[]) => | ||
showTimes.map((showTime) => { | ||
if (!showTime.startTime) return showTime; | ||
const date = new Date(showTime.startDate); | ||
const time = new Date(showTime.startTime); | ||
|
||
if (time) { | ||
date.setHours(time.getHours()); | ||
date.setMinutes(time.getMinutes()); | ||
} else { | ||
// remove the hours and just display as normal if user doesn't add a start date | ||
date.setHours(0); | ||
date.setMinutes(0); | ||
} | ||
if (time) { | ||
date.setHours(time.getHours()); | ||
date.setMinutes(time.getMinutes()); | ||
} else { | ||
// remove the hours and just display as normal if user doesn't add a start date | ||
date.setHours(0); | ||
date.setMinutes(0); | ||
} | ||
|
||
return { | ||
...showTime, | ||
startDate: date.toString(), | ||
}; | ||
}) | ||
return { | ||
...showTime, | ||
startDate: date.toString(), | ||
}; | ||
}); |
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,15 +1,15 @@ | ||
import imagekit from "@/utils/imagekit/index.ts"; | ||
|
||
export const getURL = (width: number, path: string) => | ||
["png", "webp"].map((fmt) => | ||
imagekit!.url({ | ||
path, | ||
transformation: [ | ||
{ | ||
width: width.toString(), | ||
quality: "85", | ||
format: fmt, | ||
}, | ||
], | ||
}), | ||
); | ||
["png", "webp"].map((fmt) => | ||
imagekit!.url({ | ||
path, | ||
transformation: [ | ||
{ | ||
width: width.toString(), | ||
quality: "85", | ||
format: fmt, | ||
}, | ||
], | ||
}), | ||
); |