Shun Miyazawa 2 лет назад
Родитель
Сommit
9aa640ccef

+ 2 - 2
apps/app/src/components/Common/ClosableTextInput.tsx

@@ -13,7 +13,7 @@ type ClosableTextInputProps = {
   value?: string
   value?: string
   placeholder?: string
   placeholder?: string
   validationTarget?: string,
   validationTarget?: string,
-  useAutosize?: boolean
+  useAutosizeInput?: boolean
   onPressEnter?(inputText: string | null): void
   onPressEnter?(inputText: string | null): void
   onPressEscape?: () => void
   onPressEscape?: () => void
   onClickOutside?(): void
   onClickOutside?(): void
@@ -134,7 +134,7 @@ const ClosableTextInput: FC<ClosableTextInputProps> = memo((props: ClosableTextI
 
 
   return (
   return (
     <div>
     <div>
-      { props.useAutosize
+      { props.useAutosizeInput
         ? <AutosizeInput {...inputProps} />
         ? <AutosizeInput {...inputProps} />
         : <input className="form-control" {...inputProps} />
         : <input className="form-control" {...inputProps} />
       }
       }

+ 14 - 11
apps/app/src/components/PageHeader/PagePathHeader.tsx

@@ -95,14 +95,17 @@ export const PagePathHeader: FC<Props> = (props) => {
       >
       >
         {isRenameInputShown
         {isRenameInputShown
           ? (
           ? (
-            <ClosableTextInput
-              value={editedPagePath}
-              placeholder={t('Input page name')}
-              onPressEnter={onPressEnter}
-              onPressEscape={onPressEscape}
-              validationTarget={ValidationTarget.PAGE}
-              handleInputChange={onInputChange}
-            />
+            <div className="page-path-header-input me-2">
+              <ClosableTextInput
+                useAutosizeInput
+                value={editedPagePath}
+                placeholder={t('Input page name')}
+                onPressEnter={onPressEnter}
+                onPressEscape={onPressEscape}
+                handleInputChange={onInputChange}
+                validationTarget={ValidationTarget.PAGE}
+              />
+            </div>
           )
           )
           : (
           : (
             <div className="me-2">
             <div className="me-2">
@@ -131,9 +134,9 @@ export const PagePathHeader: FC<Props> = (props) => {
       </div>
       </div>
 
 
       {isOpened
       {isOpened
-          && (
-            <PageSelectModal />
-          )}
+        && (
+          <PageSelectModal />
+        )}
     </div>
     </div>
   );
   );
 };
 };

+ 20 - 22
apps/app/src/components/PageHeader/PageTitleHeader.tsx

@@ -61,27 +61,25 @@ export const PageTitleHeader: FC<Props> = (props) => {
 
 
 
 
   return (
   return (
-    <div className="row">
-      <div className="col-4">
-        {isRenameInputShown
-          ? (
-            <div className="flex-fill">
-              <ClosableTextInput
-                value={editedPageTitle}
-                placeholder={t('Input page name')}
-                onPressEnter={onPressEnter}
-                onPressEscape={onPressEscape}
-                validationTarget={ValidationTarget.PAGE}
-                handleInputChange={onInputChange}
-              />
-            </div>
-          )
-          : (
-            <h2 onClick={onClickPageTitle}>
-              {pageTitle}
-            </h2>
-          )}
-      </div>
-    </div>
+    <>
+      {isRenameInputShown
+        ? (
+          <div className="page-title-header-input">
+            <ClosableTextInput
+              useAutosizeInput
+              value={editedPageTitle}
+              onPressEnter={onPressEnter}
+              onPressEscape={onPressEscape}
+              handleInputChange={onInputChange}
+              validationTarget={ValidationTarget.PAGE}
+            />
+          </div>
+        )
+        : (
+          <h2 onClick={onClickPageTitle}>
+            {pageTitle}
+          </h2>
+        )}
+    </>
   );
   );
 };
 };