Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
1e69a7b8
Commit
1e69a7b8
authored
Jan 24, 2019
by
Dominik Prokop
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update story for NamedColorsPalette
parent
d414e463
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
14 deletions
+4
-14
packages/grafana-ui/src/components/ColorPicker/NamedColorsPalette.story.tsx
+4
-14
No files found.
packages/grafana-ui/src/components/ColorPicker/NamedColorsPalette.story.tsx
View file @
1e69a7b8
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
>
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment