Created
September 5, 2015 02:43
-
-
Save Vijar/641129e9e1c2abddfca7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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