(customRenderer?: CustomRenderer)
| 25 | type CustomRenderer = (Story: FC, context: StoryContext) => ReactElement; |
| 26 | |
| 27 | export 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 | }; |
no outgoing calls
no test coverage detected