kaori 3 лет назад
Родитель
Сommit
d9a8cbdeb9

+ 0 - 41
packages/app/src/components/AlertDialog.tsx

@@ -1,41 +0,0 @@
-import React from 'react';
-
-import {
-  Modal, ModalBody, ModalFooter,
-} from 'reactstrap';
-
-
-type Props = {
-  title: string,
-  message: string,
-  isOpen: boolean,
-  onClose: () => void,
-}
-
-
-export const AlertDialog = (props: Props): JSX.Element => {
-  function handleSubmit() {
-    props.onClose();
-  }
-
-  return (
-    <Modal isOpen={props.isOpen} toggle={props.onClose} id="edit-tag-modal" autoFocus={false}>
-      <ModalBody>
-        <h2>
-          {props.title}
-        </h2>
-        <h4>
-          {props.message}
-        </h4>
-      </ModalBody>
-      <ModalFooter>
-        <button type="button" className="btn btn-primary" onClick={props.onClose}>
-          Cancel
-        </button>
-        <button type="button" className="btn btn-primary" onClick={handleSubmit}>
-          Done
-        </button>
-      </ModalFooter>
-    </Modal>
-  );
-};

+ 0 - 7
packages/app/src/components/BasicLayout.tsx

@@ -49,13 +49,6 @@ export const BasicLayout = ({ children, title, className }: Props): JSX.Element
 
       <ShortcutsModal />
       <SystemVersion />
-
-      {/* Link test */}
-      <Link href="/629581929e61e2a5fe4c64a5">
-        <a>/629581929e61e2a5fe4c64a5</a>
-      </Link>
-      <br />
-      <a href="https://www.google.com/">https://www.google.com/</a>
     </>
   );
 };

+ 7 - 5
packages/app/src/pages/UnsavedAlertDialog.tsx

@@ -21,7 +21,7 @@ const UnsavedAlertDialog = (): void => {
 
   const alertUnsavedWarningByNextRouter = useCallback(() => {
     if (isEnabledUnsavedWarning) {
-      // eslint-disable-next-line no-alert
+    // eslint-disable-next-line no-alert
       window.alert(alertMsg);
     }
     return;
@@ -36,7 +36,8 @@ const UnsavedAlertDialog = (): void => {
     return () => {
       window.removeEventListener('beforeunload', alertUnsavedWarningByBrowser);
     };
-  }, [alertUnsavedWarningByBrowser]);
+  // eslint-disable-next-line react-hooks/exhaustive-deps
+  }, []);
 
 
   /*
@@ -44,11 +45,12 @@ const UnsavedAlertDialog = (): void => {
   * https://nextjs.org/docs/api-reference/next/router
   */
   useEffect(() => {
-    router.events.on('routeChangeStart', () => alertUnsavedWarningByNextRouter());
+    router.events.on('routeChangeStart', alertUnsavedWarningByNextRouter);
     return () => {
-      router.events.off('routeChangeStart', () => alertUnsavedWarningByNextRouter());
+      router.events.off('routeChangeStart', alertUnsavedWarningByNextRouter);
     };
-  }, [router.events]);
+  // eslint-disable-next-line react-hooks/exhaustive-deps
+  }, []);
 
 
   return;