Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki-takei committed Feb 26, 2024
1 parent 3cf1f70 commit 637b7db
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions apps/app/src/components/PageEditor/PageEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
} from '~/stores/context';
import {
useEditorSettings,
useCurrentIndentSize, useIsSlackEnabled, usePageTagsForEditors,
useCurrentIndentSize, usePageTagsForEditors,
useIsConflict,
useEditingMarkdown,
useWaitingSaveProcessing,
Expand Down Expand Up @@ -59,7 +59,6 @@ import { PageHeader } from '../PageHeader/PageHeader';

// import { ConflictDiffModal } from './PageEditor/ConflictDiffModal';
// import { ConflictDiffModal } from './ConflictDiffModal';
// import Editor from './Editor';
import EditorNavbarBottom from './EditorNavbarBottom';
import Preview from './Preview';
import { scrollEditor, scrollPreview } from './ScrollSyncHelper';
Expand Down Expand Up @@ -105,7 +104,6 @@ export const PageEditor = React.memo((props: Props): JSX.Element => {
const { data: isEditable } = useIsEditable();
const { mutate: mutateWaitingSaveProcessing } = useWaitingSaveProcessing();
const { data: editorMode, mutate: mutateEditorMode } = useEditorMode();
const { data: isSlackEnabled } = useIsSlackEnabled();
const { data: isIndentSizeForced } = useIsIndentSizeForced();
const { data: currentIndentSize, mutate: mutateCurrentIndentSize } = useCurrentIndentSize();
const { data: defaultIndentSize } = useDefaultIndentSize();
Expand Down Expand Up @@ -164,15 +162,9 @@ export const PageEditor = React.memo((props: Props): JSX.Element => {
const setMarkdownPreviewWithDebounce = useMemo(() => debounce(100, throttle(150, (value: string) => {
setMarkdownToPreview(value);
})), []);
// const mutateIsEnabledUnsavedWarningWithDebounce = useMemo(() => debounce(600, throttle(900, (value: string) => {
// // Displays an unsaved warning alert
// mutateIsEnabledUnsavedWarning(value !== initialValueRef.current);
// })), [mutateIsEnabledUnsavedWarning]);

const markdownChangedHandler = useCallback((value: string) => {
setMarkdownPreviewWithDebounce(value);
// mutateIsEnabledUnsavedWarningWithDebounce(value);
// }, [mutateIsEnabledUnsavedWarningWithDebounce, setMarkdownPreviewWithDebounce]);
}, [setMarkdownPreviewWithDebounce]);


Expand Down Expand Up @@ -421,18 +413,6 @@ export const PageEditor = React.memo((props: Props): JSX.Element => {
</div>
<div className={`flex-expand-horiz ${props.visibility ? '' : 'd-none'}`}>
<div className="page-editor-editor-container flex-expand-vert">
{/* <Editor
ref={editorRef}
value={initialValue}
isUploadable={isUploadable}
isUploadAllFileAllowed={isUploadAllFileAllowed}
indentSize={currentIndentSize}
onScroll={editorScrolledHandler}
onScrollCursorIntoView={editorScrollCursorIntoViewHandler}
onChange={markdownChangedHandler}
onUpload={uploadHandler}
onSave={saveWithShortcut}
/> */}
<CodeMirrorEditorMain
onChange={markdownChangedHandler}
onSave={saveWithShortcut}
Expand Down

0 comments on commit 637b7db

Please sign in to comment.