Skip to content

Commit a8e41b9

Browse files
authored
Merge pull request #1469 from mbolli/patch-1
Plugins: add `PluginPosition.None` to hide plugin
2 parents c86da6f + 0b2f98a commit a8e41b9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/plugin.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { useConfig } from './hooks/useConfig';
33
import log from './util/log';
44

55
export enum PluginPosition {
6+
None,
67
Header,
78
Footer,
8-
Cell,
9+
Cell
910
}
1011

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

80-
if (!plugin) return null;
81+
if (!plugin || plugin.position === PluginPosition.None) return null;
8182

8283
return h(
8384
Fragment,
@@ -87,7 +88,7 @@ export function PluginRenderer(props: {
8788
...props.props,
8889
}),
8990
);
90-
} else if (props.position !== undefined) {
91+
} else if (props.position !== undefined && props.position !== PluginPosition.None) {
9192
// render using a specific plugin position
9293
return h(
9394
Fragment,

0 commit comments

Comments
 (0)