fantus/pages/sets.tsx

31 lines
819 B
TypeScript
Raw Normal View History

2020-01-17 01:12:12 +01:00
import React, { useState, useEffect } from 'react'
import { NextPage } from 'next'
import axios from 'axios'
const Home: NextPage = () => {
const [links, setLinks] = useState([] as string[])
useEffect(() => {
axios.get('https://api.fantus.studio/directus/items/mixes?status=published')
.then(({ data }) => {
setLinks(data.data.map((entry: any) => entry.link))
})
}, [])
2020-01-12 18:34:27 +01:00
return <div className='sets'>
<h1 className='ma0'>sets</h1>
<p>
collection of some sets made here and there.
</p>
<ul>
2020-01-17 01:12:12 +01:00
{links.map(link => (
<li key={link}>
<iframe width="100%" height="120" src={link} />
</li>
))}
2020-01-12 18:34:27 +01:00
</ul>
</div>
}
export default Home