-
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
5 changed files
with
67 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,17 +3,18 @@ import { fmtDate, fmtTime } from "@/utils/dates.ts"; | |
import { useSignal } from "@preact/signals"; | ||
import { useEffect } from "preact/hooks"; | ||
import { qrcode } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { asset } from "$fresh/runtime.ts"; | ||
import { QR } from "@/components/svgs/qr.tsx"; | ||
|
||
export default function Ticket({ | ||
showTime, | ||
id, | ||
tickets, | ||
venue, | ||
}: { | ||
tickets: number; | ||
showTime: ShowTime; | ||
id: string; | ||
venue?: string; | ||
}) { | ||
const qr = useSignal<undefined | string>(undefined); | ||
|
||
|
@@ -41,39 +42,36 @@ export default function Ticket({ | |
<div class="bg-gray-100 border font-semibold text-gray-700 px-1.5 text-sm rounded-md w-max mt-4 mb-2 "> | ||
{tickets} ticket{tickets > 1 && "s"} | ||
</div> | ||
|
||
{qr.value != undefined ? ( | ||
<img src={qr.value} alt="QR Code" width={232} /> | ||
) : ( | ||
<QR /> | ||
)} | ||
<p class="text-xs text-gray-500 text-center mt-4"> | ||
ID: {id.split("_")[2]} | ||
</p> | ||
<div class="grid gap-2"> | ||
<div class="grid gap-2 mt-4 font-medium "> | ||
<div> | ||
<h5 class="font-medium mb-0.5 mt-4 text-sm text-center"> | ||
Event Date & Time | ||
</h5> | ||
<div class="bg-gray-100 border font-medium px-1.5 rounded-md text-center"> | ||
<div class="bg-gray-100 border px-1.5 rounded-md text-center"> | ||
{fmtDate(new Date(showTime.startDate!))} | ||
</div> | ||
</div> | ||
<div class="flex justify-center"> | ||
{showTime.startTime && ( | ||
<div class="lowercase bg-gray-100 border font-medium px-1.5 rounded-md"> | ||
<div class="lowercase bg-gray-100 border px-1.5 rounded-md"> | ||
{fmtTime(new Date(showTime.startTime))} | ||
</div> | ||
)} | ||
{showTime.endTime && ( | ||
<> | ||
<p class="px-3">-</p> | ||
<div class="lowercase bg-gray-100 border font-medium px-1.5 rounded-md"> | ||
<div class="lowercase bg-gray-100 border px-1.5 rounded-md"> | ||
{fmtTime(new Date(showTime.endTime))} | ||
</div> | ||
</> | ||
)} | ||
</div> | ||
</div> | ||
|
||
|
||
</div> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Button from "@/components/buttons/button.tsx"; | ||
import Printer from "$tabler/printer.tsx" | ||
import Trash from "$tabler/trash.tsx" | ||
|
||
const TicketActions = () => { | ||
return ( | ||
<div class="flex gap-4 print:hidden"> | ||
<Button icon={<Printer class="size-6" />} label="Print Ticket" onClick={() => print()} /> | ||
<Button icon={<Trash class="size-6" />} label="Release Ticket" /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default TicketActions; |
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