@sankei-arc-shared-components/element_admin-message
v0.1.0
Published
# How do I use it?
Downloads
97
Readme
Admin Message: A Shared Element
How do I use it?
import React from 'react';
import { useFusionContext } from 'fusion:context';
import AdminMessage from "@sankei-arc-shared-components/element_admin-message";
const ArticleFeature = () => {
const { globalContent, isAdmin } = useFusionContext();
if (!globalContent) {
return (
<AdminMessage isAdmin={isAdmin} type="error">
Please add valid global content to use this feature.
</AdminMessage>
);
}
return <div>I'm the article feature!</div>
}
Take a look in the src/index.mdx
file to see suggested implementations.