You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
537 B
JavaScript
27 lines
537 B
JavaScript
import React from 'react'
|
|
import Head from 'next/head'
|
|
|
|
import Hero from '~/components/hero'
|
|
import Card from '~/components/card'
|
|
|
|
Index.getInitialProps = async ({ctx})=>{
|
|
const {data: items} = await ctx.axios.get('/api/items')
|
|
return {items}
|
|
}
|
|
|
|
export default function Index({items}){
|
|
return (
|
|
<>
|
|
<Head>
|
|
<title>Society of Socks</title>
|
|
</Head>
|
|
<Hero/>
|
|
<div className="cardContainer">
|
|
{items.map(item=>
|
|
<Card key={item.uuid} item={item}/>
|
|
)}
|
|
</div>
|
|
</>
|
|
)
|
|
}
|