mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 14:19:01 +02:00
f27c99ea4b
* merging ide-redesign/components/file-tree into features/file-tree * moving ide-redesign/contexts/settings-modal-context to features/settings/contexts * use-collapsible-file-tree.tsx → features/file-tree/hooks * use-focus-on-setting.tsx → features/settings/hooks * use-project-notification-preferences.ts → features/settings/hooks * use-rail-overflow.tsx→ features/ide-react/hooks * deleting use-switch-enable-new-editor-state.ts * use-toolbar-menu-editor-commands.tsx → features/source-editor/hooks * npm run extract-translations * modifying the test to target correct buttons and removing a test for old component * adding a test back and modifying it * changing the test GitOrigin-RevId: baa1e9a992c88b84313eea82161354d4958cf1ef
56 lines
1.3 KiB
TypeScript
56 lines
1.3 KiB
TypeScript
import {
|
|
OLModal,
|
|
OLModalBody,
|
|
OLModalHeader,
|
|
OLModalTitle,
|
|
} from '@/shared/components/ol/ol-modal'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { SettingsModalBody } from './settings-modal-body'
|
|
import {
|
|
SettingsModalProvider,
|
|
useSettingsModalContext,
|
|
} from '../context/settings-modal-context'
|
|
import useFocusOnSetting from '../hooks/use-focus-on-setting'
|
|
|
|
const SettingsModalWrapper = () => {
|
|
return (
|
|
<SettingsModalProvider>
|
|
<SettingsModal />
|
|
</SettingsModalProvider>
|
|
)
|
|
}
|
|
|
|
const SettingsModal = () => {
|
|
const { t } = useTranslation()
|
|
const { show, setShow, settingsTabs, activeTab, setActiveTab } =
|
|
useSettingsModalContext()
|
|
|
|
useFocusOnSetting()
|
|
|
|
return (
|
|
<OLModal
|
|
show={show}
|
|
onHide={() => setShow(false)}
|
|
size="lg"
|
|
backdropClassName={
|
|
activeTab === 'appearance'
|
|
? 'ide-settings-modal-transparent-backdrop'
|
|
: undefined
|
|
}
|
|
>
|
|
<OLModalHeader>
|
|
<OLModalTitle>{t('settings')}</OLModalTitle>
|
|
</OLModalHeader>
|
|
<OLModalBody className="ide-settings-modal-body">
|
|
<SettingsModalBody
|
|
activeTab={activeTab}
|
|
setActiveTab={setActiveTab}
|
|
settingsTabs={settingsTabs}
|
|
/>
|
|
</OLModalBody>
|
|
</OLModal>
|
|
)
|
|
}
|
|
|
|
export default SettingsModalWrapper
|