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.

23 lines
425 B
JavaScript

import React from 'react'
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 (
<>
<Hero/>
<div className="cardContainer">
{items.map(item=>
<Card item={item}/>
)}
</div>
</>
)
}