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

MGC-JUL-24 | PRISCILLA MAC-GATUS|TASK-TRACKER|WEEK1 #3

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

Conversation

Priscilla-MacGatus
Copy link

[X ] I have committed my files one by one, on purpose, and for a reason
[X ] I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
[X ] I have tested my changes
[X ] My changes follow the style guide
[X ] My changes meet the requirements of this task

Copy link
Collaborator

@aniolg aniolg left a comment

Choose a reason for hiding this comment

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

Hey @Priscilla-MacGatus 👋,

Thanks for submitting your PR! Looks really well, and you demonstrated that you can start to create React projects.

Some general tips:

Delete the comments: Try to have a clean code without parts commented when you do a commit. Only keep it when you need to describe something that is not implicit in the code.

Please use descriptive commit messages, so it's clear what you did in the commit.
We can discuss these points in the next class!

Keep going strong 👍

{props.TaskListInfo.map((listItem, index) => {
return (
<TaskItem
key={index}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would recommend that you not use only the index as key when you are rendering a list on React because if in the future you will edit that list, you can create confusing errors.

ℹ️ You can find deeply explanation on the Rendering List article of Rect documentation

✨ Tip: In an ideal scenario, in the data of your item, you will have a unique id/sku/... that you can use as a key. If this is not your case, you can concatenate the index with a probably unique value of your data (like the name), like the below example:

Suggested change
key={index}
key={`${listItem.ProjectTask}-${index}`}

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for the feedback and insight on why indexing might not ALWAYS be the best way.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could be better to add .vscode/ directory to .gitignore file on this repository, to not expose your VS Code configuration.

Copy link
Author

Choose a reason for hiding this comment

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

Could you please explain further?

Copy link
Collaborator

Choose a reason for hiding this comment

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

.vscode/ is a directory created by the VS Code application to store configurations. In that case, is keeping the settings at repository level. So in general, it's something you would rather not include in your public repository.

And .gitignore is a file located in the root of the repo, where you can specify which files or directories want to be ignored by git when you do your commits.

So my point is that you should include the .vscode/ directory to the .gitignore file for avoid have .vscode/ directory in your public repository.

💡 You can find how to do it in the GitHub documentation.

However, don't worry about it. We can review it in the next class.

};

return (
<div className={styles.mainContainer}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that you don't need this div. It is what we call a boilerplate: It is repeated, and it lacks any porpoise.
So for better reading and clean code, it is better to remove it.

<div className={styles.mainContainer}>
<div className={styles.container}>
<h4 className={styles.Task}>{props.ProjectTask}</h4>
<button className={colorState()}>{props.ProjectStatus}</button>
Copy link
Collaborator

Choose a reason for hiding this comment

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

The status element it is a text badge and is not interactive, so could be better to be replaced by a div or span tag.

Suggested change
<button className={colorState()}>{props.ProjectStatus}</button>
<div className={colorState()}>{props.ProjectStatus}</div>

</div>
<div className={styles.participantBox}>
<img
src="https://www.svgrepo.com/show/502898/user-group.svg"
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can directly use icons inline. As it's always the same icon we expect here, you do not need to pass it as a prop.

You can easily use icons this way:

const MyIcon = () => (...);

This creates a React component that returns your Icon that you can use instead of . You can easily get the SVG for your icons from Figma (right-click on the Icon and select Copy/Paste as > Copy as SVG).

💡 It's recommended to use SVGO or similar tools to minify the SVG and keep it as small as possible.

@Priscilla-MacGatus
Copy link
Author

Thank you for your feedback.Let me go through it quickly and make the changes.

@Priscilla-MacGatus
Copy link
Author

I have made the changes and updated it

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