Skip to content

Instantly share code, notes, and snippets.

@Vijar
Created September 5, 2015 02:43
Show Gist options
  • Save Vijar/641129e9e1c2abddfca7 to your computer and use it in GitHub Desktop.
Save Vijar/641129e9e1c2abddfca7 to your computer and use it in GitHub Desktop.
module.exports = function MaterialUiPlugin() {
/**
* @class MaterialUiPlugin
*/
return {
/**
* @property {String} name Name of the plugin
*/
name: 'MaterialUiPlugin',
/**
* Called to plug FluxContext
* @method plugContext
* @returns {Object}
*/
plugContext: function plugContext() {
return {
/**
* Adds the material ui ThemeManager and
* the current theme to the component context
* @param {Object} actionContext
*/
plugComponentContext: function plugComponentContext(componentContext) {
// use: this.context.ThemeManager.setTheme() or this.context.ThemeManager.setComponentThemes()
componentContext.ThemeManager = ThemeManager;
// Needed for mui components to work
componentContext.muiTheme = ThemeManager.getCurrentTheme()
}
};
}
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment