CodeYellowBV / re-cy-cle

React component library for Code Yellow
https://codeyellowbv.github.io/re-cy-cle/
6 stars 6 forks source link

Properly provide default theme #59

Closed SpaceK33z closed 7 years ago

SpaceK33z commented 7 years ago

At the moment there is a little theme helper that tries to get a theme variable like primaryColor via props.theme.primaryColor, and falls back on a default color.

As a result of this, a project using re-cy-cle can't easily access props.theme.primaryColor if it is using the default color provided by re-cy-cle.

To fix this we need to extend the theme prop with Object.assign.