mirror of
https://github.com/yusufipk/teknolojirehberleri.xyz.git
synced 2026-09-11 10:56:08 +00:00
(create) created dummy posts and styled it
This commit is contained in:
+13
-2
@@ -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,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user