Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
804b470
set up
vwhwang Jun 22, 2020
f42c5e9
setup
FreeMonkey19 Jun 22, 2020
31f2c6a
Merge branch 'master' of github.com:vwhwang/video-store-consumer
FreeMonkey19 Jun 22, 2020
afae7cb
api can call movie in console
vwhwang Jun 22, 2020
c4c25a1
added all movies to show up library
vwhwang Jun 23, 2020
b6160d5
clean up
vwhwang Jun 23, 2020
6a446b6
added react router dom
vwhwang Jun 23, 2020
68af906
Merge branch 'movies_api' of github.com:vwhwang/video-store-consumer
FreeMonkey19 Jun 23, 2020
146b0ce
added movie and movie list
vwhwang Jun 23, 2020
6d04c15
added state for app
vwhwang Jun 23, 2020
c5dbac9
notes
vwhwang Jun 23, 2020
108b311
Merge branch 'movies_api' of github.com:vwhwang/video-store-consumer
FreeMonkey19 Jun 23, 2020
1915562
Merge pull request #1 from vwhwang/movies_api
vwhwang Jun 23, 2020
5ca92de
Merge branch 'master' of github.com:vwhwang/video-store-consumer
FreeMonkey19 Jun 23, 2020
1141a48
create customer and customer list components
FreeMonkey19 Jun 23, 2020
09dfc82
Merge pull request #2 from vwhwang/customer_api
vwhwang Jun 23, 2020
a57cd58
added search component
vwhwang Jun 23, 2020
9229b89
added form on movie search
vwhwang Jun 23, 2020
b2493cd
search now works
vwhwang Jun 23, 2020
aa6db5b
added search funtion
vwhwang Jun 23, 2020
0ce3e68
Merge pull request #3 from vwhwang/movie_search_external_api
vwhwang Jun 23, 2020
12c63af
added checkout component
vwhwang Jun 23, 2020
6cce757
checkout currently works, it will change the customer movies_checked_out
vwhwang Jun 24, 2020
fd20ba7
Merge pull request #4 from vwhwang/rental_check_out
vwhwang Jun 24, 2020
7e7169b
add message for successfuly checkout
vwhwang Jun 24, 2020
87dca1f
added return function
vwhwang Jun 24, 2020
08194c9
added return function
vwhwang Jun 24, 2020
e8a52db
added some info on library movie
vwhwang Jun 24, 2020
f350e7f
Merge pull request #5 from vwhwang/rental_check_in
vwhwang Jun 24, 2020
ec94790
add customer details
FreeMonkey19 Jun 24, 2020
0dcc8d9
added function to see new movie detail
vwhwang Jun 24, 2020
53dacd7
created search detail movie component
vwhwang Jun 24, 2020
6e13550
added add movie function and it works
vwhwang Jun 24, 2020
8454e12
Merge pull request #6 from vwhwang/add_movie_to_library
vwhwang Jun 24, 2020
68114a2
remove list styling
FreeMonkey19 Jun 24, 2020
bd422d3
remove list styling
FreeMonkey19 Jun 24, 2020
8096cf9
style nav bar
FreeMonkey19 Jun 24, 2020
24b075c
hide customer and selected movie on home page
vwhwang Jun 24, 2020
e9decf9
Merge pull request #7 from vwhwang/hide_selected_movie
vwhwang Jun 24, 2020
b9e7040
style checkout and return movie buttons
FreeMonkey19 Jun 24, 2020
1b38587
added pink to main background color
vwhwang Jun 24, 2020
ff7ec82
Merge pull request #8 from vwhwang/style_vic
vwhwang Jun 25, 2020
af7b3b9
fix typo
FreeMonkey19 Jun 25, 2020
f7dd965
fix merge conflicts
FreeMonkey19 Jun 25, 2020
97f26e0
styling components
FreeMonkey19 Jun 25, 2020
f6fa3dc
styling components
FreeMonkey19 Jun 25, 2020
9ae9c1f
change color of app title
FreeMonkey19 Jun 25, 2020
d2152f6
adjust titles to match
FreeMonkey19 Jun 25, 2020
516f6c1
tidy up app.css and app.js files
FreeMonkey19 Jun 25, 2020
01bcd6a
added clear selected movie customer button
vwhwang Jun 25, 2020
193a153
fix serch bug
vwhwang Jun 25, 2020
afe3847
Merge pull request #9 from vwhwang/clear_selected_movie_customer
vwhwang Jun 25, 2020
1e3f42d
added npm moment library for dateformating
vwhwang Jun 25, 2020
16394d8
Merge pull request #10 from vwhwang/display_message_checkinout
vwhwang Jun 25, 2020
551583c
added movie and customer to be side by side
vwhwang Jun 25, 2020
eceaf45
Merge pull request #11 from vwhwang/format_select_movie_customer_side
vwhwang Jun 25, 2020
ff892a7
add photos
FreeMonkey19 Jun 25, 2020
c8650e3
Merge branch 'styling-char' of github.com:vwhwang/video-store-consumer
FreeMonkey19 Jun 25, 2020
b004309
more image stuff
FreeMonkey19 Jun 25, 2020
cfb0ddd
to make photo show
vwhwang Jun 25, 2020
c9fbfd7
added img photo with text
vwhwang Jun 25, 2020
c44df0d
npm install axios
FreeMonkey19 Jun 25, 2020
1348422
changed the color a bit
vwhwang Jun 25, 2020
a4a38a6
Merge pull request #12 from vwhwang/master
FreeMonkey19 Jun 25, 2020
c32bc07
Merge pull request #13 from vwhwang/styling-char
vwhwang Jun 25, 2020
07dd250
added buttons color
vwhwang Jun 25, 2020
9b8969d
Merge pull request #14 from vwhwang/buttons_5
vwhwang Jun 25, 2020
c1b4603
changed baserul to heroku
vwhwang Jun 25, 2020
2414e2c
added deploy in package json
vwhwang Jun 26, 2020
e9a15f1
try fix url
vwhwang Jun 26, 2020
7933c88
hash router
vwhwang Jun 26, 2020
a018cd8
changed app name to movie start
vwhwang Jun 26, 2020
71c9002
changed name
vwhwang Jun 26, 2020
498dc64
added cute icon for movie and customer
vwhwang Jun 26, 2020
7fec108
added pink shadow for button
vwhwang Jun 26, 2020
cabfc6c
added flash message function
vwhwang Jun 26, 2020
f0b4b93
Merge pull request #15 from vwhwang/try_flash_message
vwhwang Jun 26, 2020
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
10,393 changes: 5,928 additions & 4,465 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,40 @@
{
"homepage": "http://vwhwang.github.io/video-store-consumer",
"name": "video-store-consumer",
"version": "0.1.1",
"private": true,
"dependencies": {
"@material-ui/core": "^4.10.2",
"@material-ui/lab": "^4.0.0-alpha.56",
"axios": "^0.19.2",
"moment": "^2.27.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-icons": "^3.10.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1"
},
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"gh-pages": "^3.1.0"
}
}
137 changes: 123 additions & 14 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,136 @@
text-align: center;
}

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

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

/* remove bullets from li elements */
.App-list-style {
display: inline-block;
list-style: none;
text-align: left;
}

.App-list-style {
list-style: none;
padding: 10px ;
}

.App-clear-selected {
padding: 5px;
margin-bottom: 5px;
}

.App-selected-customer-title {
margin-top: 5px;
}

.App-customer-detail-title {
padding-top: 25px;
padding-right: 25px;
padding-left: 25px;
}

.App-customer-detail {
font-weight: bold;
}

.CheckoutReturn {
background-color: plum;
}

.App-nav-link-container {
padding-right: 10px;
margin-right: 10px;
border-right: solid black 1px;
display: inline-block;
}

/* remove right border from Customers link on nav bar */
.App-nav-link-container:last-of-type {
padding-right: 0;
border-right: none;
margin-right: 0;
}

.App-nav-link {
color: black;
text-decoration: none;
font-size: 20px;
}

.App-nav-link:not(.active):hover {
color: purple;
}

.App-title {
font-size: 1.5em;


.App-selections {
/* display: inline-block; */
border-top: dashed;
padding:50px;
/* margin-left: 25px; */
}

.App-intro {
font-size: large;
.App-selected {
float: left;
width: 50%;
}

@keyframes App-logo-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
.logo img {
width: 850px;
padding:25px;
}



/* buttons */
.MainButton:focus {outline:0;}

.MainButton {
margin:5px;
width:209px;
box-shadow:inset 0px 1px 0px 0px #e184f3;
background:linear-gradient(to bottom, #c123de 5%, #a20dbd 100%);
background-color:#c123de;
border-radius:6px;
border:1px solid #a511c0;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:Arial;
font-size:15px;
font-weight:bold;
padding:6px 24px;
text-decoration:none;
text-shadow:0px 1px 0px #9b14b3;
}
.MainButton:hover {
background:linear-gradient(to bottom, #a20dbd 5%, #c123de 100%);
background-color:#a20dbd;
}
.MainButton:active {
position:relative;
top:1px;
}

.ShowSelected {
font-size: 20px;
}

#Hotpink {
box-shadow:inset 0px 1px 0px 0px hotpink;
background:linear-gradient(to bottom, hotpink 5%, rgb(236, 77, 156) 100%);
background-color:hotpink;
border-radius:6px;
border:1px solid hotpink;
text-shadow:0px 1px 0px #9b14b3;
}

#Hotpink:hover {
background:linear-gradient(to bottom, rgb(236, 77, 156) 5%, hotpink 100%);
background-color:#a20dbd;
}
140 changes: 132 additions & 8 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,145 @@
import React, { Component } from 'react';
import logo from './logo.svg';
import React, { Component , useState } from 'react';
import MovieList from './components/MovieList';
import CustomerList from './components/CustomerList';
import Search from './components/Search';
import Checkout from './components/Checkout';
import Return from './components/Return';
import moment from 'moment';
import './App.css';
import charvic from "./images/char_vic_v2.jpg";

import WithFlash from './components/WithFlash';

import {MdLocalMovies,MdMovieFilter} from "react-icons/md";
import { RiStarSmileLine } from "react-icons/ri";

import {
HashRouter as Router,
Switch,
Route,
Link
} from "react-router-dom";
import SearchDetail from './components/SearchDetail';

class App extends Component {

constructor(props) {
super(props);
this.state = {
selectedMovie: {},
selectedCustomer: {},
displayMessage: null,
};
}

setSelectedMovie(movie){
this.setState({selectedMovie:movie})
}

setSelectedCustomer(customer){
this.setState({selectedCustomer:customer})
}

onClearSelection() {
this.setState({selectedMovie:{}})
this.setState({selectedCustomer:{}})
}

setDisplayMessage(displayMessage) {
console.log("in setDisplayMessage\n"+displayMessage);
this.setState({displayMessage:displayMessage})
}

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>
<h1 className="App-title">Movie Star Rentals</h1>
</header>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>

<Router>
<nav>
<ul>
<li className="App-nav-link-container">
<Link className="App-nav-link" to="/">Home</Link>
</li>
<li className="App-nav-link-container">
<Link className="App-nav-link" to="/library">Library</Link>
</li>
<li className="App-nav-link-container">
<Link className="App-nav-link" to="/search">Search</Link>
</li>
<li className="App-nav-link-container">
<Link className="App-nav-link" to="/customers">Customers</Link>
</li>
</ul>
</nav>

< WithFlash displayMessage={this.state.displayMessage} />

<div className="CheckoutReturn">
<Checkout movie = {this.state.selectedMovie.title} customer = {this.state.selectedCustomer} setDisplayMessage={this.setDisplayMessage.bind(this)} />
<Return movie = {this.state.selectedMovie.title} customer = {this.state.selectedCustomer} setDisplayMessage={this.setDisplayMessage.bind(this)}/>
<button className="MainButton" onClick = {this.onClearSelection.bind(this)}>Clear Movie/Customer</button>
<p className = "ShowSelected"> <MdLocalMovies /> Movie: {this.state.selectedMovie.title}</p>
<p className = "ShowSelected"> <RiStarSmileLine/> Customer: {this.state.selectedCustomer.name}</p>
</div>


<Switch>

<Route exact path="/">
<div className="logo">
<img src={charvic} alt="girl in red and purple sunglasses"></img>
</div>
</Route>

<Route path="/library">
<MovieList setSelectedMovieCallBack = {this.setSelectedMovie.bind(this)} />
</Route>

<Route path="/search">
<Search setDisplayMessage={this.setDisplayMessage.bind(this)}/>
</Route>


<Route path="/customers">
<CustomerList setSelectedCustomerCallBack = {this.setSelectedCustomer.bind(this)} />
</Route>
</Switch>

</Router>

<div className = "App-selections">

<div className = "App-selected">
<SearchDetail movie={this.state.selectedMovie}/>
</div>

{this.state.selectedCustomer.name && (
<div className="App-selected-customer-container App-selected ">
<h3 className="App-customer-detail-title">Customer Details:</h3>
<p><span className="App-customer-detail">Name:</span> {this.state.selectedCustomer.name}, <span className="App-customer-detail">Registered At: </span> {moment(this.state.selectedCustomer.registered_at).format('LL') }</p>

<ul>
<li className="App-list-style"><span className="App-customer-detail">Address: </span> {this.state.selectedCustomer.address}</li>
<li className="App-list-style"><span className="App-customer-detail">City: </span> {this.state.selectedCustomer.city}</li>
<li className="App-list-style"><span className="App-customer-detail">State: </span> {this.state.selectedCustomer.state}</li>
<li className="App-list-style"><span className="App-customer-detail">Postal Code: </span> {this.state.selectedCustomer.postal_code}</li>
<li className="App-list-style"><span className="App-customer-detail">Phone: </span>Phone: {this.state.selectedCustomer.phone}</li>
<li className="App-list-style"><span className="App-customer-detail">Account Credit: </span> {this.state.selectedCustomer.account_credit}</li>
<li className="App-list-style"><span className="App-customer-detail">Movies Checked Out: </span> {this.state.selectedCustomer.movies_checked_out_count}</li>
</ul>
</div>) }

</div>


</div>
);
}
}
};



export default App;
Loading