mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 21:59:00 +02:00
dcabf55882
[web] Add switcher for editor redesign GitOrigin-RevId: 806a1f567027df53f879b564a50aaae9166c8480
14 lines
523 B
TypeScript
14 lines
523 B
TypeScript
import { useUserSettingsContext } from '@/shared/context/user-settings-context'
|
|
import { isSplitTestEnabled } from '@/utils/splitTestUtils'
|
|
|
|
// TODO: For now we're using the feature flag, but eventually we'll read this
|
|
// from labs.
|
|
export const canUseNewEditor = () => isSplitTestEnabled('editor-redesign')
|
|
|
|
export const useIsNewEditorEnabled = () => {
|
|
const { userSettings } = useUserSettingsContext()
|
|
const hasAccess = canUseNewEditor()
|
|
const enabled = userSettings.enableNewEditor
|
|
return hasAccess && enabled
|
|
}
|