File tree Expand file tree Collapse file tree
plugins/orchestrator/src/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' @red-hat-developer-hub/backstage-plugin-orchestrator ' : patch
3+ ---
4+
5+ fix isDarkMode to work in auto mode
Original file line number Diff line number Diff line change 1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16- import { useObservable } from 'react-use ' ;
16+ import { useTheme } from '@mui/material/styles ' ;
1717
18- import { appThemeApiRef , useApi } from '@backstage/core-plugin-api' ;
18+ export const useIsDarkMode = ( ) : boolean => {
19+ const theme = useTheme ( ) ;
1920
20- export const useIsDarkMode = ( ) => {
21- const appThemeApi = useApi ( appThemeApiRef ) ;
22- const activeThemeId = useObservable (
23- appThemeApi . activeThemeId$ ( ) ,
24- appThemeApi . getActiveThemeId ( ) ,
25- ) ;
26-
27- return activeThemeId === 'dark' ;
21+ return theme . palette . mode === 'dark' ;
2822} ;
You can’t perform that action at this time.
0 commit comments