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

Ren + Blaine = Fire #28

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
18ccc5e
npm install
Blaine206 Jan 20, 2021
1165784
npm install
Blaine206 Jan 20, 2021
2df0266
attempts to display customer list
Blaine206 Jan 20, 2021
a97b19f
fixes customers component to display a list of customer names
Jan 20, 2021
2220a63
updates commenting
Jan 20, 2021
ef1c37a
adds basic video list to app display
Jan 20, 2021
5f1403b
Merge pull request #1 from RenCarothers/display-customers
RenCarothers Jan 20, 2021
6c9129b
add search form, consol logging search retruns
Blaine206 Jan 20, 2021
0354328
Merge pull request #2 from RenCarothers/search-vids
Blaine206 Jan 20, 2021
25894f4
updated BASE_URLs
Blaine206 Jan 21, 2021
25b70ac
Merge branch 'master' of https://github.com/RenCarothers/video-store-…
Blaine206 Jan 21, 2021
fe809ee
Merge pull request #3 from RenCarothers/search-vids
Blaine206 Jan 21, 2021
7e5a61b
Merge branch 'master' of https://github.com/RenCarothers/video-store-…
Blaine206 Jan 21, 2021
bcfb6eb
renders basic search results on search query submission
Jan 21, 2021
56758ec
partially begins addVideo function from searchResults
Jan 21, 2021
78aad5a
comments out broken bits for now
Jan 21, 2021
eabaaaa
installs router
Jan 21, 2021
1e7a65c
installs bootstrap
Jan 21, 2021
8bcd6f9
prepares nav links via router
Jan 21, 2021
75b46be
updates customer and video generation to incl all props
Jan 21, 2021
74abb45
Merge branch 'router' of https://github.com/RenCarothers/video-store-…
Blaine206 Jan 21, 2021
5181605
adds back in search bar
Jan 21, 2021
817b339
Merge branch 'router' of https://github.com/RenCarothers/video-store-…
Blaine206 Jan 21, 2021
0664871
adds header bg, search page in nav
Jan 21, 2021
d4c979e
tweaks search results display
Jan 21, 2021
d17da10
adds tables to video, customer and searchresult components
Jan 21, 2021
806e61f
adds buttons to video, customer and searchresult tables..not implemen…
Jan 21, 2021
f531d0e
adds homepage component
Jan 21, 2021
8a52fda
moves search into a component
Jan 21, 2021
4d98bb4
Merge pull request #4 from RenCarothers/display-tweaks
RenCarothers Jan 21, 2021
da49d96
small uniform changes
Blaine206 Jan 21, 2021
b9ad7a2
Merge branch 'master' into create-add
Blaine206 Jan 21, 2021
784a065
Merge pull request #5 from RenCarothers/create-add
Blaine206 Jan 21, 2021
db57ab0
updated home poster names
Blaine206 Jan 21, 2021
548d5ec
setting up selected customer state and passing through props
Blaine206 Jan 21, 2021
1f2329d
select video function, refactoring-cleanup
Blaine206 Jan 21, 2021
64dc718
Merge pull request #6 from RenCarothers/add-and-select
Blaine206 Jan 21, 2021
c4ec9c7
WIP checkout function, date hates us
Blaine206 Jan 22, 2021
4416f47
Merge pull request #7 from RenCarothers/checkout
Blaine206 Jan 22, 2021
9a210e9
corrects checkout post request
Jan 22, 2021
77ad6b5
adds checkout message
Jan 22, 2021
af9d1a4
disables button after add video
Jan 22, 2021
7a1c37a
resizes posters and adds overviews
Jan 22, 2021
6f60194
Merge pull request #8 from RenCarothers/last-touches
RenCarothers Jan 22, 2021
5a40336
imported and created proptypes, styling edits, clear state after chec…
Blaine206 Jan 22, 2021
32330ad
Merge pull request #9 from RenCarothers/proptypes
Blaine206 Jan 22, 2021
b605ae7
Some last min arranging and table updates
Blaine206 Jan 22, 2021
c9a352e
Merge pull request #10 from RenCarothers/tiny-tweaks
Blaine206 Jan 22, 2021
15aafbb
moves checkout into nav header instead of awkward floating box
Jan 22, 2021
5406f2f
Merge branch 'master' into redo-nav
RenCarothers Jan 22, 2021
5f6813d
Merge pull request #11 from RenCarothers/redo-nav
RenCarothers Jan 22, 2021
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
Prev Previous commit
Next Next commit
adds basic video list to app display
Ren Carothers committed Jan 20, 2021
commit ef1c37ad2a58dce573e6473e977263b2a23cb0c6
6 changes: 4 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import CustomerList from './components/Customers';
import Customers from './components/Customers';
import Videos from './components/Videos';

class App extends Component {
render() {
@@ -14,7 +15,8 @@ class App extends Component {
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
< CustomerList />
<Customers />
<Videos />
</div>
);
}
15 changes: 15 additions & 0 deletions src/components/Video.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const Video = (props) => {
return (
<div>
<h1>{props.title}</h1>
</div>
)
}

Video.propTypes = {
// DONT FORGET TO FILL ME OUT!
// addCardCallback: PropTypes.func.isRequired
};


export default Video;
62 changes: 62 additions & 0 deletions src/components/Videos.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React, { useEffect, useState } from 'react';
import axios from 'axios';
import Video from './Video';

// import logo from './logo.svg';
// import './App.css';

const Videos = () => {

const [videoList, setVideosList] = useState([]);
const [errorMessage, setErrorMessage] = useState(null);

const VIDEO_URL = 'http://localhost:3000/videos'

useEffect(() => {
axios.get(VIDEO_URL)
.then((response) => {
// console.log(response.data);
const railsVideoList = response.data;
// console.log(apiCustomerResponse[0].name)
// Set the state
setVideosList(railsVideoList);
})
.catch((error) => {
setErrorMessage(error.message);
console.log(error.message);
});
}, []);

const generateVideos = (videos) => {
let videoComponentArray = [];

for (const video of videos)

{
videoComponentArray.push(
<Video
key={video.id}
id={video.id}
title={video.title}
/>
)
}

return videoComponentArray;
};

return (
<div>
Video List
{generateVideos(videoList)}
</div>
);
}

Videos.propTypes = {
// DONT FORGET TO FILL ME OUT!
// addCardCallback: PropTypes.func.isRequired
};


export default Videos;