Merge branch 'rebased-main' of https://github.com/hackclub/site into rebased-main

This commit is contained in:
belle 2024-06-16 18:19:09 -04:00
commit dcab4efa5f
2 changed files with 20 additions and 4 deletions

View file

@ -57,7 +57,12 @@ export async function getStaticProps({params}) {
await Promise.all([
shopParts().then(items => {
const availableItems = items.filter(item => item['Enabled'])
const availableItems = items.filter(item => item['Enabled']).map(item => ({
'Name': item['Name'] || null,
'Description': item['Description'] || null,
'Cost Hours': item['Cost Hours'] || 0,
id: item.id
}))
props.availableItems = availableItems
}),
getArcadeUser(userAirtableID).then(user => {

View file

@ -1904,16 +1904,27 @@ export async function getStaticProps() {
const items = await shopParts()
const carousel = items
.filter(item => item['Enabled Carousel'])
.map(record => ({
hours: record['Cost Hours'] || 0,
imageURL: record['Image URL'] || ''
imageURL: record['Image URL'] || '',
enabledCarousel: record['Enabled Carousel'] || false,
}))
.filter(item => item.enabledCarousel)
.filter(item => item.imageURL !== '')
const highlightedItems = items
.filter(item => item['Enabled Highlight'])
.sort((a, b) => Math.random() - 0.5 > 0)
.sort((_a, _b) => Math.random() - 0.5 > 0)
.map(record => ({
// id: record['ID'],
'Image URL': record['Image URL'] || null,
'Name': record['Name'] || null,
'Small Name': record['Small Name'] || null,
'Cost Hours': record['Cost Hours'] || null,
'Description': record['Description'] || null,
'Fulfillment Description': record['Fulfillment Description'] || null,
'Extra tags': record['Extra tags'] || []
}))
return {
props: {