Skip to content

Commit

Permalink
fix: hide tokens that are not available
Browse files Browse the repository at this point in the history
  • Loading branch information
gsamaniego41 committed Jul 19, 2023
1 parent 7a21799 commit d858c63
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions packages/storybook/src/theme/palette/palette.components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
TableHead,
TableRow,
} from '@monorail/components'
import { filterMap } from '@monorail/utils'

import type { ColorTokenRowProps, ColorTokenTableProps } from './palette.types'

Expand Down Expand Up @@ -98,21 +99,21 @@ export const ColorTokenTable = ({
</TableHead>
<TableBody>
{colorMetadata !== undefined ? (
colorMetadata.map(color => {
filterMap(colorMetadata, color => {
const figmaStyle = getFigmaStyle(color.figmaStyle)
const colorValue = color.colorValue ?? ''

return (
<ColorTokenRow
key={color.token}
token={color.token}
mapping={getObjectKey(colorValue)}
opacity={color.opacity}
colorValue={color.colorValue}
figmaStyle={figmaStyle}
description={color.description}
/>
)
if (color.colorValue !== undefined) {
return (
<ColorTokenRow
key={color.token}
token={color.token}
mapping={getObjectKey(color.colorValue)}
opacity={color.opacity}
colorValue={color.colorValue}
figmaStyle={figmaStyle}
description={color.description}
/>
)
}
})
) : (
<></>
Expand Down

0 comments on commit d858c63

Please sign in to comment.