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

Development Complete #1

Open
wants to merge 53 commits into
base: main
Choose a base branch
from
Open

Development Complete #1

wants to merge 53 commits into from

Conversation

AnkitaBagale
Copy link
Owner

No description provided.

Copy link

@supminn supminn left a 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 = {
Copy link

Choose a reason for hiding this comment

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

Kindly omit commented code.

Copy link
Owner Author

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"}
Copy link

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.

Copy link
Owner Author

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>
Copy link

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?

Copy link
Owner Author

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 />} />
Copy link

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

Copy link
Owner Author

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
Comment on lines 122 to 123
.btn-text-icon-secondary .btn-icon.padding-0{
padding: 0;
Copy link

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

Copy link
Owner Author

Choose a reason for hiding this comment

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

Done

<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>
Copy link

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?

Copy link
Owner Author

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.


.category-list{
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
Copy link

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);

Copy link
Owner Author

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.

@@ -0,0 +1,133 @@
import { getNoteDetails } from "../utils";
import { v4 as uuidv4 } from 'uuid';

Copy link

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)

Copy link
Owner Author

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

@@ -0,0 +1,129 @@
.video-container{
width: 100%;
height: 390px;
Copy link

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.

Copy link
Owner Author

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

}
.notes-section{
width: 30%;
height: 390px;
Copy link

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.

Copy link
Owner Author

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");

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);

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

Copy link
Owner Author

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
Comment on lines 90 to 91
<Route path="*" element={<ErrorPage />} />
<Route path="/error" element={<ErrorPage />} />

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.

Copy link
Owner Author

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.

Comment on lines 156 to 158
style={{
display: fieldErrors.usernameError ? "block" : "none"
}}

Choose a reason for hiding this comment

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

Avoid inline styling

Comment on lines 238 to 241
style={{
display: error !== "" ? "block" : "none",
color: "#ff9204"
}}

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);

Choose a reason for hiding this comment

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

Please remove console

Copy link
Owner Author

Choose a reason for hiding this comment

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

done

Comment on lines +7 to +9
<a href={toTop} className="btn btn-float-action" id="back-to-top">
<i className="fas fa-arrow-up"></i>
</a>

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

Copy link
Owner Author

@AnkitaBagale AnkitaBagale May 5, 2021

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.

Comment on lines 27 to 28
<li key={video._id} className="badge-container" style={{width:"100%"}}>
<Link className="link-no-style" to={`/explore/${video._id}`}>

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

Comment on lines 49 to 55
<form onSubmit={(e)=>{
e.preventDefault();
createNewPlaylist({dispatch, userId, video, title:playlistTitle, setPlaylistTitle})
setAddPlaylistInput(false);
setAddtoPlaylist(flag => !flag);

}}>

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

Copy link
Owner Author

Choose a reason for hiding this comment

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

done

Comment on lines 49 to 70
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
});

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

Copy link
Owner Author

Choose a reason for hiding this comment

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

Done

Comment on lines 77 to 83
if(noteState._id){
setEditMode(false);
}else{
noteDispatch({type:"SET_DESCRIPTION", payload:""});
noteDispatch({type:"SET_TITLE", payload:""})
}
}}

Choose a reason for hiding this comment

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

same here also

Copy link
Owner Author

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")

Choose a reason for hiding this comment

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

remove console please

Copy link
Owner Author

Choose a reason for hiding this comment

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

done

@sakshijainn
Copy link

image

the side bar watch later and history are not working
Also have some colorful content curation . All thumbnails are same.

@sakshijainn
Copy link

Very well structured code .
Just remove console in between the codes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants