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

Ari & Luxi- Video Store Consumer- Octos #16

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
49ba029
initial react setup'
arrriiii Jun 18, 2018
2d59c74
imported react router, updated app.js to render all routes, and creat…
arrriiii Jun 18, 2018
93cafb5
Update all files for merging
Lindseyls Jun 18, 2018
aef04ab
Merge branch 'master' of https://github.com/Ari-1/video-store-consumer
Lindseyls Jun 18, 2018
b2c254b
Updated Library.js component to render the URL with axios. Created Mo…
Lindseyls Jun 18, 2018
a24c25d
added customer list and detail page
arrriiii Jun 19, 2018
9683c11
Created SearchForm.js for our search input and imported the form into…
Lindseyls Jun 19, 2018
33abccd
updated search page with movie form and results
arrriiii Jun 19, 2018
0e49b48
removed extra whitespace and console log from customer, movie, and li…
arrriiii Jun 19, 2018
b3da88e
axios post url for adding new movie to library list
arrriiii Jun 19, 2018
ac7fa4f
reverting changes
arrriiii Jun 19, 2018
052c0d7
removing changes
arrriiii Jun 19, 2018
9b0f96c
resubmit form page
arrriiii Jun 19, 2018
da1a372
merging changes
arrriiii Jun 19, 2018
9cbecfe
resolving merge conflit
arrriiii Jun 19, 2018
ddc1c23
Working on trying to get the external movie to be added to the rental…
Lindseyls Jun 19, 2018
35f4d4f
Updated the Search and Movie components to add an external movie onto…
Lindseyls Jun 20, 2018
eef7357
fixing add movie to library feature
arrriiii Jun 20, 2018
606068b
resolved merging conflicts
arrriiii Jun 20, 2018
285afed
updated styling
arrriiii Jun 20, 2018
210517a
removed button feature from library
arrriiii Jun 20, 2018
884d05d
Updated the addMovie method
Lindseyls Jun 20, 2018
e6237be
updated search component
arrriiii Jun 20, 2018
b13ac6f
removed extra lines
arrriiii Jun 20, 2018
9ed0d7b
merging items
arrriiii Jun 20, 2018
4392507
added css file for styling
arrriiii Jun 20, 2018
9acd4c6
Our movie url was somehow rendering an additional http link at the be…
Lindseyls Jun 20, 2018
28f5613
Merge branch 'master' of https://github.com/Ari-1/video-store-consumer
Lindseyls Jun 20, 2018
7c29aa5
Refactoring code
Lindseyls Jun 20, 2018
3aaf815
added
arrriiii Jun 21, 2018
5aaf877
Updated components to render the customer name that is selected
Lindseyls Jun 21, 2018
6531ea6
added movie function to movie component, sending new rental movie to …
arrriiii Jun 21, 2018
f609bf9
Refactored a little and updated the axios to pass in all params that …
Lindseyls Jun 21, 2018
bdfc827
updated container and removed props from router
arrriiii Jun 21, 2018
817889a
added status component and status callback messages to container func…
arrriiii Jun 21, 2018
52a5236
updated prop types for movie to be static function
arrriiii Jun 21, 2018
9a09465
added styling
arrriiii Jun 21, 2018
261e3ee
updated styling
arrriiii Jun 21, 2018
aa23f90
Working on trying to have the page auto load after the axios.post
Lindseyls Jun 21, 2018
c99ae67
Merge branch 'master' of https://github.com/Ari-1/video-store-consumer
Lindseyls Jun 21, 2018
7475aba
Working on css
Lindseyls Jun 22, 2018
e8a57a4
update, styling edits
arrriiii Jun 22, 2018
763cf1c
merge conflicts resolved
arrriiii Jun 22, 2018
07b7447
updated header and search bar in searchform
arrriiii Jun 22, 2018
ab80cec
updated styling for individual movie
arrriiii Jun 22, 2018
52944ac
Added favicon and updated the header. Added video gif to homepage!
Lindseyls Jun 22, 2018
9671d71
added gif to homepage
arrriiii Jun 22, 2018
b6088c5
updated home page logo and menu items
arrriiii Jun 22, 2018
f844019
Added svg file
Lindseyls Jun 22, 2018
c52ce98
Updated CSS
Lindseyls Jun 22, 2018
babb0d2
Adding more svg files
Lindseyls Jun 22, 2018
dfa2d0b
updated status component to be stateless
arrriiii Jun 22, 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
4,675 changes: 2,378 additions & 2,297 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.4"
},
"scripts": {
Expand All @@ -13,4 +15,4 @@
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
}
Binary file added public/blockbuster.ico
Binary file not shown.
Binary file removed public/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<link rel="shortcut icon" href="%PUBLIC_URL%/blockbuster.ico">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand Down
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"src": "blockbuster.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
Expand Down
62 changes: 46 additions & 16 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,28 +1,58 @@
.App {
.menu {
border: 5px solid goldenrod;
}
.menu li {
border-right: 1px solid #bbb;
display: inline-flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
color: goldenrod;
text-decoration: none;
}

.menu li:last-child {
border-right: none;
}

.menu li a {
display: block;
color: rgb(255, 201, 9);
text-align: center;
padding: 14px 16px;
text-decoration: none;
}

.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 80px;
.menu li a:hover:not(.active) {
background-color: rgb(32, 61, 185);
}

.App-header {
background-color: #222;
height: 150px;
padding: 20px;
color: white;
.active {

}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #1d1aad;
}

.App-title {
font-size: 1.5em;
header#header-background {
background-image: url('blockbuster.jpg');
background-repeat: no-repeat;
background-position: center;
background-size: contain;
padding: 150px;
text-align: center;
background-color: white;
}

.App-intro {
font-size: large;
#body {
background-color: whitesmoke;
}

@keyframes App-logo-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
#status {
color: rgb(233, 115, 29);
text-align: center;
}
40 changes: 30 additions & 10 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
import React, { Component } from 'react';
import logo from './logo.svg';
import React, {Component} from 'react';
import RentalContainer from './components/RentalContainer';
import Status from './components/Status';
import './App.css';

class App extends Component {
constructor() {
super();

this.state = {
status: {
message: '',
type: 'success'
}
}
}

updateStatus = (message, type) => {
this.setState({
status: {
message: message,
type: type
}
})
}
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>
<div id="body">
<header id="header-background">
</header>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
<div id="status">
<Status message={this.state.status.message} type={this.state.status.type}/>
</div>
< RentalContainer
sendStatusCallback ={this.updateStatus} />
</div>
);
}
}

export default App;
export default App
Binary file added src/blockbuster.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/Blockbuster.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/components/Customer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#customers {
display: inline-flex;
flex-flow: wrap column;
align-items: center;
padding: 10px;
}

button {
padding: 20px;
margin: auto;
font-size: 1em;
background-color: rgb(221, 219, 203);
}
43 changes: 43 additions & 0 deletions src/components/Customer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import Hamster from './hamster.svg';
import Popcorn from './popcorn.svg';
import Candy from './candy.svg';
import Film from './film.svg';
import Filming from './filming.svg';
import Videotape from './videotape.svg';
import Drink from './drink.svg';
import './Customer.css';

const myArray = [Hamster, Popcorn, Candy, Film, Filming, Videotape, Drink];

class Customer extends Component {

customerInfo = (event) => {
this.props.rentalCustomerCallback(event.target);
}

rand() {
return myArray[Math.floor(Math.random() * myArray.length)];
}

render() {
return (
<section id="customers">
<img src={this.rand()} height='200px' width='200px' alt="Hamster profile"/>
<h3>{this.props.name}</h3>
<p>{this.props.movies_count} Movies checked out</p>
<button onClick={this.customerInfo} name={this.props.name} id={this.props.id}>Select for Rental</button>
</section>
)
}
}

Customer.propTypes = {
name: PropTypes.string,
movies_count: PropTypes.number,
rentalCustomerCallback: PropTypes.func,
id: PropTypes.number
};

export default Customer;
63 changes: 63 additions & 0 deletions src/components/CustomerCollection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import React, { Component } from 'react';
import axios from 'axios';
import PropTypes from 'prop-types';
import Customer from './Customer';

const BASE_URL = "http://localhost:3000/customers"

class CustomerCollection extends Component {
static propTypes = {
getCustomerCallback: PropTypes.func,
updateStatusCallback: PropTypes.func
}
constructor() {
super();
this.state = {
customers: []
}
}

componentDidMount() {
this.props.updateStatusCallback('Loading...', 'success');
axios.get(BASE_URL)
.then((response) => {
this.props.updateStatusCallback('Successfully loaded all customers!', 'success');
const customers = response.data;
this.setState({ customers: customers });
})
.catch((error) => {
this.props.updateStatusCallback(error.message, 'error');
});
}

rentalForCustomer = (customer) => {
console.log(customer.name);
this.props.getCustomerCallback(customer);
}

render() {

const customers = this.state.customers.map((customer, index) => {
return <Customer
key={index}
id={customer.id}
name={customer.name}
movies_count={customer.movies_checked_out_count}
rentalCustomerCallback={this.rentalForCustomer}
/>
});


return (
<section>

<h2>Customers</h2>
<div>{customers}</div>

</section>
);
}

}

export default CustomerCollection;
39 changes: 39 additions & 0 deletions src/components/Home.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.gif {
width: 400px;
height: 240px;
position: absolute;
margin: auto;
left: 0;
right: 0;
border-radius: 10px;
border: 1px solid lightgrey;
}

#gif-one {
animation: img 3s linear forwards;
background: url(https://media.giphy.com/media/CBXzFQx2W1y7K/giphy.gif);
}

#gif-two {
animation: img2 3s linear forwards;
z-index: -1;
}

@keyframes img {
0%, 95% {
opacity: 1;
}
100% {
opacity: 0;
}
}

@keyframes img2 {
0%, 99% {
background-image: none;
}
100%{
background: url(https://media.giphy.com/media/kL1KAdQYmKXle/giphy.gif);
align-content: center;
}
}
11 changes: 11 additions & 0 deletions src/components/Home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import './Home.css';

const Home = () => (
<div className="homepage-gif">
<div id="gif-one" className="gif"></div>
<div id="gif-two" className="gif"></div>
</div>
)

export default Home;
11 changes: 11 additions & 0 deletions src/components/Library.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

#list {
display: flex;
flex-flow: wrap;
justify-content: center;
align-items: center;
margin: auto;
/* padding: 5px;
margin: 10px; */
color: rgb(39, 46, 69);
}
Loading