patch page function tests, import pages in App

This commit is contained in:
Sorrel Bri 2020-01-08 17:17:10 -08:00 committed by sorrelbri
parent 2ae07a1a99
commit cc6b00b72b
12 changed files with 44 additions and 19 deletions

View file

@ -5,6 +5,13 @@ import config from './config';
import { Switch, Route } from 'react-router-dom';
import socketIOClient from 'socket.io-client';
import Account from './pages/Account/Account';
import Game from './pages/Game/Game';
import Home from './pages/Home/Home';
import News from './pages/News/News';
import Room from './pages/Room/Room';
export const socket = socketIOClient(config.apiAddress);
function App() {
@ -20,12 +27,25 @@ function App() {
{socketData ? <p>{socketData}</p> : <></>}
<Switch>
<Route path="/" exact>
<p>Index</p>
<Route path="/account">
<Account />
</Route>
<Route path="/game">
<p>Game</p>
<Route path="/rooms">
<Room />
</Route>
<Route path="/games">
<Game />
</Route>
<Route path="/news">
<News />
</Route>
<Route path="/">
{/* Add ternary for login */}
<Home />
</Route>
</Switch>

View file

@ -1,9 +1,10 @@
import React from 'react';
import './Accounts.scss';
import './Account.scss';
const Account = () => {
return (
<>
<p>Account</p>
</>
);
}

View file

@ -1,9 +1,10 @@
import React from 'react';
import './Accounts.scss';
import './Game.scss';
const Game = () => {
return (
<>
<p>Game</p>
</>
);
}

View file

@ -1,9 +1,10 @@
import React from 'react';
import './Accounts.scss';
import './Home.scss';
const Home = () => {
return (
<>
<p>Home</p>
</>
);
}

View file

@ -1,11 +0,0 @@
import React from 'react';
import './Accounts.scss';
const Landing = () => {
return (
<>
</>
);
}
export default Landing;

View file

@ -0,0 +1,12 @@
import React from 'react';
import './News.scss';
const News = () => {
return (
<>
<p>News</p>
</>
);
}
export default News;

View file

@ -1,9 +1,10 @@
import React from 'react';
import './Accounts.scss';
import './Room.scss';
const Room = () => {
return (
<>
<p>Room</p>
</>
);
}