Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Commit

Permalink
fix: handle invalid color proxy on render
Browse files Browse the repository at this point in the history
  • Loading branch information
wemstad authored and wemstad committed Mar 22, 2019
1 parent f01b9c1 commit ab6bf64
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions documentation/theme/color.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,22 @@ const styles = () => ({

const Color = ({ theme, classes }) => (
<div className={classes.colorWrapper}>
{Object.entries(theme.palette).map(([name, value]) => (
<div key={name} className={classes.colorBlock}>
<span>{name}</span>
<div>{value}</div>
<div
style={{
background: `${value}`,
width: 50,
height: 40,
border: '4px solid maroon',
}}
/>
</div>
))}
{Object.entries(theme.palette).map(([name, value]) =>
typeof value === 'string' ? (
<div key={name} className={classes.colorBlock}>
<span>{name}</span>
<div>{value}</div>
<div
style={{
background: `${value}`,
width: 50,
height: 40,
border: '4px solid maroon',
}}
/>
</div>
) : null,
)}
</div>
);

Expand Down

1 comment on commit ab6bf64

@vercel
Copy link

@vercel vercel bot commented on ab6bf64 Mar 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.