Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins: add PluginPosition.None to hide plugin #1469

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { useConfig } from './hooks/useConfig';
import log from './util/log';

export enum PluginPosition {
None,
Header,
Footer,
Cell,
Cell
}

export interface Plugin<T extends FunctionComponent> {
Expand Down Expand Up @@ -77,7 +78,7 @@ export function PluginRenderer(props: {
// render a single plugin
const plugin = config.plugin.get(props.pluginId);

if (!plugin) return null;
if (!plugin || plugin.position === PluginPosition.None) return null;

return h(
Fragment,
Expand All @@ -87,7 +88,7 @@ export function PluginRenderer(props: {
...props.props,
}),
);
} else if (props.position !== undefined) {
} else if (props.position !== undefined && props.position !== PluginPosition.None) {
// render using a specific plugin position
return h(
Fragment,
Expand Down