From 0861556e5ff01e6a0c6d6547b8a2267a5c963023 Mon Sep 17 00:00:00 2001 From: Andrew Smithwick Date: Wed, 17 Apr 2024 16:47:37 -0700 Subject: [PATCH] Cart Pickup Event Picker Changes (#232) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added complete and cancel buttons to PickupEvent Edit Page Also fixed text wrap issue Also updated Button component to take in class names * Added buttons to admin pickup home page * Moved complete and edit buttons to single pickup event page Updated button styling for pickup event page Updated common Button component styling to auto expand to content Hide the complete/cancel buttons if the event isn't active * Removed unnecessary CSS * Fixed bug with linkedEventUuid not found edge case If you clicked the select a pickup event toggle but didn't select an event, the API call wouldn't work b/c the linkedEventUuid would be '', not null. Fixed the issue by changing value to be null when linkedEventUuid is '' * Made admin pickup events sort by start date * Removed console.log (For last commit) https://stackoverflow.com/questions/54634515/typescript-sorting-object-by-date * Refactored code to eliminate creation of new variable You have to specify the key name like linkedEventUuid: linkedEventUuid || null the shorthand only works if you pass in a single variable that’s used as the key and value like u did for title * Added checks to make weird dates not break code added a popup instead * Use instanceof instead of === for error check * Added function to parse props for complete and cancel functions * Make full pickup events not show on cart page * Styled create pickup event button * Made the border on the pickup event card in cart page not glow https://css-tricks.com/a-complete-guide-to-data-attributes/ * Addressed nits on PR --- src/components/events/EventCard/index.tsx | 1 + .../events/EventCard/style.module.scss | 2 +- src/pages/admin/store/pickup/index.tsx | 17 +++++++++-------- src/pages/store/cart.tsx | 6 +++++- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/components/events/EventCard/index.tsx b/src/components/events/EventCard/index.tsx index a67b728a..d03f6805 100644 --- a/src/components/events/EventCard/index.tsx +++ b/src/components/events/EventCard/index.tsx @@ -74,6 +74,7 @@ const EventCard = ({ { e.preventDefault(); diff --git a/src/components/events/EventCard/style.module.scss b/src/components/events/EventCard/style.module.scss index ce67e5dc..d2e9962c 100644 --- a/src/components/events/EventCard/style.module.scss +++ b/src/components/events/EventCard/style.module.scss @@ -20,7 +20,7 @@ border-radius: 10px; } - &:not([disabled]):hover { + &:not([data-disabled]):hover { outline-width: 4px; transform: scale(0.975); diff --git a/src/pages/admin/store/pickup/index.tsx b/src/pages/admin/store/pickup/index.tsx index 881891e4..c0d1c07d 100644 --- a/src/pages/admin/store/pickup/index.tsx +++ b/src/pages/admin/store/pickup/index.tsx @@ -25,14 +25,15 @@ const AdminPickupPage = ({ futurePickupEvents, pastPickupEvents }: AdminPickupPa Manage Pickup Events - - +
+ +