From 076f0033a95345e75b7107bcb20e5f9c26825d83 Mon Sep 17 00:00:00 2001 From: YenHub Date: Thu, 17 Jun 2021 22:02:36 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Finish=20migrating=20MDPreviewMo?= =?UTF-8?q?de=20to=20state=20store?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/Views/Components/CreateNoteModal/index.tsx | 3 +-- client/src/Views/Main.tsx | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client/src/Views/Components/CreateNoteModal/index.tsx b/client/src/Views/Components/CreateNoteModal/index.tsx index be29bdd..5578d11 100644 --- a/client/src/Views/Components/CreateNoteModal/index.tsx +++ b/client/src/Views/Components/CreateNoteModal/index.tsx @@ -65,12 +65,11 @@ const CreateNoteModal: React.FC = ({ setModalOpen, editNoteId, setEditNoteId, - previewMode, }) => { const globalState = useContext(store); const { state } = globalState; - const { darkMode, mdMode } = state; + const { darkMode, mdMode, previewMode } = state; const [wideView, toggleWideView] = useState(false); const [showPreview, togglePreview] = useState(previewMode); diff --git a/client/src/Views/Main.tsx b/client/src/Views/Main.tsx index 57099ca..3810593 100644 --- a/client/src/Views/Main.tsx +++ b/client/src/Views/Main.tsx @@ -105,7 +105,7 @@ const Main: FC = () => { const globalState = useContext(store); const { state } = globalState; - const { darkMode, mdMode, previewMode } = state; + const { darkMode, mdMode } = state; const classes = useStyles(darkMode)(); @@ -114,7 +114,7 @@ const Main: FC = () => { const [modalOpen, setModalOpen] = useState(false); const [editNoteId, setEditNoteId] = useState(''); - const noteProps = { noteState, setNoteState, previewMode }; + const noteProps = { noteState, setNoteState }; const modalProps = { ...noteProps, modalOpen, setModalOpen, editNoteId, setEditNoteId }; const getItems = async (): Promise => setNoteState(await noteStore.getNotes());