Disable login/save (#778)
This commit is contained in:
		
							parent
							
								
									597a6637cb
								
							
						
					
					
						commit
						9fe34504e9
					
				
					 2 changed files with 6 additions and 3 deletions
				
			
		|  | @ -15,6 +15,8 @@ import { | ||||||
| const triangleUrl = require('../images/down-filled-triangle.svg'); | const triangleUrl = require('../images/down-filled-triangle.svg'); | ||||||
| const logoUrl = require('../images/p5js-logo-small.svg'); | const logoUrl = require('../images/p5js-logo-small.svg'); | ||||||
| 
 | 
 | ||||||
|  | const __process = (typeof global !== 'undefined' ? global : window).process; | ||||||
|  | 
 | ||||||
| class Nav extends React.PureComponent { | class Nav extends React.PureComponent { | ||||||
|   constructor(props) { |   constructor(props) { | ||||||
|     super(props); |     super(props); | ||||||
|  | @ -150,7 +152,7 @@ class Nav extends React.PureComponent { | ||||||
|                   New |                   New | ||||||
|                 </button> |                 </button> | ||||||
|               </li> |               </li> | ||||||
|               { (!this.props.project.owner || this.isUserOwner()) && |               { __process.env.LOGIN_ENABLED && (!this.props.project.owner || this.isUserOwner()) && | ||||||
|               <li className="nav__dropdown-item"> |               <li className="nav__dropdown-item"> | ||||||
|                 <button |                 <button | ||||||
|                   onClick={() => { |                   onClick={() => { | ||||||
|  | @ -460,7 +462,7 @@ class Nav extends React.PureComponent { | ||||||
|             </ul> |             </ul> | ||||||
|           </li> |           </li> | ||||||
|         </ul> |         </ul> | ||||||
|         { !this.props.user.authenticated && |         { __process.env.LOGIN_ENABLED && !this.props.user.authenticated && | ||||||
|           <ul className="nav__items-right" title="user-menu"> |           <ul className="nav__items-right" title="user-menu"> | ||||||
|             <li className="nav__item"> |             <li className="nav__item"> | ||||||
|               <p> |               <p> | ||||||
|  | @ -470,7 +472,7 @@ class Nav extends React.PureComponent { | ||||||
|               </p> |               </p> | ||||||
|             </li> |             </li> | ||||||
|           </ul>} |           </ul>} | ||||||
|         { this.props.user.authenticated && |         { __process.env.LOGIN_ENABLED && this.props.user.authenticated && | ||||||
|           <ul className="nav__items-right" title="user-menu"> |           <ul className="nav__items-right" title="user-menu"> | ||||||
|             <li className="nav__item"> |             <li className="nav__item"> | ||||||
|               <span>Hello, {this.props.user.username}!</span> |               <span>Hello, {this.props.user.username}!</span> | ||||||
|  |  | ||||||
|  | @ -29,6 +29,7 @@ export function renderIndex() { | ||||||
|         window.process.env.AWS_REGION = '${process.env.AWS_REGION}'; |         window.process.env.AWS_REGION = '${process.env.AWS_REGION}'; | ||||||
|         window.process.env.FORCE_TO_HTTPS = ${process.env.FORCE_TO_HTTPS === 'false' ? false : undefined}; |         window.process.env.FORCE_TO_HTTPS = ${process.env.FORCE_TO_HTTPS === 'false' ? false : undefined}; | ||||||
|         window.process.env.CLIENT = true; |         window.process.env.CLIENT = true; | ||||||
|  |         window.process.env.LOGIN_ENABLED = ${process.env.LOGIN_ENABLED === 'false' ? false : true} | ||||||
|       </script> |       </script> | ||||||
|     </head> |     </head> | ||||||
|     <body> |     <body> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Francis Li
						Francis Li