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) => ( | |
<aside> | |
<h1>{headline}</h1> | |
<p>{body}</p> | |
<a href={link}>{link_text}</a> | |
</aside> | |
); |
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 || !link) { | |
return null; | |
} | |
return ( | |
<aside> | |
<h1>{headline}</h1> |
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 EditorAlert = ({ block, children }) => { | |
const { isStaff } = useContext(AuthContext); | |
if (!isStaff) { | |
return null; | |
} | |
if (block) { | |
return <div className="editor-alert">{children}</div>; | |
} |
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> | |
); | |
} |