diff --git a/.prettierignore b/.prettierignore index 0b09f47..5586fe9 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,4 +2,5 @@ googlea82f3fcba9c8e379.html _fresh/ /db /static/output.css -/out \ No newline at end of file +/out +.react-email \ No newline at end of file diff --git a/deno.jsonc b/deno.jsonc index 9ee99a5..84a029d 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -33,5 +33,5 @@ "@react-email/components": "npm:@react-email/components" }, "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" }, - "exclude": ["**/_fresh/*"] + "exclude": ["**/_fresh/*", "./.react-email/*"] } diff --git a/emails/login.tsx b/emails/login.tsx index 53104ff..27c13e3 100644 --- a/emails/login.tsx +++ b/emails/login.tsx @@ -38,7 +38,10 @@ export default function LoginEmail({ otp = "123456" }: { otp: string }) { }} > - Your authorization code for Events is {`{{OTP-PART-1}}{{OTP-PART-2}}`} + + Your authorization code for Events is{" "} + {`{{OTP-PART-1}}{{OTP-PART-2}}`} + - + ); }; diff --git a/islands/events/viewing/register/index.tsx b/islands/events/viewing/register/index.tsx index 2d8ea32..52b6168 100644 --- a/islands/events/viewing/register/index.tsx +++ b/islands/events/viewing/register/index.tsx @@ -40,13 +40,10 @@ export default function EventRegister({ const toggles = useSignal>({ ...additionalFields .filter((field) => field.type == "toggle") - .reduce( - (acc, field) => { - acc[field.id] = false; - return acc; - }, - {} as Record, - ), + .reduce((acc, field) => { + acc[field.id] = false; + return acc; + }, {} as Record), }); const perfEntries = performance.getEntriesByType("navigation"); @@ -74,13 +71,10 @@ export default function EventRegister({ email: email || "", ...additionalFields .filter((field) => field.type != "toggle") - .reduce( - (acc, field) => { - acc[field.id] = field.type === "number" ? 0 : ""; - return acc; - }, - {} as Record, - ), + .reduce((acc, field) => { + acc[field.id] = field.type === "number" ? 0 : ""; + return acc; + }, {} as Record), }, onSubmit: (form) => submitForm(form.formState!), // TODO: add client side validation @@ -89,11 +83,11 @@ export default function EventRegister({ const submitForm = (formState: FormState) => { if (user) { - createTicket(formState) + createTicket(formState); return; } - page.value = 2 - } + page.value = 2; + }; const createTicket = async (formState: FormState) => { const formStates: { id: string; value: unknown }[] = []; @@ -277,9 +271,17 @@ export default function EventRegister({ /> )} - { - page.value === 2 && createTicket(formState())} error={error} /> - } + {page.value === 2 && ( + createTicket(formState())} + error={error} + /> + )} {page.value === 3 && ( // After user has acquired tickets <> diff --git a/islands/events/viewing/register/login.tsx b/islands/events/viewing/register/login.tsx index 77057fb..c3012f4 100644 --- a/islands/events/viewing/register/login.tsx +++ b/islands/events/viewing/register/login.tsx @@ -29,7 +29,11 @@ const Login = ({ }) => ( <>
- +
{error.value && (
diff --git a/islands/loginForm.tsx b/islands/loginForm.tsx index b071c76..044a2fc 100644 --- a/islands/loginForm.tsx +++ b/islands/loginForm.tsx @@ -49,10 +49,9 @@ const LoginForm = ({ setError(undefined); const passed = - /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ - .test( - email.value, - ); + /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test( + email.value, + ); if (!passed) { setError("Enter a valid email"); return; @@ -173,7 +172,9 @@ const LoginForm = ({ {/* login code input */}

- {emailInputted ? "To verify that you're you, please enter the code we emailed you below" : "We just emailed you a login code! Please enter it below."} + {emailInputted + ? "To verify that you're you, please enter the code we emailed you below" + : "We just emailed you a login code! Please enter it below."}

diff --git a/routes/events/[id]/(no-layout)/index.tsx b/routes/events/[id]/(no-layout)/index.tsx index 74da035..88352eb 100644 --- a/routes/events/[id]/(no-layout)/index.tsx +++ b/routes/events/[id]/(no-layout)/index.tsx @@ -20,12 +20,11 @@ export default defineRoute((req, ctx: RouteContext) => { const { event, eventID, user } = ctx.state.data; // # of tickets that the user has const tickets = event.showTimes.filter((time) => - acquired(user?.data, eventID, time.id) + acquired(user?.data, eventID, time.id), ).length; - const booked = event.showTimes.every((time) => - happened(time.startDate, time.startTime) - ) || + const booked = + event.showTimes.every((time) => happened(time.startDate, time.startTime)) || event.showTimes.every((time) => time.soldTickets == time.maxTickets); const sizes = [320, 480, 720, 900, 1080, 1280, 1440, 2160, 4320]; @@ -40,14 +39,12 @@ export default defineRoute((req, ctx: RouteContext) => {

{event.showTimes.length > 1 && "Begins"}{" "} - {event.showTimes[0].startTime - ? ( - fmtDate(new Date(event.showTimes[0].startDate)) - ) - : ( - /* force dates to be the same across timezones if there's no startime */ - - )}{" "} + {event.showTimes[0].startTime ? ( + fmtDate(new Date(event.showTimes[0].startDate)) + ) : ( + /* force dates to be the same across timezones if there's no startime */ + + )}{" "} {event.showTimes.length == 1 && event.showTimes[0].startTime && @@ -87,8 +84,7 @@ export default defineRoute((req, ctx: RouteContext) => { dangerouslySetInnerHTML={{ __html: md.render(event.description), }} - > - + >

)} @@ -101,8 +97,8 @@ export default defineRoute((req, ctx: RouteContext) => { {event.showTimes.length == 1 && event.showTimes[0].lastPurchaseDate && (

The last day to get tickets is{" "} - {" "} - at Midnight ( + at + Midnight ( {getTimeZone(new Date(event.showTimes[0].lastPurchaseDate))})

)} @@ -155,13 +151,17 @@ export default defineRoute((req, ctx: RouteContext) => { /> {/* */} @@ -184,25 +184,23 @@ export default defineRoute((req, ctx: RouteContext) => { )}
- {event.banner.path - ? ( - - ) - : ( - Placeholder Image - )} + {event.banner.path ? ( + + ) : ( + Placeholder Image + )}
@@ -216,38 +214,34 @@ export default defineRoute((req, ctx: RouteContext) => {
)} <> - {event.showTimes.length === 1 && tickets === 1 - ? ( -
-

- You're already registered for this event! Edit or view - ticket below. -

- - View Ticket - -
+ {event.showTimes.length === 1 && tickets === 1 ? ( +
+

+ You're already registered for this event! Edit or view ticket + below. +

+ + View Ticket + +
+ ) : ( + !booked && + clientShowTimes.length > 0 && ( + ) - : ( - !booked && - clientShowTimes.length > 0 && ( - - ) - )} + )} {event.showTimes.length === 1 && (
@@ -263,9 +257,11 @@ export default defineRoute((req, ctx: RouteContext) => { event.showTimes[0].startDate, event.showTimes[0].startTime, )} - windowClosed={event.showTimes[0].lastPurchaseDate != undefined - ? happened(event.showTimes[0].lastPurchaseDate) - : false} + windowClosed={ + event.showTimes[0].lastPurchaseDate != undefined + ? happened(event.showTimes[0].lastPurchaseDate) + : false + } />
)}