Maik 3 years ago
parent
commit
d4645d7f7f
1 changed files with 2 additions and 1 deletions
  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">