Skip to content

Oleksandr Starshynov w1 React #2

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

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

Conversation

aleksandrstarshynov
Copy link

@aleksandrstarshynov aleksandrstarshynov commented Jun 16, 2025

  • A product list that displays all of the products in the all-products file. Note: the site is responsive, so have a look at the breakpoints in the deployed example project.
  • A category list that displays all of the categories in the all-categories file at the top of the page
  • If the user clicks on a category only the products that have that category in their category property should be displayed on the screen. Note: The categories listed in the product objects do not match up exactly with the categories in the categories list. You will have to find a solution to this without editing the files
  • There should only be 1 category active at a time and the user should see which category is selected.
  • You need to deploy your app somewhere (using something like netlify) and put the link in your PR!

Comment on lines +4 to +18
border: 1px solid #ccc;
background-color: white !important;
color: #333;
border-radius: 6px !important;
cursor: pointer;
transition: all 0.2s ease-in-out;
}

.category-button:hover {
background-color: #f5f5f5;
}

.category-button.active {
background-color: #0077cc !important;
color: white;

Choose a reason for hiding this comment

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

Try to avoid using !important in your CSS.
(It may make styles harder to override and maintain)

Choose a reason for hiding this comment

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

File Name:

  1. The composite folder naming isn’t a common convention in most React projects. In this case, you can simplify the structure by moving them directly into components/
  2. Folder names like components and pages, it’s common practice to use all lowercase. Only component files themselves should use PascalCase (e.g., Button.jsx) to clearly distinguish them as React components.

Choose a reason for hiding this comment

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

2025-06-16 10_14_41-HYF - React week1 - YouTube
I would say that this is a little sueprise for me. I am showing here the scrinshot from our session. So, I guess that I am doing the correct structure of components.
Does it mean that I have to re-do the whole structure?

Choose a reason for hiding this comment

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

From what I understand, the screenshot composite folder is still under the main components directory, so technically it's still part of the components.

Besides, this is more about coding style, and there’s no strict right or wrong. Since this is your project, it’s totally fine as long as the structure makes sense to you. I’m just sharing my perspective based on common practices.

Out of curiosity: how do you distinguish between components and composite?

Choose a reason for hiding this comment

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

It seems to me that the structure proposed in the lecture is logical, so I don't have any difficulties. Components are repeating or not elements of the interface, they have no logic, only structure and styles. For example, these will be buttons, inputs, and so on. Components are combined components, logic is added and values ​​are transferred. This is already a functional group of buttons or a product card. Does this make sense to you?

Comment on lines +9 to +17

/* .product-card img {
max-height: 250px;
width: 100%;
object-fit: contain;
display: block;
margin: 0 auto;
} */

Choose a reason for hiding this comment

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

Is there any reason you want to keep it?

@@ -0,0 +1,13 @@
import React from "react";

Choose a reason for hiding this comment

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

Since React 17 and newer versions with the new JSX transform, explicitly importing React in every file is no longer necessary.

Suggested change
import React from "react";

@ChingHsun
Copy link

The code is clear and well-structured!
However, I didn’t see a link to the deployed project.

@ChingHsun ChingHsun self-assigned this Jun 29, 2025
@aleksandrstarshynov
Copy link
Author

The code is clear and well-structured!
However, I didn’t see a link to the deployed project.

Hi @ChingHsun it was in ReadMe
f871e5a

@ChingHsun
Copy link

The code is clear and well-structured!
However, I didn’t see a link to the deployed project.

Hi @ChingHsun it was in ReadMe f871e5a

Oh sorry I didn't see! Your project works well and meets all requirements! I will approved

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

Successfully merging this pull request may close these issues.

2 participants