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

17 lines
392 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 => {
const channel = addons.getChannel();
addons.addPanel(PANEL_ID, {
title: 'Theme',
2019-01-09 02:08:34 +03:00
render: ({ active }) => (
active ?
<Panel channel={channel} api={api} />
: null
)
2019-01-03 16:00:55 +03:00
});
});