patch page function tests, import pages in App
This commit is contained in:
parent
7d4ffc4cc0
commit
538e911b21
12 changed files with 44 additions and 19 deletions
|
@ -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>
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import React from 'react';
|
||||
import './Accounts.scss';
|
||||
import './Account.scss';
|
||||
|
||||
const Account = () => {
|
||||
return (
|
||||
<>
|
||||
<p>Account</p>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import React from 'react';
|
||||
import './Accounts.scss';
|
||||
import './Game.scss';
|
||||
|
||||
const Game = () => {
|
||||
return (
|
||||
<>
|
||||
<p>Game</p>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import React from 'react';
|
||||
import './Accounts.scss';
|
||||
import './Home.scss';
|
||||
|
||||
const Home = () => {
|
||||
return (
|
||||
<>
|
||||
<p>Home</p>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
import React from 'react';
|
||||
import './Accounts.scss';
|
||||
|
||||
const Landing = () => {
|
||||
return (
|
||||
<>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Landing;
|
12
packages/server/src/pages/News/News.js
Normal file
12
packages/server/src/pages/News/News.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
import React from 'react';
|
||||
import './News.scss';
|
||||
|
||||
const News = () => {
|
||||
return (
|
||||
<>
|
||||
<p>News</p>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default News;
|
|
@ -1,9 +1,10 @@
|
|||
import React from 'react';
|
||||
import './Accounts.scss';
|
||||
import './Room.scss';
|
||||
|
||||
const Room = () => {
|
||||
return (
|
||||
<>
|
||||
<p>Room</p>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue