Skip to content

Commit

Permalink
feat: now, stores selected theme on local-storage
Browse files Browse the repository at this point in the history
When reloading the page, it'll recover the previous theme you got selected
  • Loading branch information
Sergio M committed Feb 5, 2020
1 parent 4971f0b commit aaa4593
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/register.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import addons from "@storybook/addons";
import * as React from "react";
import { Themes } from "./Themes";
import { addons, types } from '@storybook/addons';

addons.register("storybook/themes", (api) => {
addons.addPanel("storybook/themes/panel", {
render: ({ active }) => <Themes channel={addons.getChannel()} api={api} active={active} />,
addons.add("storybook/themes/panel", {
type: types.PANEL,
match: ({ viewMode }) => viewMode === 'story',
render: ({ active, key }) => <Themes key={key} channel={addons.getChannel()} api={api} active={active} />,
title: "Themes",
});
});

0 comments on commit aaa4593

Please sign in to comment.