Files
starface-outlook-sync-addin/node_modules/@fluentui/react/lib-amd/utilities/ThemeProvider/useTheme.js
T
Stefan Hacker 37ad745546 first commit
2026-04-03 09:38:48 +02:00

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