Skip to content

Conversation

@MLewiDev
Copy link
Owner

Pull request for review purposes.

@MLewiDev MLewiDev marked this pull request as draft February 12, 2021 14:19
@@ -1,58 +0,0 @@
# Photo Album sites.
Copy link
Owner Author

@MLewiDev MLewiDev Feb 12, 2021

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 &nbsp; &nbsp;
Copy link
Owner Author

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 {
Copy link
Owner Author

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';
Copy link
Owner Author

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';
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 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>
Copy link
Owner Author

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

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;
Copy link
Owner Author

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';
Copy link
Owner Author

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) => {
Copy link
Owner Author

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);
Copy link
Owner Author

Choose a reason for hiding this comment

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

remove unused

Copy link
Owner Author

@MLewiDev MLewiDev left a 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) {
Copy link
Owner Author

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

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

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

Choose a reason for hiding this comment

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

...your photos....grouped....

}

return (

Copy link
Owner Author

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}`;
Copy link
Owner Author

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'
Copy link
Owner Author

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'
Copy link
Owner Author

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.');
Copy link
Owner Author

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

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

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.

2 participants