From c01f6045c71ca1fc8548a2801899e7e19e157778 Mon Sep 17 00:00:00 2001 From: BudzioT Date: Thu, 26 Dec 2024 23:16:56 +0100 Subject: [PATCH 1/7] Added shop details --- src/app/harbor/shipyard/ships.tsx | 2 +- src/app/harbor/shop/shop-item-component.js | 57 ++++++++++++++++++++-- src/app/harbor/shop/shop-utils.ts | 11 +++++ 3 files changed, 65 insertions(+), 5 deletions(-) diff --git a/src/app/harbor/shipyard/ships.tsx b/src/app/harbor/shipyard/ships.tsx index 7bbd1a58..428175b3 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 4dc9e78c..9f0e2e9d 100644 --- a/src/app/harbor/shop/shop-item-component.js +++ b/src/app/harbor/shop/shop-item-component.js @@ -8,11 +8,13 @@ import { CardTitle, } from '@/components/ui/card' import { Button } from '@/components/ui/button' -import { useMemo } from 'react' +import React, { useMemo } from 'react' import { cantAffordWords, purchaseWords, sample } from '../../../../lib/flavor' import useLocalStorageState from '../../../../lib/useLocalStorageState.js' import { useState } from 'react' import Icon from '@hackclub/icons' +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]) @@ -46,15 +48,61 @@ export const ShopItemComponent = ({ setFavouriteItems, favouriteItems, }) => { + let [detailsModal, setDetailsModal] = useState(false) + const cardHoverProps = { whileHover: { scale: 1.05, }, } + 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 && ( +

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" > @@ -112,7 +160,8 @@ export const ShopItemComponent = ({ } /> + - { - if (e.target.tagName !== 'BUTTON' && e.target.tagName !== 'FORM') { - setDetailsModal(true) - } - }} + { + 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" > diff --git a/src/app/harbor/shop/shop-utils.ts b/src/app/harbor/shop/shop-utils.ts index 07fa8877..5f9885f5 100644 --- a/src/app/harbor/shop/shop-utils.ts +++ b/src/app/harbor/shop/shop-utils.ts @@ -96,9 +96,15 @@ export async function getShop(): Promise { ), 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], + 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, }) }) From e0496efda01ee7adad62d66f2babff89b4fdee1d Mon Sep 17 00:00:00 2001 From: BudzioT Date: Thu, 26 Dec 2024 23:24:21 +0100 Subject: [PATCH 3/7] Removed customs for US filter --- src/app/harbor/shop/shop-item-component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/harbor/shop/shop-item-component.js b/src/app/harbor/shop/shop-item-component.js index bef92847..9bded2a3 100644 --- a/src/app/harbor/shop/shop-item-component.js +++ b/src/app/harbor/shop/shop-item-component.js @@ -114,7 +114,7 @@ export const ShopItemComponent = ({

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

Customs may apply outside of US!

From 5815ce30b69b496557edef6901d633fce43e5a0a Mon Sep 17 00:00:00 2001 From: BudzioT Date: Thu, 26 Dec 2024 23:29:33 +0100 Subject: [PATCH 4/7] Forgot to prettier one change -_- --- src/app/harbor/shop/shop-item-component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/harbor/shop/shop-item-component.js b/src/app/harbor/shop/shop-item-component.js index 9bded2a3..88f85608 100644 --- a/src/app/harbor/shop/shop-item-component.js +++ b/src/app/harbor/shop/shop-item-component.js @@ -114,7 +114,7 @@ export const ShopItemComponent = ({

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

Customs may apply outside of US!

From ba8e1b88ae89b806fd19dfba4bf73ed821a476b3 Mon Sep 17 00:00:00 2001 From: BudzioT Date: Thu, 9 Jan 2025 22:31:55 +0100 Subject: [PATCH 5/7] Prettier --- lib/redis-lock.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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) From 9f3e55337bf7af0edd93bb68ebb27957b42ef919 Mon Sep 17 00:00:00 2001 From: BudzioT Date: Fri, 10 Jan 2025 19:16:35 +0100 Subject: [PATCH 6/7] Fixed shop details stuff --- src/app/harbor/shop/shop-item-component.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/harbor/shop/shop-item-component.js b/src/app/harbor/shop/shop-item-component.js index b31245a6..97ea79e1 100644 --- a/src/app/harbor/shop/shop-item-component.js +++ b/src/app/harbor/shop/shop-item-component.js @@ -10,7 +10,7 @@ import { CardTitle, } from '@/components/ui/card' import { Button } from '@/components/ui/button' -import React, { useMemo, useState } from 'react' +import { useMemo, useState } from 'react' import { cantAffordWords, purchaseWords, sample } from '../../../../lib/flavor' import Icon from '@hackclub/icons' import { transcript } from '../../../../lib/transcript' @@ -196,7 +196,7 @@ export const ShopItemComponent = ({ height={20} className="mr-1" /> - {filterIndex == 1 ? item.priceUs : item.priceGlobal} + {localPrice} {item.minimumHoursEstimated && item.maximumHoursEstimated ? ( From ba13684a775e3b07271b7304de3b609d23fc09fb Mon Sep 17 00:00:00 2001 From: BudzioT Date: Fri, 10 Jan 2025 19:18:55 +0100 Subject: [PATCH 7/7] Prettier --- src/app/harbor/tavern/tavern.tsx | 49 ++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 18 deletions(-) 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 + 😉