Skip to content

Commit

Permalink
Removed mandatory requirement for linked event
Browse files Browse the repository at this point in the history
Also fixed linting errors and removed unnecessary css
  • Loading branch information
WishingWell13 committed Mar 30, 2024
1 parent cef472e commit 2dc7dab
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -230,9 +230,7 @@ const AdminPickupEventForm = ({ mode, defaultData = {}, token, upcomingEvents }:
id=""
placeholder={defaultFormText}
defaultValue={defaultFormText}
{...register('linkedEventUuid', {
required: 'Required',
})}
{...register('linkedEventUuid', {})}
>
<option disabled>{defaultFormText}</option>

Expand Down
65 changes: 0 additions & 65 deletions src/components/admin/event/AdminPickupEvent/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,78 +10,13 @@
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 {
column-gap: 8px;
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 {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/types/apiRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export interface OrderPickupEvent {
end: string;
description: string;
orderLimit: number;
linkedEventUuid?: UUID;
linkedEventUuid?: UUID | null;
}

export interface DeletePickupEventRequest {
Expand Down
4 changes: 3 additions & 1 deletion src/pages/admin/store/pickup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ const AdminPickupPage = ({ futurePickupEvents, pastPickupEvents }: AdminPickupPa
return (
<div className={styles.page}>
<div className={styles.header}>
<Typography variant="h1/bold" style={{ marginRight: 'auto' }}>Manage Pickup Events</Typography>
<Typography variant="h1/bold" style={{ marginRight: 'auto' }}>
Manage Pickup Events
</Typography>

<button
type="button"
Expand Down

0 comments on commit 2dc7dab

Please sign in to comment.