MCPcopy
hub / github.com/untitleduico/react / withOverlayAware

Function withOverlayAware

components/internal/decorators.tsx:27–39  ·  view source on GitHub ↗
(customRenderer?: CustomRenderer)

Source from the content-addressed store, hash-verified

25type CustomRenderer = (Story: FC, context: StoryContext) => ReactElement;
26
27export const withOverlayAware = (customRenderer?: CustomRenderer) => (Story: StoryFn, context: StoryContext) => {
28 const { overlay } = context.globals as Globals;
29
30 if (overlay?.visible) {
31 return Story(context.args, context) as ReactElement;
32 }
33
34 if (customRenderer) {
35 return customRenderer(Story as FC, context);
36 }
37
38 return Story(context.args, context) as ReactElement;
39};

Calls

no outgoing calls

Tested by

no test coverage detected