Browse Source

update for function name

ryoji-s 2 years ago
parent
commit
3a4d1eebc3
1 changed files with 13 additions and 13 deletions
  1. 13 13
      apps/app/src/components/Sidebar/PageCreateButton.tsx

+ 13 - 13
apps/app/src/components/Sidebar/PageCreateButton.tsx

@@ -7,11 +7,11 @@ export const PageCreateButton = React.memo((): JSX.Element => {
 
 
   const [isHovered, setIsHovered] = useState(false);
   const [isHovered, setIsHovered] = useState(false);
 
 
-  const handleMouseEnter = () => {
+  const onMouseEnterHandler = () => {
     setIsHovered(true);
     setIsHovered(true);
   };
   };
 
 
-  const handleMouseLeave = () => {
+  const onMouseLeaveHandler = () => {
     setIsHovered(false);
     setIsHovered(false);
   };
   };
 
 
@@ -19,16 +19,16 @@ export const PageCreateButton = React.memo((): JSX.Element => {
   const isSelected = true;
   const isSelected = true;
   // TODO: create page directly
   // TODO: create page directly
   // TODO: https://redmine.weseek.co.jp/issues/132680s
   // TODO: https://redmine.weseek.co.jp/issues/132680s
-  const onClickCreateNewPageButton = useCallback(() => {
+  const onCreateNewPageButtonHandler = useCallback(() => {
     // router.push(`${router.pathname}#edit`);
     // router.push(`${router.pathname}#edit`);
   }, [router]);
   }, [router]);
-  const onClickCreateTodayButton = useCallback(() => {
+  const onCreateTodaysButtonHandler = useCallback(() => {
     // router.push(`${router.pathname}#edit`);
     // router.push(`${router.pathname}#edit`);
   }, [router]);
   }, [router]);
-  const onClickTemplateForChildrenButton = useCallback(() => {
+  const onTemplateForChildrenButtonHandler = useCallback(() => {
     // router.push(`${router.pathname}/_template#edit`);
     // router.push(`${router.pathname}/_template#edit`);
   }, [router]);
   }, [router]);
-  const onClickTemplateForDescendantsButton = useCallback(() => {
+  const onTemplateForDescendantsButtonHandler = useCallback(() => {
     // router.push(`${router.pathname}/__template#edit`);
     // router.push(`${router.pathname}/__template#edit`);
   }, [router]);
   }, [router]);
 
 
@@ -39,13 +39,13 @@ export const PageCreateButton = React.memo((): JSX.Element => {
   return (
   return (
     <div
     <div
       className="d-flex flex-row"
       className="d-flex flex-row"
-      onMouseEnter={handleMouseEnter}
-      onMouseLeave={handleMouseLeave}
+      onMouseEnter={onMouseEnterHandler}
+      onMouseLeave={onMouseLeaveHandler}
     >
     >
       <div>
       <div>
         <button
         <button
           className={`d-block btn btn-primary ${isSelected ? 'active' : ''}`}
           className={`d-block btn btn-primary ${isSelected ? 'active' : ''}`}
-          onClick={onClickCreateNewPageButton}
+          onClick={onCreateNewPageButtonHandler}
           type="button"
           type="button"
           data-testid="grw-sidebar-nav-page-create-button"
           data-testid="grw-sidebar-nav-page-create-button"
         >
         >
@@ -66,7 +66,7 @@ export const PageCreateButton = React.memo((): JSX.Element => {
             <li>
             <li>
               <button
               <button
                 className="dropdown-item"
                 className="dropdown-item"
-                onClick={onClickCreateNewPageButton}
+                onClick={onCreateNewPageButtonHandler}
                 type="button"
                 type="button"
               >
               >
                 Create New Page
                 Create New Page
@@ -79,7 +79,7 @@ export const PageCreateButton = React.memo((): JSX.Element => {
             <li>
             <li>
               <button
               <button
                 className="dropdown-item"
                 className="dropdown-item"
-                onClick={onClickCreateTodayButton}
+                onClick={onCreateTodaysButtonHandler}
                 type="button"
                 type="button"
               >
               >
                 Create today&apos;s
                 Create today&apos;s
@@ -90,7 +90,7 @@ export const PageCreateButton = React.memo((): JSX.Element => {
             <li>
             <li>
               <button
               <button
                 className="dropdown-item"
                 className="dropdown-item"
-                onClick={onClickTemplateForChildrenButton}
+                onClick={onTemplateForChildrenButtonHandler}
                 type="button"
                 type="button"
               >
               >
                 Template for children
                 Template for children
@@ -99,7 +99,7 @@ export const PageCreateButton = React.memo((): JSX.Element => {
             <li>
             <li>
               <button
               <button
                 className="dropdown-item"
                 className="dropdown-item"
-                onClick={onClickTemplateForDescendantsButton}
+                onClick={onTemplateForDescendantsButtonHandler}
                 type="button"
                 type="button"
               >
               >
                 Template for descendants
                 Template for descendants