Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create UI for New Game #17

Merged
merged 3 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ node_modules/
.env.development.local
.env.test.local
.env.production.local
.vscode/*

npm-debug.log*
yarn-debug.log*
Expand Down
4 changes: 3 additions & 1 deletion client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import { BrowserRouter, Route } from "react-router-dom";

import { theme } from "./themes/theme";
import LandingPage from "./pages/Landing";
import CreateGame from "./pages/create_game/CreateGame";

import "./App.css";

function App() {
return (
<MuiThemeProvider theme={theme}>
<BrowserRouter>
<Route path="/" component={LandingPage} />
<Route exact path="/" component={LandingPage} />
<Route path="/create_game" component={CreateGame} />
</BrowserRouter>
</MuiThemeProvider>
);
Expand Down
30 changes: 30 additions & 0 deletions client/src/pages/common/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from "react";
import Grid from "@material-ui/core/Grid";
import Typography from "@material-ui/core/Typography";

import "../common/common.css";

function Header(props) {
return (
<>
<Grid
container
className="header"
direction="column"
justify="center"
alignItems="center"
>
<Grid item>
<Typography className="title" align="center" variant="h4">
{props.title}
</Typography>
</Grid>
<Grid item>
<div className="underscore" />
</Grid>
</Grid>
</>
);
}

export default Header;
13 changes: 13 additions & 0 deletions client/src/pages/common/common.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.header {
justify-content: center;
}

.header .title {
padding: 15px;
}

.header .underscore {
height: 3px;
width: 75px;
background-color: limegreen;
}
12 changes: 12 additions & 0 deletions client/src/pages/create_game/CreateGame.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.header {
margin-bottom: 15px;
}

.panel {
padding: 25px 40px;
min-width: 350px;
}

.panel .grid-input {
margin-right: 8px;
}
70 changes: 70 additions & 0 deletions client/src/pages/create_game/CreateGame.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import React from "react";
import Button from "@material-ui/core/Button";
import Container from "@material-ui/core/Container";
import Grid from "@material-ui/core/Grid";
import Input from "@material-ui/core/Input";
import Typography from "@material-ui/core/Typography";

import Header from "../common/Header";
import "./CreateGame.css";

function CreateGame() {
return (
<>
tonyc856 marked this conversation as resolved.
Show resolved Hide resolved
<Container>
<Grid container direction="column" justify="center" alignItems="center">
<Grid item className="header">
<Header title="Welcome" />
</Grid>
<Grid item>
<Grid container justify="center" alignItems="center">
<Grid item className="panel">
<Grid container direction="column">
<Grid item>
<Grid container direction="column">
<Grid item>
<Typography variant="h6" gutterBottom>
Join a Game:
</Typography>
</Grid>
<Grid item>
<Grid container alignItems="center">
<Grid item className="grid-input">
<Input placeholder="Enter Game ID" />
</Grid>
<Grid item>
<Button variant="contained" color="primary">
Join
</Button>
</Grid>
</Grid>
</Grid>
</Grid>
</Grid>
</Grid>
</Grid>
<Grid item className="panel">
<Grid container direction="column">
<Grid item>
<Grid container direction="column">
<Grid item>
<Typography variant="h6" gutterBottom>
New Game:
</Typography>
</Grid>
<Grid item>
<Button variant="contained">Create</Button>
</Grid>
</Grid>
</Grid>
</Grid>
</Grid>
</Grid>
</Grid>
</Grid>
</Container>
</>
);
}

export default CreateGame;