Skip to content

add task solution#4492

Open
142536Def wants to merge 4 commits into
mate-academy:masterfrom
142536Def:develop
Open

add task solution#4492
142536Def wants to merge 4 commits into
mate-academy:masterfrom
142536Def:develop

Conversation

@142536Def

Copy link
Copy Markdown

React Decompose

Split the App.js into components based on CSS blocks. CSS code should be split too.

  • You already have Article, Header and Welcome folders inside ./src/components/ with required files.
  • You may also create a folder for the Navigation component and move navigation there.
  • Tests expect you to use export default for all the components.

Instructions

  • Install Prettier Extention and use this VSCode settings to enable format on save.
  • Implement a solution following the React task guideline
  • Open one more terminal and run tests with npm test to ensure your solutions is correct
  • Replace <142536Def> with your Github username in the DEMO LINK and add it to the PR description

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

I am requesting changes because there are still critical structural and styling issues that conflict with the explicit requirements of the task. The main blocker is that the Navigation component (Navigation.jsx and Navigation.css) is placed inside src/components/Article/ instead of having its own dedicated Navigation folder, which violates the separate-folder-per-component rule [CHECKLIST ITEM #2] and the task’s hint about creating a folder for Navigation. To fix this, move Navigation.jsx and Navigation.css into something like src/components/Navigation/Navigation.jsx and src/components/Navigation/Navigation.css, and update all imports (for example in Header.jsx and App.jsx) to point to the new path.

There is also a functional styling issue: in Navigation.jsx the root nav element uses className="article-navigation", but Navigation.css defines styles for .navigation and .navigation__link. Because these do not match, the container styles (flex layout, spacing) are never applied; align the JSX className with the CSS selector (for example, change it to className="navigation") or update the CSS selector to .article-navigation. Once you correct the Navigation folder structure and the className/CSS mismatch and ensure the files are properly committed, your solution will align well with the task requirements. You already did a good job splitting App into Header, Welcome, and Article with separate CSS and default exports, so you are close—these changes will complete the implementation.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/App.jsx
import React from 'react';
import './App.css';
// Move each BEM block to a separate component (file) and import them here
import Header from './components/Header/Header';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #2: "create separate folder per component, where you could put all files(styles, components, and so on)". Navigation.css is stored under the Article folder instead of in a dedicated Navigation component folder, so consider moving it to something like src/components/Navigation/Navigation.css.

Comment thread src/App.jsx
import React from 'react';
import './App.css';
// Move each BEM block to a separate component (file) and import them here
import Header from './components/Header/Header';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The root nav element uses className "article-navigation", but your CSS defines styles for .navigation (and .navigation__link). Because the class names don’t match, the container styles won’t be applied. Align the className with the defined CSS class to ensure the navigation styling works correctly.

@@ -1 +1,26 @@
/* Put article styles here */
.article{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #2: create separate folder per component, where you could put all files(styles, components, and so on). Here Navigation.css is placed inside src/components/Article/, meaning the Navigation component does not have its own separate folder as recommended by the task description ("You may also create a folder for the Navigation component and move navigation there") and checklist.

Comment on lines +1 to +13
import './Article.css';

// Create an Article function returning the HTML of article block
function Article() {
return (
<article className="article">
<h2 className="article__title">Headline</h2>
<p className="article__paragraph">First paragraph text here.</p>
<p className="article__paragraph">Second paragraph text here.</p>
<p className="article__paragraph">Third paragraph text here.</p>
<p className="article__paragraph">Fourth paragraph text here.</p>
<p className="article__paragraph">Fifth paragraph text here.</p>
</article>
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #2: create separate folder per component, where you could put all files(styles, components, and so on). Navigation.css is inside the Article component folder, but Navigation should be in its own Navigation folder as a separate component.

@@ -1,5 +1,16 @@
// import a css file containig article styles
import './Article.css';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The Navigation component is inside the Article folder, which conflicts with the requirement to have a separate folder per component (checklist item #2). Consider moving this file to src/components/Navigation/Navigation.jsx and adjusting imports accordingly.

@@ -1 +1,16 @@
/* Put header styles here */
.header {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This import path reflects that Navigation is inside the Article folder. Per checklist item #2 (separate folder per component), Navigation should live in its own folder (e.g. ../Navigation/Navigation), so once you move the component you’ll need to update this import.

// import a css file containig header styles
import Navigation from '../Article/Navigation';
import './Header.css';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #2: create separate folder per component, where you could put all files(styles, components, and so on). Navigation.jsx is inside the Article folder instead of having its own dedicated Navigation folder; consider moving it to src/components/Navigation/Navigation.jsx (and updating imports).


// Create a Header function returning the HTML of header block
function Header() {
return (

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The nav element uses className="article-navigation", but Navigation.css defines .navigation and not .article-navigation. Because the class names don’t match, the navigation container styles won’t be applied; align the className with the CSS selector so styling works correctly.

Comment on lines +1 to +3
.welcome{
padding: 20px;
text-align: center;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #2: create separate folder per component, where you could put all files(styles, components, and so on). Navigation.jsx is currently inside the Article folder instead of having its own Navigation component folder, so it doesn’t follow the separate-folder-per-component requirement.

padding: 20px;
text-align: center;
background-color: rgb(255, 127, 80);
border-radius: 8px;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The nav element uses className="article-navigation", but your CSS defines .navigation and not .article-navigation. This mismatch means the container styles won’t be applied; update the className (or CSS selector) so they match.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

I am requesting changes because there is still a critical styling mismatch in the Navigation component that blocks the task from being fully correct. Across multiple places (src/components/Navigation/Navigation.jsx, and where it’s used in Header.jsx, Article.jsx, and Welcome.jsx), the root nav uses className="article-navigation", but Navigation.css defines the container styles under the .navigation selector, so the flex layout and gap are never applied to the actual element. This directly violates the requirement that components be split and correctly wired to their corresponding CSS blocks and breaks the intended navigation layout.

Critical issues to fix:

  • Align the JSX class name with the CSS selector for the navigation container. For example, in Navigation.jsx change the root nav to className="navigation", and in any other file where you render that navigation container, also use className="navigation" so it matches the .navigation rule in Navigation.css. Alternatively, update the CSS to use .article-navigation everywhere instead of .navigation—the key point is that the class in JSX and the selector in CSS must be identical.
  • [CHECKLIST ITEM #3] Locally run git status and make sure all relevant files (especially the src/components/Navigation/ folder and its .jsx/.css files) are added and committed, since this can’t be verified from here.

Structurally your decomposition into Header, Welcome, Article, and Navigation with separate folders and default exports looks good, so once you fix the navigation className/CSS mismatch and confirm all files are tracked in git, your solution should meet the task requirements. Keep up the solid work—this is a small but important wiring detail to get right.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/App.jsx
</p>
</article>
</main>
<div className="app">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There is still a functional styling mismatch with the Navigation component from the previous review context: Navigation.jsx uses className="article-navigation", but Navigation.css defines .navigation for the container. This means the navigation layout styles won’t apply. You should align the className and CSS selector (for example, use className="navigation" in JSX to match .navigation in CSS) to satisfy the task requirement that styles are correctly connected.

@@ -1 +1,26 @@
/* Put article styles here */
.article{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The nav element uses className="article-navigation", but your Navigation.css defines styles for .navigation. Because these don’t match, the flex layout and gap styles won’t be applied. This conflicts with the task requirement to properly style the decomposed Navigation component. Consider changing this to className="navigation" or updating the CSS selector to .article-navigation so they are consistent.

display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The Navigation container uses className="article-navigation", but Navigation.css only defines .navigation and .navigation__link, so the flex styles won’t apply. This conflicts with the requirement to keep JSX classNames aligned with CSS blocks; consider either changing this to className="navigation" or updating the CSS selector to .article-navigation.


// Create a Header function returning the HTML of header block
function Header() {
return (

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The nav element uses className="article-navigation", but your CSS defines the container styles under .navigation. Because the class name and selector differ, the flex layout and gap for the navigation container won’t be applied. To align JSX with the CSS block and satisfy the task requirements, change this to className="navigation" (or update the CSS selector to .article-navigation).

display: flex;
gap: 20px;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The root nav uses className="article-navigation", but Navigation.css defines the container styles on .navigation. Because these selectors don’t match, the flex layout and gap will never be applied to the navigation. This violates the task’s requirement to correctly wire CSS blocks to components. Consider changing this to className="navigation" or updating the CSS selector to .article-navigation so they match.


function Navigation() {
return (
<nav className="article-navigation">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The nav element uses className="article-navigation", but your CSS defines styles for .navigation. Because these don’t match, the flex layout and gap styles won’t apply to the navigation container. To meet the task’s styling requirements, align the className and CSS selector (e.g., use className="navigation" to match .navigation).

padding: 20px;
text-align: center;
background-color: rgb(255, 127, 80);
border-radius: 8px;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The root nav element uses className="article-navigation", but your CSS defines the container styles for .navigation. Because these selectors don’t match, the flex layout and gap styling will not apply to the navigation. This violates the requirement to keep JSX classNames aligned with CSS blocks. Consider changing this to className="navigation" (to match .navigation) or updating the CSS selector to .article-navigation.

// Create a Welcome function returning the HTML of welcome block
function Welcome() {
return (
<section className="welcome">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In the Navigation component, the root nav element still uses className="article-navigation" while Navigation.css defines the container styles on .navigation. This mismatch prevents the flex layout and gap from applying, so the component is not correctly styled according to its CSS block. To comply with the task requirements, update either the JSX to className="navigation" or the CSS selector to .article-navigation.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your solution is approved as-is. This is an educational override to help you progress while you continue refining your project structure.

You’ve done a solid job decomposing the app into Header, Welcome, Article, and Navigation components, each with its own CSS file and matching class names, and using export default consistently. The main remaining issue is project structure: App.jsx is still located directly under src/ instead of in its own component folder (e.g., src/components/App/App.jsx), which means [CHECKLIST ITEM #2] (“create separate folder per component”) isn’t fully met. To fix this, create an App folder under src/components/, move App.jsx there, and then update any imports that reference App so they point to the new path.

Overall, your component wiring and styling are on the right track—keep going, and use this approval as a chance to apply the structural improvement and strengthen your understanding of project organization.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

@@ -1 +1,26 @@
/* Put article styles here */
.article{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #2: "[PROJECT STRUCTURE] - create separate folder per component, where you could put all files(styles, components, and so on)". App.jsx is placed directly under src/ instead of inside its own component folder (e.g., src/components/App/App.jsx), so the project structure is not fully aligned with the requirement.

@@ -1,5 +1,16 @@
// import a css file containig article styles
import './Article.css';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #2: create separate folder per component, where you could put all files(styles, components, and so on). App.jsx is currently at the root of src/ rather than inside its own App folder, unlike your other components.

@@ -1,5 +1,13 @@
// import a css file containig header styles
import Navigation from '../Navigation/Navigation';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This still violates checklist item #2: "[PROJECT STRUCTURE] - create separate folder per component, where you could put all files(styles, components, and so on)". App.jsx is not in a dedicated component folder like Header, Article, Welcome, and Navigation; consider moving it into something like src/components/App/App.jsx and updating imports.

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