Skip to content

Instantly share code, notes, and snippets.

@indreklasn
Created November 9, 2020 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indreklasn/0e030f60e8ad216ade39c0068509ec7d to your computer and use it in GitHub Desktop.
Save indreklasn/0e030f60e8ad216ade39c0068509ec7d to your computer and use it in GitHub Desktop.
import React from "react";
import Skeleton from "react-loading-skeleton";
export default function BlogPost({ title, body, subTitle }) {
return (
<div>
<h1>{title || <Skeleton />}</h1>
<h3>{subTitle || <Skeleton />}</h3>
<p>{body || <Skeleton count={6} />}</p>
<button>
{body ? "Read more" : <Skeleton height={25} width={100} />}
</button>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment