From 2dc7dabee59f69efc3f9384495d2ffaf3aed710c Mon Sep 17 00:00:00 2001 From: Andrew Smithwick Date: Sat, 30 Mar 2024 00:50:44 -0700 Subject: [PATCH] Removed mandatory requirement for linked event Also fixed linting errors and removed unnecessary css --- .../AdminPickupEvent/AdminPickupEventForm.tsx | 6 +- .../event/AdminPickupEvent/style.module.scss | 65 ------------------- src/lib/types/apiRequests.ts | 2 +- src/pages/admin/store/pickup/index.tsx | 4 +- 4 files changed, 6 insertions(+), 71 deletions(-) diff --git a/src/components/admin/event/AdminPickupEvent/AdminPickupEventForm.tsx b/src/components/admin/event/AdminPickupEvent/AdminPickupEventForm.tsx index 7234c47b..7eb74982 100644 --- a/src/components/admin/event/AdminPickupEvent/AdminPickupEventForm.tsx +++ b/src/components/admin/event/AdminPickupEvent/AdminPickupEventForm.tsx @@ -31,7 +31,7 @@ const AdminPickupEventForm = ({ mode, defaultData = {}, token, upcomingEvents }: end: DateTime.fromISO(defaultData?.end ?? '').toFormat("yyyy-MM-dd'T'HH:mm"), description: defaultData.description ?? '', orderLimit: defaultData.orderLimit ?? 0, - linkedEventUuid: defaultData.linkedEvent?.uuid ?? '', + linkedEventUuid: defaultData.linkedEvent?.uuid ?? null, }; const { @@ -230,9 +230,7 @@ const AdminPickupEventForm = ({ mode, defaultData = {}, token, upcomingEvents }: id="" placeholder={defaultFormText} defaultValue={defaultFormText} - {...register('linkedEventUuid', { - required: 'Required', - })} + {...register('linkedEventUuid', {})} > diff --git a/src/components/admin/event/AdminPickupEvent/style.module.scss b/src/components/admin/event/AdminPickupEvent/style.module.scss index ca9dcccb..e1170a9c 100644 --- a/src/components/admin/event/AdminPickupEvent/style.module.scss +++ b/src/components/admin/event/AdminPickupEvent/style.module.scss @@ -10,16 +10,6 @@ h1 { font-size: 2rem; } - - .viewPage { - background-color: var(--theme-primary-2); - border-radius: 0.5rem; - color: var(--theme-background); - display: flex; - font-weight: bold; - gap: 0.5rem; - padding: 0.5rem; - } } .form { @@ -27,61 +17,6 @@ display: grid; grid-template-columns: 1fr 3fr; row-gap: 1rem; - - [type='color'] { - cursor: pointer; - max-width: 5rem; - padding: 0 !important; - } -} - -.photos { - display: grid; - gap: 1rem; - grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); - margin: 1rem 0; - - @media (max-width: vars.$breakpoint-sm) { - grid-template-columns: 1fr 1fr; - } - - li { - aspect-ratio: 1 / 1; - position: relative; - - img { - background-color: var(--theme-surface-1); - border-radius: 20px; - object-fit: cover; - } - - button { - position: absolute; - right: 0.5rem; - top: 0.5rem; - z-index: 2; - } - - .addImage { - align-items: center; - border: 1px solid var(--theme-shadow); - border-radius: 20px; - cursor: pointer; - display: flex; - height: 100%; - justify-content: center; - width: 100%; - - svg { - height: 1.5rem; - width: 1.5rem; - } - - [type='file'] { - @include vars.accessibly-hidden; - } - } - } } .submitButtons { diff --git a/src/lib/types/apiRequests.ts b/src/lib/types/apiRequests.ts index 2918d0b3..2dafebad 100644 --- a/src/lib/types/apiRequests.ts +++ b/src/lib/types/apiRequests.ts @@ -350,7 +350,7 @@ export interface OrderPickupEvent { end: string; description: string; orderLimit: number; - linkedEventUuid?: UUID; + linkedEventUuid?: UUID | null; } export interface DeletePickupEventRequest { diff --git a/src/pages/admin/store/pickup/index.tsx b/src/pages/admin/store/pickup/index.tsx index 155c004d..b82ae210 100644 --- a/src/pages/admin/store/pickup/index.tsx +++ b/src/pages/admin/store/pickup/index.tsx @@ -22,7 +22,9 @@ const AdminPickupPage = ({ futurePickupEvents, pastPickupEvents }: AdminPickupPa return (
- Manage Pickup Events + + Manage Pickup Events +