21 lines
858 B
JavaScript
21 lines
858 B
JavaScript
define(["require", "exports", "react", "@fluentui/utilities", "@fluentui/theme", "./ThemeContext"], function (require, exports, React, utilities_1, theme_1, ThemeContext_1) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.useTheme = void 0;
|
|
/**
|
|
* Get theme from CustomizerContext or Customizations singleton.
|
|
*/
|
|
function useCompatTheme() {
|
|
return (0, utilities_1.useCustomizationSettings)(['theme']).theme;
|
|
}
|
|
/**
|
|
* React hook for programmatically accessing the theme.
|
|
*/
|
|
var useTheme = function () {
|
|
var theme = React.useContext(ThemeContext_1.ThemeContext);
|
|
var legacyTheme = useCompatTheme();
|
|
return theme || legacyTheme || (0, theme_1.createTheme)({});
|
|
};
|
|
exports.useTheme = useTheme;
|
|
});
|
|
//# sourceMappingURL=useTheme.js.map
|