(create) created dummy posts and styled it

This commit is contained in:
Yusuf İpek
2021-08-07 14:52:17 +03:00
parent 55f7b9e9fb
commit df8e941c9f
4 changed files with 47 additions and 6 deletions
+13 -2
View File
@@ -1,7 +1,7 @@
import Head from "next/head";
import Home from "../commons/home";
export default function App() {
export default function App({ posts }) {
return (
<div>
<Head>
@@ -12,7 +12,18 @@ export default function App() {
/>
<link rel="icon" href="/favicon.ico" />
</Head>
<Home />
<Home posts={posts} />
</div>
);
}
export async function getStaticProps() {
const res = await fetch("https://jsonplaceholder.typicode.com/posts");
const posts = await res.json();
return {
props: {
posts,
},
};
}