Last active
July 20, 2020 17:29
-
-
Save lseemann/7e44e02a8c3afbf7d2de1106c95b135f 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
const Refer = ({ | |
headline, body, link, link_text | |
}: any) => { | |
if (!headline) { | |
return ( | |
<EditorAlert block> | |
Your refer component is missing a headline, which is required. | |
</EditorAlert> | |
); | |
} | |
if (!link) { | |
return ( | |
<EditorAlert block> | |
Your refer component is missing a link, which is required. | |
</EditorAlert> | |
); | |
} | |
return ( | |
<aside> | |
<h1>{headline}</h1> | |
{body | |
? <p>{body}</p> | |
: ( | |
<EditorAlert> | |
<p> | |
The style guide suggests some body text here, but it’s not required. | |
</p> | |
</EditorAlert> | |
)} | |
<a href={link}>{link_text || 'Read more'}</a> | |
</aside> | |
); | |
}; | |
export default Refer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment