Skip to content

Commit

Permalink
Merge branch 'sean/hover-collection-second-image' of https://github.c…
Browse files Browse the repository at this point in the history
…om/acmucsd/membership-portal-ui-v2 into sean/hover-collection-second-image
  • Loading branch information
SheepTester committed Apr 29, 2024
2 parents 5328f4f + fe44934 commit 8d173a4
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 22 deletions.
23 changes: 14 additions & 9 deletions src/components/events/EventBadges/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,35 @@
animation: pulse 1s ease-in-out infinite alternate;

@keyframes pulse {
0% { opacity: 0 }
100% {opacity: 1 }
0% {
opacity: 0;
}

100% {
opacity: 1;
}
}
}

&::before {
animation: pulse2 2s ease-out forwards infinite;
animation: pulse2 2s ease-out reverse infinite;
border: 2px solid vars.$danger-1;
border-radius: 5px;
content: '';
position: absolute;

@keyframes pulse2 {
0% {
filter: blur(0);
inset: 0;
opacity: 1;
}

100% {
filter: blur(2px);
inset: -0.75rem;
opacity: 0;
}

100% {
filter: blur(0);
inset: 0;
opacity: 1;
}
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/components/store/OrderCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const OrderCard = ({ order, futurePickupEvents }: OrderCardProps) => {
const [pickupEvent, setPickupEvent] = useState<PublicOrderPickupEvent>(order.pickupEvent);
const [orderStatus, setOrderStatus] = useState<OrderStatus>(order.status);
const orderOpen = open && orderData !== null;
const [statusName, setStatusName] = useState<string>(orderStatusName[orderStatus]);

useEffect(() => {
if (open && orderData === null) {
Expand All @@ -57,8 +58,10 @@ const OrderCard = ({ order, futurePickupEvents }: OrderCardProps) => {
reportError('Error loading order!', e);
setOrderData(null);
});
} else if (open) {
setStatusName(orderStatusName[orderStatus]);
}
}, [open, order.uuid, orderData]);
}, [open, order.uuid, orderData, pickupEvent, orderStatus]);

const cancelOrder = async () => {
await StoreManager.cancelMerchOrder(order.uuid);
Expand All @@ -68,10 +71,10 @@ const OrderCard = ({ order, futurePickupEvents }: OrderCardProps) => {
const rescheduleOrderPickup = async (pickup: PublicOrderPickupEvent) => {
await StoreManager.rescheduleOrderPickup(order.uuid, pickup.uuid);
setPickupEvent(pickup);
setOrderStatus(OrderStatus.PLACED);
};

const statusColor = orderStatusColor[orderStatus];
const statusName = orderStatusName[orderStatus];

return (
<div className={styles.card}>
Expand Down
6 changes: 5 additions & 1 deletion src/components/store/OrderSummary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ const isOrderActionable = (status: OrderStatus, pickupEvent: PublicOrderPickupEv
const now = new Date();
const eventStart = new Date(pickupEvent.start);
eventStart.setDate(eventStart.getDate() - 2);
if (now > eventStart) {
if (
now > eventStart &&
status !== OrderStatus.PICKUP_MISSED &&
status !== OrderStatus.PICKUP_CANCELLED
) {
return false;
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/components/store/PickupEventDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const PickupEventDetail = ({ pickupEvent }: PickupEventDetailProps) => {
{title}
</Typography>
<Typography variant="h2/regular" className={styles.title} suppressHydrationWarning>
{formatEventDate(start, end)}
{formatEventDate(start, end, true)}
</Typography>
{hasLinkedEvent ? (
<Typography variant="h3/regular">{linkedEvent?.location}</Typography>
Expand Down
20 changes: 11 additions & 9 deletions src/components/store/PickupEventPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ const PickupEventPicker = ({ events, eventIndex, setEventIndex, active }: EventP
className={styles.slider}
style={{ transform: `translateX(calc(-1 * var(--width) * ${eventIndex}))` }}
>
{events.map(event => (
<EventCard
key={event.uuid}
event={event}
attended={false}
borderless
showYear={false}
/>
))}
{events
.sort((a, b) => new Date(a.start).getTime() - new Date(b.start).getTime())
.map(event => (
<EventCard
key={event.uuid}
event={event}
attended={false}
borderless
showYear={false}
/>
))}
</div>
) : (
<div className={styles.noEvents}>
Expand Down

0 comments on commit 8d173a4

Please sign in to comment.