mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-26 18:51:50 +02:00
[web] Split editor theme into two when using system overall theme GitOrigin-RevId: 1efa5553fdff8a17de634017882feb2ede614cd6
21 lines
621 B
TypeScript
21 lines
621 B
TypeScript
import { useActiveOverallTheme } from './use-active-overall-theme'
|
|
import { useUserSettingsContext } from '../context/user-settings-context'
|
|
import { isIEEEBranded } from '@/utils/is-ieee-branded'
|
|
|
|
export const useActiveEditorTheme = () => {
|
|
const activeOverallTheme = useActiveOverallTheme()
|
|
const {
|
|
userSettings: {
|
|
overallTheme,
|
|
editorTheme,
|
|
editorLightTheme,
|
|
editorDarkTheme,
|
|
},
|
|
} = useUserSettingsContext()
|
|
if (overallTheme !== 'system' || isIEEEBranded()) {
|
|
return editorTheme
|
|
} else {
|
|
return activeOverallTheme === 'dark' ? editorDarkTheme : editorLightTheme
|
|
}
|
|
}
|