takeru0001 5 年 前
コミット
0df0c4671b
1 ファイル変更20 行追加0 行削除
  1. 20 0
      src/client/js/components/PageDuplicateModal.jsx

+ 20 - 0
src/client/js/components/PageDuplicateModal.jsx

@@ -26,6 +26,8 @@ const PageDuplicateModal = (props) => {
   const [errorCode, setErrorCode] = useState(null);
   const [errorMessage, setErrorMessage] = useState(null);
 
+  const [isDuplicateWithChild, SetIsDuplicateWithChild] = useState(false);
+
   /**
    * change pageNameInput for PagePathAutoComplete
    * @param {string} value
@@ -42,6 +44,10 @@ const PageDuplicateModal = (props) => {
     setPageNameInput(value);
   }
 
+  function changeIsDuplicateWithChildHandler() {
+    SetIsDuplicateWithChild(!isDuplicateWithChild);
+  }
+
   async function duplicate() {
     try {
       setErrorCode(null);
@@ -96,6 +102,20 @@ const PageDuplicateModal = (props) => {
                 />
               )}
             </div>
+
+            <div className="custom-control custom-checkbox custom-checkbox-warning">
+              <input
+                className="custom-control-input"
+                name="dupicateWithChild"
+                id="dupicateWithChild"
+                type="checkbox"
+                checked={isDuplicateWithChild}
+                onChange={changeIsDuplicateWithChildHandler}
+              />
+              <label className="form-group" htmlFor="duplicatePageName">
+                { t(' modal_duplicate.Duplicate with child') }
+              </label>
+            </div>
           </div>
         </div>
       </ModalBody>