-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #398 from reorproject/merge-chat-cleanup-and-conte…
…xt-menu Merge chat cleanup and context menu
- Loading branch information
Showing
24 changed files
with
415 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from 'react' | ||
|
||
import NewNoteComponent from '../File/NewNote' | ||
import { useModalOpeners } from '@/contexts/ModalContext' | ||
import NewDirectoryComponent from '../File/NewDirectory' | ||
import SettingsModal from '../Settings/Settings' | ||
import FlashcardMenuModal from '../Flashcard/FlashcardMenuModal' | ||
import { useFileContext } from '@/contexts/FileContext' | ||
import RenameNoteModal from '../File/RenameNote' | ||
import RenameDirModal from '../File/RenameDirectory' | ||
|
||
const CommonModals: React.FC = () => { | ||
const { | ||
isNewNoteModalOpen, | ||
setIsNewNoteModalOpen, | ||
isNewDirectoryModalOpen, | ||
setIsNewDirectoryModalOpen, | ||
isSettingsModalOpen, | ||
setIsSettingsModalOpen, | ||
isFlashcardModeOpen, | ||
setIsFlashcardModeOpen, | ||
initialFileToCreateFlashcard, | ||
setInitialFileToCreateFlashcard, | ||
initialFileToReviewFlashcard, | ||
setInitialFileToReviewFlashcard, | ||
} = useModalOpeners() | ||
|
||
const { noteToBeRenamed, fileDirToBeRenamed } = useFileContext() | ||
|
||
return ( | ||
<div> | ||
<NewNoteComponent isOpen={isNewNoteModalOpen} onClose={() => setIsNewNoteModalOpen(false)} /> | ||
<NewDirectoryComponent isOpen={isNewDirectoryModalOpen} onClose={() => setIsNewDirectoryModalOpen(false)} /> | ||
{noteToBeRenamed && <RenameNoteModal />} | ||
{fileDirToBeRenamed && <RenameDirModal />} | ||
<SettingsModal isOpen={isSettingsModalOpen} onClose={() => setIsSettingsModalOpen(false)} /> | ||
<FlashcardMenuModal | ||
isOpen={isFlashcardModeOpen} | ||
onClose={() => { | ||
setIsFlashcardModeOpen(false) | ||
setInitialFileToCreateFlashcard('') | ||
setInitialFileToReviewFlashcard('') | ||
}} | ||
initialFileToCreateFlashcard={initialFileToCreateFlashcard} | ||
initialFileToReviewFlashcard={initialFileToReviewFlashcard} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default CommonModals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.