Skip to content

Commit

Permalink
Merge pull request #17 from hatchways/create-ui-new-game_tony_13
Browse files Browse the repository at this point in the history
Create UI for New Game
  • Loading branch information
tonyc856 authored May 21, 2020
2 parents 39f8330 + cb82ffe commit 50587bc
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 1 deletion.
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;
9 changes: 9 additions & 0 deletions client/src/pages/common/common.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.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;
}
68 changes: 68 additions & 0 deletions client/src/pages/create_game/CreateGame.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
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 (
<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;

0 comments on commit 50587bc

Please sign in to comment.