Files
remark42/web/app/components/with-theme/with-theme.jsx
T
Igor AdamenkoandUmputun 6f1b9037d5 Dark theme (#228)
* add with-theme hoc

* add dark theme styles for components

* add toggle theme button to the dev demo page

* add info about widget themes to README
2018-12-15 17:10:41 -06:00

17 lines
354 B
React

/** @jsx h */
import { h } from 'preact';
import store from 'common/store';
const withTheme = PlainComponent => {
const ThemedComponent = props => {
const { mods = {} } = props;
const theme = store.get('theme');
return <PlainComponent {...props} mods={{ theme, ...mods }} />;
};
return ThemedComponent;
};
export default withTheme;