mirror of
https://github.com/System-End/site.git
synced 2026-04-19 22:05:11 +00:00
Create initial shopping page
This commit is contained in:
parent
67425da714
commit
556b2a2fd5
2 changed files with 33 additions and 1 deletions
|
|
@ -11,7 +11,7 @@ const flavorText = async () => {
|
|||
return records
|
||||
}
|
||||
|
||||
const inventoryParts = async () => {
|
||||
export const inventoryParts = async () => {
|
||||
const airtable = new AirtablePlus({
|
||||
apiKey: process.env.AIRTABLE_API_KEY,
|
||||
baseID: "app3ODCEuTL5iGjb3",
|
||||
|
|
|
|||
32
pages/arcade/shop.js
Normal file
32
pages/arcade/shop.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import { inventoryParts } from "../api/arcade/inventory"
|
||||
|
||||
const ShopPage = ({parts}) => {
|
||||
return (
|
||||
<div>
|
||||
<h1>Shop</h1>
|
||||
<ul>
|
||||
{parts.map(part => (
|
||||
<li key={part.id}>
|
||||
<h2>{part.fields['Name']}</h2>
|
||||
<p>{part.fields['Name Small Text']}</p>
|
||||
<p>{part.fields['Hours']}</p>
|
||||
<img src={part.fields['Image URL']} alt={part.fields['Name']} />
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ShopPage
|
||||
|
||||
export async function getStaticProps() {
|
||||
const allparts = await inventoryParts()
|
||||
const parts = allparts.filter(part => part.fields['Enabled'])
|
||||
|
||||
return {
|
||||
props: {
|
||||
parts
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue