Преглед изворни кода

replace currentPagePath with inputText

kosei-n пре 2 година
родитељ
комит
7266cbd261
1 измењених фајлова са 4 додато и 5 уклоњено
  1. 4 5
      apps/app/src/components/PageHeader/PagePathHeader.tsx

+ 4 - 5
apps/app/src/components/PageHeader/PagePathHeader.tsx

@@ -1,6 +1,5 @@
-import {
-  FC, useEffect, useMemo, useState,
-} from 'react';
+import type { FC } from 'react';
+import { useEffect, useMemo, useState } from 'react';
 
 import type { IPagePopulatedToShowRevision } from '@growi/core';
 
@@ -23,7 +22,7 @@ export const PagePathHeader: FC<Props> = (props) => {
 
   const [isRenameInputShown, setRenameInputShown] = useState(false);
   const [isButtonsShown, setButtonShown] = useState(false);
-  const [inputText, setInputText] = useState('');
+  const [inputText, setInputText] = useState(currentPagePath);
 
   const { data: editorMode } = useEditorMode();
   const { data: PageSelectModalData, open: openPageSelectModal } = usePageSelectModal();
@@ -102,7 +101,7 @@ export const PagePathHeader: FC<Props> = (props) => {
             <TextInputForPageTitleAndPath
               currentPage={currentPage}
               stateHandler={stateHandler}
-              inputValue={currentPagePath}
+              inputValue={inputText}
               CustomComponent={PagePath}
               handleInputChange={handleInputChange}
             />