redux-devtools/packages/devui/.storybook/themeAddon/register.js
2019-01-10 20:51:14 +02:00

14 lines
368 B
JavaScript

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',
render: ({ active }) =>
active ? <Panel channel={channel} api={api} /> : null
});
});