mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-11 07:00:47 +02:00
8f2001e477
Prepare editor redesign for beta release GitOrigin-RevId: 584c0303f652640669234bd227780ed4f20b76c0
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
import { useCallback } from 'react'
|
|
import OLButton from '../ui/components/ol/ol-button'
|
|
import { useIdeRedesignSwitcherContext } from '../ide-react/context/ide-redesign-switcher-context'
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { isNewEditorInBeta } from '../ide-redesign/utils/new-editor-utils'
|
|
|
|
const TryNewEditorButton = () => {
|
|
const { t } = useTranslation()
|
|
const { setShowSwitcherModal } = useIdeRedesignSwitcherContext()
|
|
const newEditorBeta = isNewEditorInBeta()
|
|
|
|
const onClick = useCallback(() => {
|
|
setShowSwitcherModal(true)
|
|
}, [setShowSwitcherModal])
|
|
return (
|
|
<div className="d-flex align-items-center">
|
|
<OLButton
|
|
className="toolbar-experiment-button"
|
|
onClick={onClick}
|
|
size="sm"
|
|
leadingIcon={
|
|
!newEditorBeta && <MaterialIcon type="experiment" unfilled />
|
|
}
|
|
variant="secondary"
|
|
>
|
|
{t('try_the_new_editor')}
|
|
</OLButton>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default TryNewEditorButton
|