mirror of
https://github.com/System-End/site.git
synced 2026-04-19 22:05:11 +00:00
Merge branch 'rebased-main' of https://github.com/hackclub/site into rebased-main
This commit is contained in:
commit
dcab4efa5f
2 changed files with 20 additions and 4 deletions
|
|
@ -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 => {
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue