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

View file

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

View file

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

View file

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