diff --git a/lib/redis-lock.ts b/lib/redis-lock.ts index 8d793c92..66c50045 100644 --- a/lib/redis-lock.ts +++ b/lib/redis-lock.ts @@ -15,10 +15,7 @@ async function aquireLock(key: string): Promise { return acquired ? lockValue : null } -async function releaseLock( - lockKey: string, - lockValue: string, -): Promise { +async function releaseLock(lockKey: string, lockValue: string): Promise { const currentLockValue = await kv.get(lockKey) if (currentLockValue === lockValue) { await kv.del(lockKey) diff --git a/src/app/harbor/shipyard/ships.tsx b/src/app/harbor/shipyard/ships.tsx index 188e5b02..d425550d 100644 --- a/src/app/harbor/shipyard/ships.tsx +++ b/src/app/harbor/shipyard/ships.tsx @@ -234,7 +234,7 @@ export default function Ships({ setShipModal(false)}> -
+

Confirm Shipping

diff --git a/src/app/harbor/shop/shop-item-component.js b/src/app/harbor/shop/shop-item-component.js index c9a7f337..97ea79e1 100644 --- a/src/app/harbor/shop/shop-item-component.js +++ b/src/app/harbor/shop/shop-item-component.js @@ -10,10 +10,12 @@ import { CardTitle, } from '@/components/ui/card' import { Button } from '@/components/ui/button' -import { useMemo } from 'react' +import { useMemo, useState } from 'react' import { cantAffordWords, purchaseWords, sample } from '../../../../lib/flavor' import Icon from '@hackclub/icons' import { transcript } from '../../../../lib/transcript' +import Modal from '@/components/ui/modal' +import Image from 'next/image' const ActionArea = ({ item, filterIndex, affordable }) => { const buyWord = useMemo(() => sample(purchaseWords), [item.id]) const getYourRacksUp = useMemo(() => sample(cantAffordWords), [item.id]) @@ -47,6 +49,8 @@ export const ShopItemComponent = ({ setFavouriteItems, favouriteItems, }) => { + let [detailsModal, setDetailsModal] = useState(false) + const cardHoverProps = { whileHover: { scale: 1.05, @@ -89,9 +93,85 @@ export const ShopItemComponent = ({ }) } + const linkIndex = Number(filterIndex) - 1 + return ( - + + setDetailsModal(false)}> +
+

{item.name}

+

+ {item.name} + + {item.description && ( +

+ )} + + + + {item.limited_qty && ( + + This item is limited, buy it while you can! + + )} + + {item.fulfillment_description && ( +

+ )} + + {item.links && linkIndex >= 0 && item.links[linkIndex] && ( +

+ We will most likely order it from{' '} + + this link + +

+ )} + + {item.customs_likely && linkIndex !== 0 && ( +

+ Customs may apply outside of US! +

+ )} +
+ + +
+ { + if (e.target.tagName !== 'BUTTON' && e.target.tagName !== 'FORM') { + setDetailsModal(true) + } + }} id={id} className="h-full flex flex-col overflow-hidden shadow-lg transition-shadow duration-300 hover:shadow-xl" > @@ -133,7 +213,9 @@ export const ShopItemComponent = ({ {item.name} { + onClick={(e) => { + e.stopPropagation() + setDetailsModal(false) let interaction = transcript('item.base', { name: item.name, price: localPrice, diff --git a/src/app/harbor/shop/shop-utils.ts b/src/app/harbor/shop/shop-utils.ts index d444213d..930b2cf2 100644 --- a/src/app/harbor/shop/shop-utils.ts +++ b/src/app/harbor/shop/shop-utils.ts @@ -30,6 +30,11 @@ export interface ShopItem { outOfStock: boolean minimumHoursEstimated: number maximumHoursEstimated: number + description: string | null + customs_likely: boolean | null + fulfillment_description: string | null + links: string[] | null[] + limited_qty: boolean | null } export async function getShop(): Promise { @@ -80,6 +85,18 @@ export async function getShop(): Promise { maximumHoursEstimated: Number( record.get('maximum_hours_estimated'), ), + description: record.get('description') as string | null, + customs_likely: Boolean(record.get('customs_likely')) as boolean, + fulfillment_description: record.get('fulfillment_description') as + | string + | null, + links: [ + record.get('third_party_link_us') as string, + record.get('third_party_link_eu') as string, + record.get('third_party_link_in') as string, + record.get('third_party_link_ca') as string, + ], + limited_qty: Boolean(record.get('limited_qty')) as boolean, }) }) diff --git a/src/app/harbor/tavern/tavern.tsx b/src/app/harbor/tavern/tavern.tsx index d0420b41..1e971f0b 100644 --- a/src/app/harbor/tavern/tavern.tsx +++ b/src/app/harbor/tavern/tavern.tsx @@ -47,36 +47,49 @@ export default function Tavern() {

- On January 31st, thousands of ships will sail back to port, weathered and weary from their months-long voyage upon the High Seas. And yet, their journey—your journey—ends not at the dock… but in the firelit alcoves of the ✨Mystic Tavern✨. + On January 31st, thousands of ships will sail back to port, + weathered and weary from their months-long voyage upon the High + Seas. And yet, their journey—your journey—ends not at the dock… but + in the firelit alcoves of the ✨Mystic Tavern✨.

- Join your fellow sailors to share tales and make merry over flagons of milk, to boast of your booty and exclaim the exploits of your greatest ships! Oh, and since most pirates don’t own cars, Hack Club’s gas fund will cover your transportation. + Join your fellow sailors to share tales and make merry over flagons + of milk, to boast of your booty and exclaim the exploits of your + greatest ships! Oh, and since most pirates don’t own cars, Hack + Club’s{' '} + + gas fund + {' '} + will cover your transportation.

- The tavern is not a single location, but a manifestation of pirate camaraderie known to appear wherever an intrepid sailor focuses their spirit. We need captains in every city to step up and make their local Mystic Tavern their final and most selfless ship. + The tavern is not a single location, but a manifestation of pirate + camaraderie known to appear wherever an intrepid sailor focuses + their spirit.{' '} + + We need captains in every city to step up and make their local + Mystic Tavern their final and most selfless ship. +

- Should you wish to organize such a gathering of shipmates, here are some things that will be asked of you: + Should you wish to organize such a gathering of shipmates, here are + some things that will be asked of you:

    +
  • Pick a date during the third week of February
  • - Pick a date during the third week of February -
  • -
  • - Find a local venue (coffee shop, restaurant, library, park, whatever) -
  • -
  • - Manage signups and communications for pirates in your area -
  • -
  • - Receive and distribute special shirts at the event -
  • -
  • - Make it memorable for people! + Find a local venue (coffee shop, restaurant, library, park, + whatever)
  • +
  • Manage signups and communications for pirates in your area
  • +
  • Receive and distribute special shirts at the event
  • +
  • Make it memorable for people!

- So RSVP today to meet your local hearties at a tavern near you. Better yet, volunteer to make one happen! Because like, Hack Club is made of real people. You should meet each other, you’re pretty cool 😉 + So RSVP today to meet your local hearties at a tavern near you. + Better yet, volunteer to make one happen! Because like, Hack Club is + made of real people. You should meet each other, you’re pretty cool + 😉