This commit is contained in:
Nathan Bierema 2020-09-03 23:35:25 -04:00
parent fc219a04f9
commit 13eeae95d7
2 changed files with 3698 additions and 394 deletions

View File

@ -3,11 +3,11 @@ import getDefaultTheme from '../themes/default';
import { withTheme } from 'styled-components';
export default (UnthemedComponent) => (props) =>
props.theme.type ? (
props.theme && props.theme.type ? (
withTheme(<UnthemedComponent {...props} />)
) : (
// used outside of container (theme provider)
<UnthemedComponent {...props} theme={getDefaultTheme(props.theme)} />
<UnthemedComponent {...props} theme={getDefaultTheme({})} />
);
// TODO: memoize it?

File diff suppressed because one or more lines are too long