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

GLASGOW6-IRIANNI_MUNOZ-FULL-STACK-ASSESMENT-LEVEL100 #328

Closed
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
6 changes: 6 additions & 0 deletions client/src/AddVideo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from "react";

function AddVideo() {
return <></>;
}
export default AddVideo;
5 changes: 5 additions & 0 deletions client/src/App.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.App {
text-align: center;
}

.card-container {
display: flex;
justify-content: center;
}
6 changes: 6 additions & 0 deletions client/src/App.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import "./App.css";
import AddVideo from "./AddVideo";
import VideoCards from "./VideoCards";
import SearchBar from "./SearchBar.js";

function App() {
return (
<div className="App">
<header className="App-header">
<h1>Video Recommendation</h1>
</header>
<AddVideo />
<VideoCards />
<SearchBar />
</div>
);
}
Expand Down
6 changes: 6 additions & 0 deletions client/src/SearchBar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from "react";

function SearchBar() {
return <></>;
}
export default SearchBar;
43 changes: 43 additions & 0 deletions client/src/SingleVideoCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React, { useState } from "react";

function SingleVideoCard({ title, url }) {
const [count, setCount] = useState(0);

function minusCount() {
setCount((prevCount) => prevCount - 1);
}

function plusCount() {
setCount((prevCount) => prevCount + 1);
}
if (!url) {
return <div>No video URL provided.</div>;
}

const videoId = url.split("v=")[1];
return (
<div className="card-container">
<div className="card">
<iframe
className="card-thumb"
width="320"
height="320"
src={`https://www.youtube.com/embed/${videoId}`}
title="YouTube video player"
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
></iframe>
<div className="card-body">
<button onClick={minusCount}>-</button>
<span>{count}</span>
<button onClick={plusCount}>+</button>
<h2>{title}</h2>
<p>Paragraph</p>
<button className="btn btn-primary">Delete</button>
</div>
</div>
</div>
);
}
export default SingleVideoCard;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice1

15 changes: 15 additions & 0 deletions client/src/VideoCards.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";
import SingleVideoCard from "./SingleVideoCard";
import exampleResponse from "./exampleResponse.json";

function VideoCards() {
return (
<>
{exampleResponse.map((video) => (
<SingleVideoCard key={video.id} title={video.title} url={video.url} />
))}
</>
);
}

export default VideoCards;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice Code

File renamed without changes.
14,710 changes: 7,355 additions & 7,355 deletions client/yarn.lock

Large diffs are not rendered by default.