ソースを参照

disappear editor icon in admin page

yusuketk 5 年 前
コミット
559b4006e5
1 ファイル変更3 行追加1 行削除
  1. 3 1
      src/client/js/components/Fab.jsx

+ 3 - 1
src/client/js/components/Fab.jsx

@@ -15,6 +15,8 @@ const logger = loggerFactory('growi:cli:Fab');
 const Fab = (props) => {
   const { navigationContainer, appContainer } = props;
   const { currentUser } = appContainer;
+  // see: https://regex101.com/r/1U1XBQ/1
+  const isAdminPage = window.location.pathname.match(/^\/admin(\/.*)*$/) != null;
 
   const [animateClasses, setAnimateClasses] = useState('invisible');
 
@@ -59,7 +61,7 @@ const Fab = (props) => {
 
   return (
     <div className="grw-fab d-none d-md-block">
-      {currentUser != null && renderPageCreateButton()}
+      {(currentUser != null && !isAdminPage) && renderPageCreateButton()}
       <div className={`rounded-circle position-absolute ${animateClasses}`} style={{ bottom: 0, right: 0 }}>
         <button type="button" className="btn btn-light btn-scroll-to-top rounded-circle p-0" onClick={() => navigationContainer.smoothScrollIntoView()}>
           <ReturnTopIcon />