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

19 lines
626 B
JavaScript

import * as React from 'react';
import { useCustomizationSettings } from '@fluentui/utilities';
import { createTheme } from '@fluentui/theme';
import { ThemeContext } from './ThemeContext';
/**
* Get theme from CustomizerContext or Customizations singleton.
*/
function useCompatTheme() {
return useCustomizationSettings(['theme']).theme;
}
/**
* React hook for programmatically accessing the theme.
*/
export var useTheme = function () {
var theme = React.useContext(ThemeContext);
var legacyTheme = useCompatTheme();
return theme || legacyTheme || createTheme({});
};
//# sourceMappingURL=useTheme.js.map