Skip to content

Commit

Permalink
🔨 Finish migrating MDPreviewMode to state store
Browse files Browse the repository at this point in the history
  • Loading branch information
YenHub committed Jun 17, 2021
1 parent 0a1b241 commit 076f003
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions client/src/Views/Components/CreateNoteModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ const CreateNoteModal: React.FC<ICreateNoteModal> = ({
setModalOpen,
editNoteId,
setEditNoteId,
previewMode,
}) => {

const globalState = useContext(store);
const { state } = globalState;
const { darkMode, mdMode } = state;
const { darkMode, mdMode, previewMode } = state;

const [wideView, toggleWideView] = useState<boolean>(false);
const [showPreview, togglePreview] = useState<boolean>(previewMode);
Expand Down
4 changes: 2 additions & 2 deletions client/src/Views/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)();

Expand All @@ -114,7 +114,7 @@ const Main: FC = () => {
const [modalOpen, setModalOpen] = useState<boolean>(false);
const [editNoteId, setEditNoteId] = useState<string>('');

const noteProps = { noteState, setNoteState, previewMode };
const noteProps = { noteState, setNoteState };
const modalProps = { ...noteProps, modalOpen, setModalOpen, editNoteId, setEditNoteId };

const getItems = async (): Promise<void> => setNoteState(await noteStore.getNotes());
Expand Down

0 comments on commit 076f003

Please sign in to comment.