master
parent
dd4b82b780
commit
18739a1c10
@ -0,0 +1,70 @@
|
|||||||
|
import './Navigation.css';
|
||||||
|
import {HashRouter,Link,Route,Switch} from "react-router-dom";
|
||||||
|
|
||||||
|
import Login from "../Components/Login";
|
||||||
|
import Register from "../Components/RegisterForm";
|
||||||
|
import Games from "../Pages/Games"
|
||||||
|
import Listener from "../Pages/Listener"
|
||||||
|
import Leagues from "../Pages/Leagues"
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
class Navigation extends React.Component
|
||||||
|
{
|
||||||
|
Leagues = ()=>{
|
||||||
|
return(
|
||||||
|
<Leagues/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
login = ()=>{
|
||||||
|
return(
|
||||||
|
<Login/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
Register = ()=>{
|
||||||
|
return(
|
||||||
|
<Register/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Games = ()=>{
|
||||||
|
return(
|
||||||
|
<Games/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
Listener = ()=>{
|
||||||
|
return(
|
||||||
|
<Listener/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
goToGames()
|
||||||
|
{
|
||||||
|
var date = new Date( new Date().setTime(new Date().getTime()+250)).toGMTString();
|
||||||
|
document.cookie = document.cookie+ 'nextPage=Register; expires='+date+';';
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
goToLeagues()
|
||||||
|
{
|
||||||
|
var date = new Date( new Date().setTime(new Date().getTime()+250)).toGMTString();
|
||||||
|
document.cookie = document.cookie+ 'nextPage=Register; expires='+date+';';
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
// render()
|
||||||
|
// {
|
||||||
|
// return(
|
||||||
|
// <div className="Navbar">
|
||||||
|
// <div className='Title'>
|
||||||
|
// {/* SVG LOGO */}
|
||||||
|
// </div>
|
||||||
|
// <div className='Leagues navbt' onClick={this.goToLeagues}><span>Leagues</span></div>
|
||||||
|
// <div className='Games navbt' onClick={this.goToGames}><span>My Games</span></div>
|
||||||
|
// </div>
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export default Navigation;
|
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
function Games() {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Games;
|
@ -1,34 +1,113 @@
|
|||||||
|
import React from 'react';
|
||||||
|
// import {HashRouter,Link,Route,Switch} from "react-router-dom";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import Login from "../Components/Login";
|
import Login from "../Components/Login";
|
||||||
import Register from "../Components/RegisterForm";
|
import Register from "../Components/RegisterForm";
|
||||||
|
import Navigation from "../Components/Navigation";
|
||||||
|
import Games from "../Pages/Games"
|
||||||
|
import Listener from "../Pages/Listener"
|
||||||
|
import Leagues from "../Pages/Leagues"
|
||||||
const { cookieSlicer } = require("../lib");
|
const { cookieSlicer } = require("../lib");
|
||||||
|
|
||||||
function Home() {
|
function Home() {
|
||||||
var Hash = cookieSlicer(document.cookie,'Hash');
|
var Hash = cookieSlicer(document.cookie,'Hash');
|
||||||
var nextPage = cookieSlicer(document.cookie, 'nextPage');
|
var nextPage = cookieSlicer(document.cookie, 'nextPage');
|
||||||
console.log(nextPage)
|
// console.log(nextPage)
|
||||||
console.log(Hash)
|
console.log(Hash)
|
||||||
return (
|
// const Leagues = ()=>{
|
||||||
<div className="BODY">
|
// return(
|
||||||
{Hash ?
|
// <Leagues/>
|
||||||
(
|
// )
|
||||||
<h1>Welcome back!</h1>
|
// }
|
||||||
//TODO: Actual Page
|
// const Login = ()=>{
|
||||||
) :
|
// return(
|
||||||
(
|
// <Login/>
|
||||||
<div>
|
// )
|
||||||
{nextPage==='Register'?
|
// }
|
||||||
(
|
// const Register = ()=>{
|
||||||
<Register />
|
// return(
|
||||||
):
|
// <Register/>
|
||||||
(
|
// )
|
||||||
<Login />
|
// }
|
||||||
)
|
|
||||||
}
|
|
||||||
</div>
|
// const Games = ()=>{
|
||||||
)
|
// return(
|
||||||
}
|
// <Games/>
|
||||||
</div>
|
// )
|
||||||
);
|
// }
|
||||||
|
|
||||||
|
// const Listener = ()=>{
|
||||||
|
// return(
|
||||||
|
// <Listener/>
|
||||||
|
// )
|
||||||
|
// }
|
||||||
|
// return (
|
||||||
|
// <HashRouter>
|
||||||
|
// <div className="App">
|
||||||
|
// <div className="menu">
|
||||||
|
// <Link to="/"><h2>Home</h2></Link>
|
||||||
|
// <Link to="/one"><h2>Stand</h2></Link>
|
||||||
|
// <Link to="/two"><h2>Sit</h2></Link>
|
||||||
|
// </div>
|
||||||
|
// <Switch>
|
||||||
|
// <Route exact path="/" component={Home}/>
|
||||||
|
// <Route exact path="/Leagues" component={Leagues}/>
|
||||||
|
// <Route exact path="/Games" component={Games}/>
|
||||||
|
// <Route exact path="/Login" component={Games}/>
|
||||||
|
// <Route exact path="/Register" component={Games}/>
|
||||||
|
// </Switch>
|
||||||
|
// </div>
|
||||||
|
// </HashRouter>
|
||||||
|
// );
|
||||||
|
return (
|
||||||
|
|
||||||
|
<div className="BODY">
|
||||||
|
{Hash ?
|
||||||
|
(
|
||||||
|
<div>
|
||||||
|
<Navigation/>
|
||||||
|
{nextPage==='Leagues'?
|
||||||
|
(
|
||||||
|
<Leagues/>
|
||||||
|
):
|
||||||
|
(
|
||||||
|
<div>
|
||||||
|
{nextPage==='Games'?
|
||||||
|
(
|
||||||
|
<Games/>
|
||||||
|
):
|
||||||
|
(
|
||||||
|
<Listener/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
) :
|
||||||
|
(
|
||||||
|
<div>
|
||||||
|
{nextPage==='Register'?
|
||||||
|
(
|
||||||
|
<Register />
|
||||||
|
):
|
||||||
|
(
|
||||||
|
<Login />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Home;
|
export default Home;
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
function Leagues() {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Leagues;
|
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
function Listener() {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Listener;
|
Loading…
Reference in new issue