-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Glasgow 06 - Malkit Benning - Full Stack Project Assessment - Level 300 complete #338
Conversation
added lighthouse results as saved html file
client/src/MovieCard.js
Outdated
@@ -0,0 +1,70 @@ | |||
import React from "react"; | |||
import "./MovieCard.css"; | |||
function MovieCard(props) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could deconstruct your props in side as in function MovieCard({ movie, setRefreshVideos})
for the key, technically you are passing in movie
therefore inside that you've got movie.id
.
give it a try and let's see.
client/src/MovieCard.js
Outdated
import "./MovieCard.css"; | ||
function MovieCard(props) { | ||
const fetchAddress = "https://full-stack-server-fofh.onrender.com/"; | ||
const movieName = props.movie.url.split("watch?v=")[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then any props you simply used directly, therefore remove all props
from props.movie.url
into movie.url
client/src/MovieCard.js
Outdated
} | ||
|
||
function upVote() { | ||
let newVote = props.movie.rating + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd change this to const. same as downVote
import React, { useState } from "react"; | ||
import "./NewVideoContainer.css"; | ||
|
||
function NewVideoContainer({ allMovies, setRefreshVideos }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well done
client/src/NewVideoContainer.js
Outdated
const [newTitle, setNewTitle] = useState(""); | ||
const [newURL, setNewURL] = useState(""); | ||
function addNewVideo() { | ||
console.log("button clicked"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed here ? usually don't leave console.logs as they can cause security vulnerabilities.
let newRating = 0; | ||
|
||
client | ||
.query("INSERT INTO videos (id, title, url, rating) VALUES ($1, $2, $3, $4)", [newId, newTitle, newUrl, newRating]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really nice
React app deployed on netlify, server and database on Render. All working - rating updates, adding new videos and deleting from database via calls from netlify app then server.
Added both client and server code into one branch too allow me to run both locally and edit files at the same time.
Code now includes sql calls and also use of env variables so no passwords or database details are accidentally leaked.