mirror of
https://github.com/oceanprotocol/status-frontend.git
synced 2024-11-24 19:10:08 +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 Head from 'next/head'
|
||||
import Image from 'next/image'
|
||||
import { ReactElement, useEffect, useState } from 'react'
|
||||
import { Status } from '../@types'
|
||||
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 (
|
||||
<div className={styles.container}>
|
||||
<Head>
|
||||
@ -66,5 +80,3 @@ const Home: NextPage = () => {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Home
|
||||
|
Loading…
Reference in New Issue
Block a user