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

Wenjie & Anne - Octos - VideoStore #5

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
862de23
Initial set up
wf1101 Jun 18, 2018
6676118
Initial set up
wf1101 Jun 18, 2018
a3a72c6
Created component Movie
wf1101 Jun 18, 2018
af7fc52
Created component Library to display all movies from local library
wf1101 Jun 18, 2018
d9f1a58
customer and customer collection components
annehwatson Jun 18, 2018
d1bffdb
Installed react router packages
wf1101 Jun 18, 2018
beae824
search component
annehwatson Jun 18, 2018
56aef25
Added API KEY
wf1101 Jun 18, 2018
9c4c362
Merge branch 'master' of https://github.com/wf1101/video-store-consumer
wf1101 Jun 18, 2018
c8e5b86
Added submit handler to dispaly movie list from search request
wf1101 Jun 18, 2018
52233f6
Added alt for images
wf1101 Jun 18, 2018
f1dd34f
updated image_url proptype
annehwatson Jun 19, 2018
abb3236
Added default image if there is no poster for movie from MovieDB
wf1101 Jun 19, 2018
6fe5d15
added overview property to library and movie
annehwatson Jun 19, 2018
13e03ea
Craeted homepage and navagation bar
wf1101 Jun 19, 2018
3c5062d
Added button in Movie
wf1101 Jun 19, 2018
1e80d1d
Removed previous search func created by us, implemented with API search
wf1101 Jun 19, 2018
36f973b
rental component initial
annehwatson Jun 19, 2018
83f516f
Attempted to pass movieName and customerName to rental
wf1101 Jun 19, 2018
eda0b10
embedded components in router. created blank css files
annehwatson Jun 20, 2018
f366128
icons for nav
annehwatson Jun 20, 2018
7a23abf
Fixed space mixed
wf1101 Jun 20, 2018
8a32da4
Merge branch 'master' of https://github.com/wf1101/video-store-consumer
wf1101 Jun 20, 2018
2104aff
Added a function to checkout a rental
wf1101 Jun 20, 2018
ca82d4b
Added status component
wf1101 Jun 20, 2018
38cba4f
home page logo image
annehwatson Jun 20, 2018
878c68f
Merge branch 'master' of https://github.com/wf1101/video-store-consumer
annehwatson Jun 20, 2018
83fb20c
added shiba to app instead of house
annehwatson Jun 20, 2018
ff51730
border radius
annehwatson Jun 20, 2018
793f882
Styled movies
wf1101 Jun 20, 2018
e5cd5e4
Merge branch 'master' of https://github.com/wf1101/video-store-consumer
wf1101 Jun 20, 2018
3214206
initial css
annehwatson Jun 20, 2018
37b1604
Styled header
wf1101 Jun 21, 2018
ecb7864
search bar
annehwatson Jun 21, 2018
8731708
final styling
annehwatson Jun 21, 2018
4e7551a
Added padding for header
wf1101 Jun 21, 2018
7cdeeee
Refactor
wf1101 Jun 21, 2018
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand All @@ -19,3 +20,5 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

.env
90 changes: 90 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"cors": "^2.8.4",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.4"
},
"scripts": {
Expand All @@ -13,4 +17,4 @@
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
}
62 changes: 45 additions & 17 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,28 +1,56 @@
.App {
text-align: center;
ul {
list-style-type: none;
}

.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 80px;
.navigation {
display: flex;
flex-wrap: wrap;
}

.App-header {
background-color: #222;
height: 150px;
padding: 20px;
color: white;
a {
text-decoration: none;
}

.App-title {
font-size: 1.5em;
img {
width: 260px;
}

.App-intro {
font-size: large;
.shiba {
border-radius: 5%;
}

@keyframes App-logo-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
.top-nav {
display: flex;
flex-direction: column;
}

.links img {
height: 200px;
width: 200px;
margin: 0 30px;
}

.shiba-spot {
margin-right: 40px;
}

header {
margin: 50px 100px 50px 175px;
padding-left: 50px;
}

.top-nav .links {
padding: 30px;
}

.top-nav .rental-container {
font-size: 1.6rem;
}

.rental-info {
align-content: center;
}

/* .body {
background-color: black;
} */
132 changes: 115 additions & 17 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,119 @@
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import Library from './components/Library';
import Search from './components/Search';
import CustomerCollection from'./components/CustomerCollection';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import Rental from './components/Rental';
import Movie from './components/Movie';
import axios from 'axios';
import PropTypes from 'prop-types';
import Status from './components/Status';


class App extends Component {
render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
</header>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
</div>
);
}
}

export default App;
static propTypes = {
updateStatusCallback: PropTypes.func,
}

constructor() {
super();

this.state = {
movieName: "None",
customerName: "None",
customerID: null,
status: {
message: `Welcome to such movie so wow`,
type: 'success'
}
}
}

updateStatus = (message, type) => {
this.setState({
status: {
message: message,
type: type
}
})
}

selectMovie = (title) => {
this.setState({
movieName: title
});
}

selectCustomer = (name, id) => {
this.setState({
customerName: name,
customerID: id
});
}


render() {
return (
<Router>
<div className="body">
<header>
<div className="navigation">
<div className="shiba-spot">
<Link to="/"><img className="shiba" src={require("./images/shiba.png")}/></Link>
</div>
<div className="top-nav">
<div className="links">
<Link to="/search"><img src={require("./images/search.png")}/></Link>

<Link to="/library"><img src={require("./images/video.png")}/></Link>

<Link to="/customers"><img src={require("./images/customers.png")}/></Link>
</div>

</div>
<div className="rental-info">
<Rental movieName={ this.state.movieName }
customerName={ this.state.customerName }
customerID={ this.state.customerID }
updateStatusCallback={ this.updateStatus }
/>
</div>
</div>



</header>
<section className="body">
<Status
message={ this.state.status.message }
type={ this.state.status.type }
/>
</section>


<Route
path="/search"
render={(props) => <Search {...props}
updateStatusCallback={ this.updateStatus }/>}
/>

<Route
path="/library"
render={(props) => <Library {...props} selectMovieCallback={ this.selectMovie }
updateStatusCallback={ this.updateStatus }
/> }
/>
<Route
path="/customers"
render={(props) => <CustomerCollection {...props} selectCustomerCallback={ this.selectCustomer }
updateStatusCallback={ this.updateStatus }/>}
/>

</div>
</Router>
);
}
}

export default App;
Loading