Skip to content

Commit

Permalink
chore: simple loading state
Browse files Browse the repository at this point in the history
  • Loading branch information
zstix committed Jun 2, 2020
1 parent 6a188b9 commit de2fe35
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/templates/ReferenceTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,19 @@ const ReferenceTemplate = ({ data }) => {
isOpen={isOpen}
toggle={() => setIsOpen(!isOpen)}
/>
<main className={styles.content}>
<h1>{component}</h1>
{loaded ? (
<main className={styles.content}>
<h1>{component}</h1>

{componentData && componentData.__docs__ && (
<div className={styles.description}>
<ReactMarkdown source={componentData.__docs__.text} />
</div>
)}
</main>
{componentData && componentData.__docs__ && (
<div className={styles.description}>
<ReactMarkdown source={componentData.__docs__.text} />
</div>
)}
</main>
) : (
<p>Loading...</p>
)}
</Container>
</Layout>
);
Expand Down

0 comments on commit de2fe35

Please sign in to comment.