Commit 1e69a7b8 by Dominik Prokop

Update story for NamedColorsPalette

parent d414e463
import React, { FunctionComponent } from 'react';
import { storiesOf } from '@storybook/react';
import NamedColorsPalette from './NamedColorsPalette';
import { NamedColorsPalette } from './NamedColorsPalette';
import { getColorName } from '../../utils/namedColorsPalette';
import { withKnobs, select } from '@storybook/addon-knobs';
......@@ -35,7 +35,7 @@ export class UseState<T> extends React.Component<StateHolderProps<T>, { value: T
static getDerivedStateFromProps(props: StateHolderProps<{}>, state: { value: {} }) {
return {
value: props.initialState,
...state
...state,
};
}
......@@ -64,12 +64,7 @@ storiesOf('UI/NamedColorsPalette', module)
return (
<UseState initialState={selectedColor}>
{(selectedColor, updateSelectedColor) => {
return (
<NamedColorsPalette
color={selectedColor}
onChange={updateSelectedColor}
/>
);
return <NamedColorsPalette color={selectedColor} onChange={updateSelectedColor} />;
}}
</UseState>
);
......@@ -78,12 +73,7 @@ storiesOf('UI/NamedColorsPalette', module)
return (
<UseState initialState="#00ff00">
{(selectedColor, updateSelectedColor) => {
return (
<NamedColorsPalette
color={getColorName(selectedColor)}
onChange={updateSelectedColor}
/>
);
return <NamedColorsPalette color={getColorName(selectedColor)} onChange={updateSelectedColor} />;
}}
</UseState>
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment