Skip to content

Commit

Permalink
chore: add helmet provider decorator to log viewer story
Browse files Browse the repository at this point in the history
  • Loading branch information
Caleb Kang committed Apr 27, 2021
1 parent 847f0cc commit c9d668c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webui/react/src/components/LogViewer.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React, { useEffect, useRef } from 'react';

import HelmetDecorator from 'storybook/HelmetDecorator';
import StoreDecorator from 'storybook/StoreDecorator';
import { downloadText, simulateLogsDownload } from 'utils/browser';

import LogViewer, { LogViewerHandles } from './LogViewer';

export default {
component: LogViewer,
decorators: [ StoreDecorator ],
decorators: [ HelmetDecorator, StoreDecorator ],
parameters: { layout: 'fullscreen' },
title: 'LogViewer',
};
Expand Down
9 changes: 9 additions & 0 deletions webui/react/src/storybook/HelmetDecorator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { DecoratorFunction } from '@storybook/addons';
import React from 'react';
import { HelmetProvider } from 'react-helmet-async';

const HelmetDecorator: DecoratorFunction<React.ReactNode> = storyFn => {
return React.createElement(HelmetProvider, null, storyFn());
};

export default HelmetDecorator;

0 comments on commit c9d668c

Please sign in to comment.