React Page support multi theme and easy to customize the color from:

  • app/containers/themeStyle.js (the black theme is load as default)

  • config/theme.config.js: show list of theme option to show on left menu side bar (you could remove this setting and set the default theme as you wish)

Notes:

  • Theme file must provide theme information of all theme with themeID is key.

  • Default theme is set in containers/ThemeProvider/reducer.js

  • If you would like to create new component and load the theme, it should extend from React.Component

import themeStyle from './themeStyle';

class Example extends React.Component {
    // this is compulsory => get current theme
    static contextTypes = {
        theme: React.PropTypes.string,
    };

    render() {
        // Get style for current theme
        const selectedTheme = themeStyle[this.context.theme];
        return {
            <div style={selectedTheme.myClass}> ... </div> 
        } 
    } 
}

results matching ""

    No results matching ""