Created
November 9, 2020 13:53
-
-
Save indreklasn/4b20e57cd22795ec597a10c8daa34c92 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from "react"; | |
import "./styles.css"; | |
import BlogPost from "./BlogPost"; | |
const blogPost = { | |
title: "Indrek Lasn Blog Post", | |
subTitle: "This is a subtitle for the skeleton loader", | |
body: | |
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum." | |
}; | |
export default function App() { | |
const [hasPosts, setPost] = useState(false); | |
useEffect(() => { | |
const timer = setTimeout(() => { | |
setPost(true); | |
}, 1000); | |
return () => clearTimeout(timer); | |
}); | |
if (hasPosts) { | |
return ( | |
<BlogPost | |
title={blogPost.title} | |
body={blogPost.body} | |
subTitle={blogPost.subTitle} | |
/> | |
); | |
} | |
return <BlogPost />; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment