mirror of
https://github.com/cupcakearmy/fantus.git
synced 2025-09-05 21:50:40 +00:00
directus for cms
This commit is contained in:
@@ -1,24 +1,29 @@
|
||||
import React from 'react'
|
||||
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))
|
||||
})
|
||||
}, [])
|
||||
|
||||
const Home = () => {
|
||||
return <div className='sets'>
|
||||
<h1 className='ma0'>sets</h1>
|
||||
<p>
|
||||
collection of some sets made here and there.
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<iframe width="100%" height="120" src="https://www.mixcloud.com/widget/iframe/?hide_cover=1&feed=%2Ffantus%2Fmxs04-lounge%2F" />
|
||||
</li>
|
||||
<li>
|
||||
<iframe width="100%" height="120" src="https://www.mixcloud.com/widget/iframe/?hide_cover=1&feed=%2Ffantus%2Fmxs03-techno%2F" />
|
||||
</li>
|
||||
<li>
|
||||
<iframe width="100%" height="120" src="https://www.mixcloud.com/widget/iframe/?hide_cover=1&feed=%2Ffantus%2Fmxs02-techno%2F" />
|
||||
</li>
|
||||
<li>
|
||||
<iframe width="100%" height="120" src="https://www.mixcloud.com/widget/iframe/?hide_cover=1&feed=%2Ffantus%2Fmxs01-melodic-techno%2F" />
|
||||
</li>
|
||||
{links.map(link => (
|
||||
<li key={link}>
|
||||
<iframe width="100%" height="120" src={link} />
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
|
Reference in New Issue
Block a user