Shun Miyazawa 4 лет назад
Родитель
Сommit
357bc01860
1 измененных файлов с 7 добавлено и 5 удалено
  1. 7 5
      packages/app/src/components/Sidebar/PageTree/Item.tsx

+ 7 - 5
packages/app/src/components/Sidebar/PageTree/Item.tsx

@@ -195,11 +195,18 @@ const Item: FC<ItemProps> = (props: ItemProps) => {
     setRenameInputShown(true);
   }, []);
 
+  // TODO: make a put request to pages/title
   const onPressEnterForRenameHandler = () => {
     toastWarning(t('search_result.currently_not_implemented'));
     setRenameInputShown(false);
   };
 
+  // TODO: go to create page page
+  const onPressEnterForCreateHandler = () => {
+    toastWarning(t('search_result.currently_not_implemented'));
+    setNewPageInputShown(false);
+  };
+
   const inputValidator = (title: string | null): AlertInfo | null => {
     if (title == null || title === '') {
       return {
@@ -211,11 +218,6 @@ const Item: FC<ItemProps> = (props: ItemProps) => {
     return null;
   };
 
-  // TODO: go to create page page
-  const onPressEnterForCreateHandler = () => {
-    toastWarning(t('search_result.currently_not_implemented'));
-  };
-
   // didMount
   useEffect(() => {
     if (hasChildren()) setIsOpen(true);