Yuki Takei 4 лет назад
Родитель
Сommit
797628fc5e

+ 0 - 5
packages/app/src/components/SearchPage/SearchControl.tsx

@@ -54,10 +54,6 @@ const SearchControl: FC <Props> = React.memo((props: Props) => {
     setOrder(nextOrder);
   }, []);
 
-  const clickSearchBySearchOptionModalHandler = useCallback(() => {
-    invokeSearch();
-  }, [invokeSearch]);
-
   useEffect(() => {
     invokeSearch();
   }, [invokeSearch]);
@@ -141,7 +137,6 @@ const SearchControl: FC <Props> = React.memo((props: Props) => {
         onClose={() => setIsFileterOptionModalShown(false)}
         includeUserPages={includeUserPages}
         includeTrashPages={includeTrashPages}
-        onClickSearch={clickSearchBySearchOptionModalHandler}
         onIncludeUserPagesSwitched={setIncludeUserPages}
         onIncludeTrashPagesSwitched={setIncludeTrashPages}
       />

+ 1 - 18
packages/app/src/components/SearchPage/SearchOptionModal.tsx

@@ -2,7 +2,7 @@ import React, { FC } from 'react';
 import { useTranslation } from 'react-i18next';
 
 import {
-  Modal, ModalHeader, ModalBody, ModalFooter,
+  Modal, ModalHeader, ModalBody,
 } from 'reactstrap';
 
 
@@ -13,7 +13,6 @@ type Props = {
   onClose?: () => void,
   onIncludeUserPagesSwitched?: (isChecked: boolean) => void,
   onIncludeTrashPagesSwitched?: (isChecked: boolean) => void,
-  onClickSearch?: () => void,
 }
 
 const SearchOptionModal: FC<Props> = (props: Props) => {
@@ -25,7 +24,6 @@ const SearchOptionModal: FC<Props> = (props: Props) => {
     onClose,
     onIncludeUserPagesSwitched,
     onIncludeTrashPagesSwitched,
-    onClickSearch,
   } = props;
 
   const onCloseModal = () => {
@@ -46,13 +44,6 @@ const SearchOptionModal: FC<Props> = (props: Props) => {
     }
   };
 
-  const clickSearchAgainHandler = () => {
-    if (onClickSearch != null) {
-      onClickSearch();
-    }
-    onCloseModal();
-  };
-
   return (
     <Modal size="lg" isOpen={isOpen} toggle={onCloseModal} autoFocus={false}>
       <ModalHeader tag="h4" toggle={onCloseModal} className="bg-primary text-light">
@@ -84,14 +75,6 @@ const SearchOptionModal: FC<Props> = (props: Props) => {
           </div>
         </div>
       </ModalBody>
-      <ModalFooter>
-        <button
-          type="button"
-          className="btn btn-secondary"
-          onClick={clickSearchAgainHandler}
-        >{t('search_result.search_again')}
-        </button>
-      </ModalFooter>
     </Modal>
   );
 };