patch page function tests, import pages in App
This commit is contained in:
parent
8e94b6d83c
commit
6486176d8f
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 { 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>
|
||||||
|
|
|
@ -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>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import './Accounts.scss';
|
|
||||||
|
|
||||||
const Landing = () => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Landing;
|
|
12
packages/play-node-go/src/pages/News/News.js
Normal file
12
packages/play-node-go/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 React from 'react';
|
||||||
import './Accounts.scss';
|
import './Room.scss';
|
||||||
|
|
||||||
const Room = () => {
|
const Room = () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<p>Room</p>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue