-
Notifications
You must be signed in to change notification settings - Fork 1
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
Development Complete #1
base: main
Are you sure you want to change the base?
Conversation
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.
Hi @AnkitaBagale
Commendable work on this project! It's great to see that the code is broken down into smaller components and re-used very aptly.
I could find a few consistency issues in the naming conventions.
src/database.js
Outdated
@@ -0,0 +1,592 @@ | |||
export const types = ["All","Pencil Sketching", "Charcoal Painting", "Painting", "Drawing"] | |||
// export const videosByTypes = { |
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.
Kindly omit commented code.
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.
Done
src/database.js
Outdated
level:"Beginner", | ||
language: "English", | ||
thumbnail:"https://i.postimg.cc/TwsBcV04/jess-bailey-l3-N9-Q27z-ULw-unsplash.jpg", | ||
tutor: {id:1, name: "SchaeferArt", avatar: "https://i.postimg.cc/fRf3jmN7/post-icon.png"} |
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.
this structure looks good for now. Nevertheless, when the data increases - say you have more than 3 tutors for the same video, following this structure could be difficult.
Instead, you can make "tutor" and array of tutor ids. Then a separate database could be created for all the tutor details.
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.
Yes, that's a great idea, I did not think of it. I will refactor it when doing the backend.
src/App.js
Outdated
<div className="App"> | ||
<h1>U&I Video Library</h1> | ||
</div> | ||
<Router> |
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 there a specific reason to mention Routers here instead of using it on index.js?
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.
Oh! thanks for pointing it, I will move it to index.js file
src/App.js
Outdated
|
||
<Route path="/playlists" element={<AllPlaylistContent />} /> | ||
<Route path="/playlists/:playlistId" element={<PlaylistMainContent />} /> | ||
<Route path="/saved" element={<WatchLater />} /> |
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.
The path could be renamed to watchLater to keep it consistent
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.
Done
src/App.css
Outdated
.btn-text-icon-secondary .btn-icon.padding-0{ | ||
padding: 0; |
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.
this could be combined in line 113
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.
Done
src/Listing-pages/Watch-later.js
Outdated
<div className="padding-left-1rem padding-right-1rem"> | ||
<img className="img-responsive" src="https://i.postimg.cc/TwsBcV04/jess-bailey-l3-N9-Q27z-ULw-unsplash.jpg" alt="watchLater" /> | ||
<div className="text-container"> | ||
<h2 className="h4 padding-top-1rem">Saved Videos</h2> |
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.
When h4 is used within the className, the tag could also be replaced to h4 instead of h2 right?
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.
Title of the page should be h1 and then sub heading of the page should be h2, for semantics, I am not sure, I will check this and let you know.
src/Listing-pages/explore.css
Outdated
|
||
.category-list{ | ||
display: grid; | ||
grid-template-columns: 1fr 1fr 1fr 1fr; |
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.
could be simplified as: grid-template-columns: repeat(4, 1fr);
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.
Yeah, i will use this.
src/Video-detail/notes-container.js
Outdated
@@ -0,0 +1,133 @@ | |||
import { getNoteDetails } from "../utils"; | |||
import { v4 as uuidv4 } from 'uuid'; | |||
|
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.
Contents of this file could be simplified by refactoring the components as new files. (since this file is named as notes-container, i was expecting only container details. However, this has all the implementation w.r.t notes)
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.
Yeah i will create separate folder for notes and create files for each component related to notes
src/Video-detail/video-detail.css
Outdated
@@ -0,0 +1,129 @@ | |||
.video-container{ | |||
width: 100%; | |||
height: 390px; |
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.
Avoid using px, instead rem is suggested to be used.
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.
Done, updated all px values to rem
src/Video-detail/video-detail.css
Outdated
} | ||
.notes-section{ | ||
width: 30%; | ||
height: 390px; |
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.
same here, to make it consistent with all the other properties, you could use rem instead of px.
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.
Done
src/App.js
Outdated
|
||
(async()=>{ | ||
try { | ||
const { data: {response} } = await axios.get("https://uandistoreapi.herokuapp.com/videos"); |
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.
Put URL of backend in some config file and then use it. Code looks more clean
src/App.js
Outdated
const { data: {response} } = await axios.get("https://uandistoreapi.herokuapp.com/videos"); | ||
dispatch({type: "SET_VIDEOS", payload: response}) | ||
} catch(error) { | ||
console.log(error); |
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.
Remove console. You can use toast.error here
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.
Done
src/App.js
Outdated
<Route path="*" element={<ErrorPage />} /> | ||
<Route path="/error" element={<ErrorPage />} /> |
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 am not sure of this but I think /error route is not required if element is rendered for all except those which are defined.
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 navigate pages to error page if video URL is broken, hence need this route.
style={{ | ||
display: fieldErrors.usernameError ? "block" : "none" | ||
}} |
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.
Avoid inline styling
style={{ | ||
display: error !== "" ? "block" : "none", | ||
color: "#ff9204" | ||
}} |
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.
please remove inline styling
setUserDetails(response); | ||
} | ||
} catch (error) { | ||
console.log(error); |
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.
Please remove console
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.
done
<a href={toTop} className="btn btn-float-action" id="back-to-top"> | ||
<i className="fas fa-arrow-up"></i> | ||
</a> |
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.
Avoid using tag, you can use Link tag here
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.
This is vanilla js way to go to top. I will check if there is any other react way to go to top of the page.
<li key={video._id} className="badge-container" style={{width:"100%"}}> | ||
<Link className="link-no-style" to={`/explore/${video._id}`}> |
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.
inline styling, please remove this
<form onSubmit={(e)=>{ | ||
e.preventDefault(); | ||
createNewPlaylist({dispatch, userId, video, title:playlistTitle, setPlaylistTitle}) | ||
setAddPlaylistInput(false); | ||
setAddtoPlaylist(flag => !flag); | ||
|
||
}}> |
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.
extract onSubmit has a separate function for code to look much cleaner
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.
done
if(noteState._id) { | ||
UpdateNoteForVideo({ | ||
noteId: noteState._id, | ||
setNotes, | ||
noteUpdates: { | ||
title: noteState.title, | ||
description: noteState.description | ||
}, | ||
setEditMode | ||
}); | ||
} else { | ||
CreateNoteForVideo({ | ||
setNotes, | ||
newVideo: { | ||
userId, | ||
videoId, | ||
title: noteState.title, | ||
description: noteState.description, | ||
time: playerRef.current.getCurrentTime() | ||
}, | ||
noteDispatch | ||
}); |
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.
extract this functionality into a function outside return please
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.
Done
if(noteState._id){ | ||
setEditMode(false); | ||
}else{ | ||
noteDispatch({type:"SET_DESCRIPTION", payload:""}); | ||
noteDispatch({type:"SET_TITLE", payload:""}) | ||
} | ||
}} |
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.
same here also
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.
Done
return {...state, description: payload} | ||
} | ||
default : { | ||
console.log("this case is not handled with reducer") |
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.
remove console please
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.
done
Very well structured code . |
fix: small UI issues
Ankita fix nitpicks
fix: footer color
No description provided.