Maik 3 年之前
父節點
當前提交
d4645d7f7f
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      front/src/App.js

+ 2 - 1
front/src/App.js

@@ -19,6 +19,7 @@ const Sandbox =()=>{
   let user = useSelector(state => state.user.currentUser.id)
   let email = useSelector(state => state.user.currentUser.email)
   let codeHTML ,codeCSS , codeJS ,title 
+  const isAuth = useSelector(state => state.user.isAuth)
 
   const htmlCodeGenerator=(codeHtml)=>{
     const htmlOutput = document.getElementById("htmlOutput")
@@ -46,7 +47,7 @@ const Sandbox =()=>{
       <fieldset className="title">
         <legend>Title</legend>
         <textarea  onChange={txt => title=txt.target.value} className="nameProj" name="title"></textarea>
-        <button className='saveProject' type='button'  onClick={()=> saveProject(title,codeHTML,codeCSS,codeJS,user,email)}>Save new project</button>
+        { isAuth&&<button className='saveProject' type='button'  onClick={()=> saveProject(title,codeHTML,codeCSS,codeJS,user,email)}>Save new project</button>}
       </fieldset>
        <form className="ide">
         <fieldset className="dev">