mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-08 00:29:04 +02:00
b7f5344859
* moving files from ide-redesign/components/editor-tour to features/editor-tour moving files from ide-redesign/components/integrations-panel to features/integrations-panel fixing imports Revert "moving files from ide-redesign/components/editor-tour to features/editor-tour" This reverts commit 9e4dcd4e001ffa4bfdb1053fb8824c1e8521ab10. * moving files from ide-redesign/components/help -> ide-react/components/rail * ide-redesign/components/breadcrumbs → features/source-editor/extensions * ide-redesign/components/editor.tsx → ide-react/components/layout * ide-redesign/components/full-project-search-panel.tsx → ide-react/components/rail/full-project-search-panel.tsx * removing old-editor-warning-tooltip * ide-redesign/components/tooltip-promo.tsx → shared/components/tooltip-promo.tsx make cleanup_unused_locales * extract-translations GitOrigin-RevId: b9f44c4820bb4e0a7eef4f6f9a58ff96fd007bf9
35 lines
934 B
TypeScript
35 lines
934 B
TypeScript
import { FC } from 'react'
|
|
import {
|
|
RailModalKey,
|
|
useRailContext,
|
|
} from '@/features/ide-react/context/rail-context'
|
|
import { RailHelpContactUsModal } from './contact-us'
|
|
import { RailHelpShowHotkeysModal } from './keyboard-shortcuts'
|
|
import DictionarySettingsModal from '@/features/settings/components/editor-settings/dictionary-settings-modal'
|
|
|
|
const RAIL_MODALS: {
|
|
key: RailModalKey
|
|
modalComponentFunction: FC<{ show: boolean }>
|
|
}[] = [
|
|
{
|
|
key: 'keyboard-shortcuts',
|
|
modalComponentFunction: RailHelpShowHotkeysModal,
|
|
},
|
|
{
|
|
key: 'contact-us',
|
|
modalComponentFunction: RailHelpContactUsModal,
|
|
},
|
|
{
|
|
key: 'dictionary',
|
|
modalComponentFunction: DictionarySettingsModal,
|
|
},
|
|
]
|
|
|
|
export default function RailModals() {
|
|
const { activeModal } = useRailContext()
|
|
|
|
return RAIL_MODALS.map(({ key, modalComponentFunction: Component }) => (
|
|
<Component key={key} show={activeModal === key} />
|
|
))
|
|
}
|