Skip to content

Commit

Permalink
Merge pull request #751 from hackclub/malted/nps-fixes
Browse files Browse the repository at this point in the history
Add estimated time to earn prizes
  • Loading branch information
malted authored Nov 13, 2024
2 parents 663b6aa + 75b5e11 commit fb41a45
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/app/harbor/shop/shop-item-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,23 @@ export const ShopItemComponent = ({
dangerouslySetInnerHTML={{ __html: item.subtitle ?? '' }}
></p>

<span className="text-green-500 font-semibold flex items-center">
<img
src="doubloon.svg"
alt="doubloons"
width={20}
height={20}
className="mr-1"
/>
{filterIndex == 1 ? item.priceUs : item.priceGlobal}
</span>
<p className="inline-flex gap-3 items-center">
<span className="text-green-500 font-semibold flex items-center">
<img
src="doubloon.svg"
alt="doubloons"
width={20}
height={20}
className="mr-1"
/>
{filterIndex == 1 ? item.priceUs : item.priceGlobal}
</span>

<span className="text-xs text-gray-600">
({item.minimumHoursEstimated.toFixed(1)} -{' '}
{item.maximumHoursEstimated.toFixed(1)} hours)
</span>
</p>
</CardHeader>
{item.imageUrl && (
<CardContent className="p-0 flex-grow">
Expand Down
8 changes: 8 additions & 0 deletions src/app/harbor/shop/shop-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export interface ShopItem {
fulfilledAtEnd: boolean
comingSoon: boolean
outOfStock: boolean
minimumHoursEstimated: number
maximumHoursEstimated: number
}

export async function getPerson() {
Expand Down Expand Up @@ -79,6 +81,12 @@ export async function getShop(): Promise<ShopItem[]> {
) as boolean,
comingSoon: Boolean(record.get('coming_soon')) as boolean,
outOfStock: Boolean(record.get('out_of_stock')) as boolean,
minimumHoursEstimated: Number(
record.get('minimum_hours_estimated'),
),
maximumHoursEstimated: Number(
record.get('maximum_hours_estimated'),
),
})
})

Expand Down

0 comments on commit fb41a45

Please sign in to comment.