Skip to content

Instantly share code, notes, and snippets.

const Refer = ({
headline, body, link, link_text
}: any) => {
if (!headline) {
return (
<EditorAlert block>
Your refer component is missing a headline, which is required.
</EditorAlert>
);
}
const EditorAlert = ({ block, children }) => {
const { isStaff } = useContext(AuthContext);
if (!isStaff) {
return null;
}
if (block) {
return <div className="editor-alert">{children}</div>;
}
const Refer = ({
headline, body, link, link_text
}: any) => {
if (!headline || !link) {
return null;
}
return (
<aside>
<h1>{headline}</h1>
const Refer = ({
headline, body, link, link_text
}: any) => (
<aside>
<h1>{headline}</h1>
<p>{body}</p>
<a href={link}>{link_text}</a>
</aside>
);