mirror of
https://github.com/oceanprotocol/status-frontend.git
synced 2025-02-14 21:10:31 +01:00
Calling getStatus from home page
This commit is contained in:
parent
e5efb50726
commit
d67db95c42
@ -1,9 +1,23 @@
|
|||||||
import type { NextPage } from 'next'
|
import type { NextPage } from 'next'
|
||||||
import Head from 'next/head'
|
import Head from 'next/head'
|
||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
|
import { ReactElement, useEffect, useState } from 'react'
|
||||||
|
import { Status } from '../@types'
|
||||||
import styles from '../styles/Home.module.css'
|
import styles from '../styles/Home.module.css'
|
||||||
|
import { getData } from '../utils/getData'
|
||||||
|
|
||||||
|
export default function HomePage(): ReactElement {
|
||||||
|
const [statuses, setStatuses] = useState<Status[]>()
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
async function getStatuses() {
|
||||||
|
const data = await getData()
|
||||||
|
data && setStatuses(data)
|
||||||
|
console.log('statuses', statuses)
|
||||||
|
}
|
||||||
|
getStatuses()
|
||||||
|
}, [])
|
||||||
|
|
||||||
const Home: NextPage = () => {
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<Head>
|
<Head>
|
||||||
@ -66,5 +80,3 @@ const Home: NextPage = () => {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Home
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user