-
Notifications
You must be signed in to change notification settings - Fork 0
Cleaned up review branch #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
base: master
Are you sure you want to change the base?
Conversation
| @@ -1,58 +0,0 @@ | |||
| # Photo Album sites. | |||
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.
Nice readme, some English mistakes, you could try to use some VS code extension for grammar.
| </p> | ||
| <p className="mb-1">Photo Web Album - Here you can collect yours photos. You can gropued by category, tags ...</p> | ||
| <p className="mb-0"> | ||
| Maid by Maciej using Bootstrap ver 5.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.
nice one ;). "Pokojówka Macieja korzystająca z Bootstrap w wersji 5.0"
| @@ -1,38 +0,0 @@ | |||
| .App { | |||
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.
Are styles defined in this file used?
| @@ -1,42 +0,0 @@ | |||
| import './App.css'; | |||
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 import needed?
| @@ -1,8 +0,0 @@ | |||
| import { render, screen } from '@testing-library/react'; | |||
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 think you can remove this file.
|
|
||
| <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous"> | ||
|
|
||
| <style> |
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.
Do we need this as inline style or can it also be placed in style.scss?
| border-width: 0px; | ||
| text-transform: lowercase; | ||
| } | ||
| } No newline at end of file |
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.
It's good practice to have newline at end o file, see: https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline#:~:text=If%20content%20is%20added%20to,to%20include%20a%20newline%20character.
Also you can add some linting extensions for your IDE to check JS and styles code for consistent formatting and simple things like newlines for example.
| background-color: $main-color; | ||
| color: #FFF; | ||
| font-size: 1rem; | ||
| border-radius: 50px; |
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.
Using more constants for default values of margin, padding, font-size etc. would be nice.
| import { Link } from "react-router-dom"; | ||
| import { timestamp } from './../firebase/config'; | ||
| import useComments from './../composables/useComments'; | ||
| // import getComments from './../composables/getComments'; |
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 unused code
|
|
||
| const Album = ({ title, description, imageUrl, createdAt, category, id }) => { | ||
|
|
||
| const timeSince = (date) => { |
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 to some utility file.
| const [comments, setComments] = useState([]); | ||
| const [comment, setComment] = useState([]); | ||
| const { error, addComment } = useComments('comments', id); | ||
| // const { comments } = getComments('comments', 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.
remove unused
MLewiDev
left a comment
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 Good:
- Good cohesive chunks of code
- Good structure of application
- Simple and easy to understand components
- Properly extracted reusable parts
- Good use of html and styling
Things to Improve:
- More structure in styles
- Some grammar issues, check if some extension could help you a little bit with that
- Some linting could be improved for more consistency across files
Remarks:
- Didn't check firebase related API calls
- Testing isn't considered as scope of this task
- I found some areas of app that could be improved like for example "enter on comment input works as reload of page", but they are considered as further improvements and not bugs.
Conclusion
Very nice code for a first attempt in React. It's readable and maintainable, properly structured with clean HTML. Only some minor things to improve from my side.
| return Math.floor(interval) + " minutes ago"; | ||
| } | ||
|
|
||
| if (seconds === 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.
You can use here <= 0 as I saw a bug that in the beginning the time starts at minus values.
| } | ||
| </datalist> | ||
| </div> | ||
| {/* <input className="form-control me-2 search-bar" type="search" placeholder="Search" aria-label="Search" onChange={searchAlbum} /> */} |
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 unused
| ); | ||
| } | ||
|
|
||
| export default Hero; No newline at end of file |
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.
newline
| <div className="row"> | ||
| <div className="col-lg-6 col-md-8 mx-auto"> | ||
| <h1 className="fw-light">Photo Album</h1> | ||
| <p className="lead text-muted">Here you can collect yours photos. You can gropued by category, tags ... </p> |
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.
...your photos....grouped....
| } | ||
|
|
||
| return ( | ||
|
|
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.
Why do you have sometimes whitelines here and sometimes not?
| const [error, setError] = useState(null); | ||
|
|
||
| const uploadImage = async (file) => { | ||
| let filePath = `images/${file.name}`; |
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.
const
| @@ -1,29 +0,0 @@ | |||
| import { projectFirestore } from '../firebase/config' | |||
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.
why is it getComments and not useComments?
| @@ -1,38 +0,0 @@ | |||
| import { projectFirestore } from '../firebase/config' | |||
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.
why getCollection no useCollection?
| setFileError(null); | ||
| } else { | ||
| setFile(null); | ||
| setFileError('Wron type of file.'); |
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.
Wrong
| <h2>Create New Album</h2> | ||
| <form onSubmit={handleSubmit} className="php-email-form"> | ||
| <div className="form-group mt-3"> | ||
| <input |
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 add some guidance which ones are required
Pull request for review purposes.