Skip to content

Commit

Permalink
Merge branch 'main' into updateteampage
Browse files Browse the repository at this point in the history
  • Loading branch information
rluodev authored Jun 21, 2024
2 parents da9acc5 + aeeb1e4 commit eae3763
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
19 changes: 19 additions & 0 deletions components/arcade/prizes.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const Prizes = ({
onQuantityChange,
index,
hoursBalance,
Stock,
...props
}) => {
const parsedFulfillmentDesc = fulfillmentDescription?.replace(
Expand Down Expand Up @@ -63,6 +64,24 @@ const Prizes = ({
alt={text}
/>
</Flex>
{Stock && Stock != null && Stock > 0 && Stock <= 100 && (
<Text
sx={{
background: '#CC6CE7',
px: '20px',
color: '#FFEEC6',
position: 'absolute',
top: '-15px',
left: '-12px',
zIndex: 1,
transform: `rotate(${ticketRotation}deg)`
}}
variant="headline"
className="gaegu"
>
Only {Stock} left!
</Text>
)}
<Text
className="slackey"
variant="headline"
Expand Down
1 change: 1 addition & 0 deletions components/arcade/shop-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export default function ShopComponent({
id={item.id}
onQuantityChange={(id, q) => handleQuantityChange(item.id, q)} // Pass handler to update quantity
hoursBalance={hoursBalance}
Stock={item['Stock']}
/>
))}
</Grid>
Expand Down
3 changes: 2 additions & 1 deletion pages/arcade/[userAirtableID]/shop.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ export async function getStaticProps({params}) {
'Cost Hours': item['Cost Hours'] || 0,
id: item.id,
'Image URL': item['Image URL'] || null,
'Max Order Quantity': item['Max Order Quantity'] || 1
'Max Order Quantity': item['Max Order Quantity'] || 1,
Stock: item['Stock'] || null
}))
props.availableItems = availableItems
}),
Expand Down

0 comments on commit eae3763

Please sign in to comment.