kaori 4 лет назад
Родитель
Сommit
970e36ee16
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      packages/app/src/components/PageCreateModal.jsx

+ 4 - 4
packages/app/src/components/PageCreateModal.jsx

@@ -42,7 +42,7 @@ const PageCreateModal = (props) => {
   const [todayInput2, setTodayInput2] = useState('');
   const [todayInput2, setTodayInput2] = useState('');
   const [pageNameInput, setPageNameInput] = useState(pageNameInputInitialValue);
   const [pageNameInput, setPageNameInput] = useState(pageNameInputInitialValue);
   const [template, setTemplate] = useState(null);
   const [template, setTemplate] = useState(null);
-  const [isUsersHomePageHoge, setIsUsersHomePageHoge] = useState(false);
+  const [matchesUserHomePagePath, setMatchesUserHomePagePath] = useState(false);
 
 
   // ensure pageNameInput is synced with selectedPagePath || currentPagePath
   // ensure pageNameInput is synced with selectedPagePath || currentPagePath
   useEffect(() => {
   useEffect(() => {
@@ -51,7 +51,7 @@ const PageCreateModal = (props) => {
 
 
   const checkIsUsersHomePageDebounce = useMemo(() => {
   const checkIsUsersHomePageDebounce = useMemo(() => {
     const checkIsUsersHomePage = () => {
     const checkIsUsersHomePage = () => {
-      setIsUsersHomePageHoge(isUsersHomePage(pageNameInput));
+      setMatchesUserHomePagePath(isUsersHomePage(pageNameInput));
     };
     };
 
 
     return debounce(1000, checkIsUsersHomePage);
     return debounce(1000, checkIsUsersHomePage);
@@ -236,14 +236,14 @@ const PageCreateModal = (props) => {
                 data-testid="btn-create-page-under-below"
                 data-testid="btn-create-page-under-below"
                 className="grw-btn-create-page btn btn-outline-primary rounded-pill text-nowrap ml-3"
                 className="grw-btn-create-page btn btn-outline-primary rounded-pill text-nowrap ml-3"
                 onClick={createInputPage}
                 onClick={createInputPage}
-                disabled={isUsersHomePageHoge}
+                disabled={matchesUserHomePagePath}
               >
               >
                 <i className="icon-fw icon-doc"></i>{t('Create')}
                 <i className="icon-fw icon-doc"></i>{t('Create')}
               </button>
               </button>
             </div>
             </div>
 
 
           </div>
           </div>
-          { isUsersHomePageHoge && (
+          { matchesUserHomePagePath && (
             <p className="text-danger mt-2">Error: Cannot create page under /user page directory.</p>
             <p className="text-danger mt-2">Error: Cannot create page under /user page directory.</p>
           ) }
           ) }