redux-devtools/packages/devui/.storybook/themeAddon/register.js

14 lines
371 B
JavaScript
Raw Normal View History

2019-01-03 16:00:55 +03:00
import React from 'react';
import addons from '@storybook/addons';
import Panel from './Panel';
import { ADDON_ID, PANEL_ID } from './constant';
addons.register(ADDON_ID, (api) => {
2019-01-03 16:00:55 +03:00
const channel = addons.getChannel();
addons.addPanel(PANEL_ID, {
title: 'Theme',
2019-01-10 21:51:14 +03:00
render: ({ active }) =>
active ? <Panel channel={channel} api={api} /> : null,
2019-01-03 16:00:55 +03:00
});
});