kosei-n пре 2 година
родитељ
комит
517210404d

+ 0 - 25
apps/app/src/components/PageHeader/PageHeader.tsx

@@ -1,10 +1,5 @@
-import { useState, useCallback } from 'react';
 import type { FC } from 'react';
 
-import nodePath from 'path';
-
-import { pathUtils } from '@growi/core/dist/utils';
-
 import { useSWRxCurrentPage } from '~/stores/page';
 
 import { PagePathHeader } from './PagePathHeader';
@@ -13,22 +8,6 @@ import { PageTitleHeader } from './PageTitleHeader';
 
 export const PageHeader: FC = () => {
   const { data: currentPage } = useSWRxCurrentPage();
-  // const currentPagePath = currentPage?.path;
-
-  // const [editedPagePath, setEditedPagePath] = useState(currentPagePath ?? '');
-
-  // const editedPageTitle = nodePath.basename(editedPagePath);
-
-  // const onInputChangeForPagePath = useCallback((inputText: string) => {
-  //   const parentPath = pathUtils.addTrailingSlash(nodePath.dirname(currentPage?.path ?? ''));
-  //   const newPagePath = nodePath.resolve(parentPath, inputText);
-
-  //   setEditedPagePath(newPagePath);
-  // }, [currentPage?.path, setEditedPagePath]);
-
-  // const onInputChangeForPageTitle = (inputText: string) => {
-  //   setEditedPagePath(inputText);
-  // };
 
   if (currentPage == null) {
     return <></>;
@@ -38,13 +17,9 @@ export const PageHeader: FC = () => {
     <>
       <PagePathHeader
         currentPage={currentPage}
-        // inputValue={editedPagePath}
-        // onInputChange={onInputChangeForPagePath}
       />
       <PageTitleHeader
         currentPage={currentPage}
-        // inputValue={editedPageTitle}
-        // onInputChange={onInputChangeForPageTitle}
       />
     </>
   );

+ 1 - 3
apps/app/src/components/PageHeader/PagePathHeader.tsx

@@ -1,5 +1,5 @@
 import {
-  useMemo, useState, useEffect, useCallback, useTransition,
+  useMemo, useState, useEffect, useCallback,
 } from 'react';
 import type { FC } from 'react';
 
@@ -19,8 +19,6 @@ import { usePagePathRenameHandler } from './page-header-utils';
 
 export type Props = {
   currentPage: IPagePopulatedToShowRevision
-  // inputValue: string
-  // onInputChange?: (inputText: string) => void
 }
 
 export const PagePathHeader: FC<Props> = (props) => {

+ 1 - 1
apps/app/src/components/PageHeader/PageTitleHeader.tsx

@@ -1,5 +1,5 @@
 import type { FC } from 'react';
-import { useState, useMemo, useCallback } from 'react';
+import { useState, useCallback } from 'react';
 
 import nodePath from 'path';
 

+ 0 - 3
apps/app/src/components/PageHeader/page-header-utils.ts

@@ -35,9 +35,6 @@ export const usePagePathRenameHandler = (
       return;
     }
 
-    console.log(newPagePath);
-    console.log(currentPagePath);
-
     try {
       await apiv3Put('/pages/rename', {
         pageId: currentPage._id,