|
7 | 7 |
|
8 | 8 | import React, { FC } from 'react'; |
9 | 9 | import { StoryFn } from '@storybook/react'; |
10 | | -import styled, { useTheme } from 'styled-components'; |
| 10 | +import styled from 'styled-components'; |
11 | 11 | import { readableColor } from 'polished'; |
12 | | -import { IGardenTheme, getColor, mediaQuery } from '@zendeskgarden/react-theming'; |
| 12 | +import { IGardenTheme, PALETTE, getColor, mediaQuery } from '@zendeskgarden/react-theming'; |
13 | 13 | import { Grid } from '@zendeskgarden/react-grid'; |
14 | 14 |
|
15 | 15 | const StyledColorHex = styled.figcaption` |
@@ -70,14 +70,13 @@ const StyledList = styled.ul` |
70 | 70 | `; |
71 | 71 |
|
72 | 72 | const Hue: FC<{ hue: string }> = ({ hue }) => { |
73 | | - const theme = useTheme(); |
74 | | - const colors = theme.palette[hue]; |
| 73 | + const colors = (PALETTE as any)[hue]; |
75 | 74 |
|
76 | 75 | return ( |
77 | 76 | <StyledList> |
78 | 77 | {Object.keys(colors).map(shade => { |
79 | 78 | const color = colors[shade as any]; |
80 | | - const title = hue === 'product' ? shade : `${hue}-${shade}`; |
| 79 | + const title = `${hue}-${shade}`; |
81 | 80 |
|
82 | 81 | return ( |
83 | 82 | <li key={shade}> |
@@ -123,7 +122,7 @@ export const PaletteStory: StoryFn<IArgs> = ({ palette }) => { |
123 | 122 | <Grid.Col sm> |
124 | 123 | <Hue hue={hue1} /> |
125 | 124 | </Grid.Col> |
126 | | - {hue1 !== 'product' && <StyledCol sm>{hue2 && <Hue hue={hue2} />}</StyledCol>} |
| 125 | + <StyledCol sm>{hue2 && <Hue hue={hue2} />}</StyledCol> |
127 | 126 | </StyledRow> |
128 | 127 | ); |
129 | 128 | })} |
|
0 commit comments