Skip to content

Commit

Permalink
fix: prism theme name
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Feb 18, 2020
1 parent 607ea97 commit 5834ec3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { FC } from 'react'
import { addDecorator, addParameters } from '@storybook/react';
import { Title, Subtitle, Story, Stories, Props, Description } from '@storybook/addon-docs/blocks';
import { Title, Subtitle, Source as DocsSource, Story, Stories, Props, Description } from '@storybook/addon-docs/blocks';
import { DependenciesTable } from 'storybook-addon-deps/blocks';
import { ControlsEditorsTable, ThemeProvider, Source } from '@component-controls/storybook';

Expand All @@ -26,6 +26,7 @@ export const DocsPage = ({
<Description slot={descriptionSlot} />
<Story id="." />
<Source id="." />
<DocsSource id="." />
<ControlsEditorsTable id="." />
<Props slot={propsSlot} />
<DependenciesTable titleDependencies='Dependencies' titleDependents='Dependents' />
Expand Down
18 changes: 9 additions & 9 deletions core/editors/src/blocks/Source/Source.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import dracula from 'prism-react-renderer/themes/dracula';
import duotoneDark from 'prism-react-renderer/themes/duotoneDark';
import duotoneLight from 'prism-react-renderer/themes/duotoneLight';
import github from 'prism-react-renderer/themes/github';
import nightOwl from 'prism-react-renderer/themes/nightOwl';
import nightowl from 'prism-react-renderer/themes/nightOwl';
import nightOwlLight from 'prism-react-renderer/themes/nightOwlLight';
import oceanicNext from 'prism-react-renderer/themes/oceanicNext';
import palenight from 'prism-react-renderer/themes/palenight';
Expand All @@ -24,17 +24,17 @@ import { BlockContainer } from '../BlockContainer/BlockContainer';
const themes: {
[key: string]: PrismTheme;
} = {
nightOwlLight,
nightOwl,
'nightowl-light': nightOwlLight,
nightowl,
github,
vsDark,
oceanicNext,
'vs-dark': vsDark,
'oceanic-next': oceanicNext,
palenight,
ultramin,
duotoneLight,
duotoneDark,
'duotone-light': duotoneLight,
'duotone-dark': duotoneDark,
dracula,
shadesOfPurple,
'shades-of-purple': shadesOfPurple,
};
export interface SourceProps {
children?: string;
Expand All @@ -45,7 +45,7 @@ export const Source: FC<SourceProps> = ({
children = '',
language = 'jsx',
}) => {
const [themeName, setThemeName] = React.useState<string>('nightOwlLight');
const [themeName, setThemeName] = React.useState<string>('nightowl-light');
let prismTheme = themes[themeName] || defaultProps.theme;
const [copied, setCopied] = React.useState(false);

Expand Down

0 comments on commit 5834ec3

Please sign in to comment.