-
Notifications
You must be signed in to change notification settings - Fork 3.9k
React_decomp_task #4269
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?
React_decomp_task #4269
Conversation
mateacademy-ai-mentor
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.
Review Summary
I am requesting changes because a few core requirements of the task are not yet met and they affect the expected structure and behavior of the app.
Critical issues that must be fixed:
- In
src/App.jsx, the welcome markup is still inline and not using theWelcomecomponent. The task explicitly requires splittingAppinto components by BEM blocks and moving the welcome block intosrc/components/Welcome/Welcome.jsx, so you should importWelcomewith a default import and render<Welcome />instead of the inline JSX, and move the related.welcomestyles fromApp.cssintoWelcome.css. - In
src/components/Navigation/Navigation.jsx, the component is only exported as a named export; tests require all components to use default exports. Add a default export (e.g.,export default Navigation;) and update imports (like inHeader.jsx) to useimport Navigation from '../Navigation/Navigation';. - In
src/components/Header/Header.jsx, there is a nested<header>inside another<header>, which breaks proper semantics and likely the expected DOM; keep a single<header className="header">wrapping the title and<Navigation />. Also remove the redundantimport '../Navigation/Navigation.css';since the Navigation component already imports its own CSS. - In
src/components/Article/Article.css, there are.headerrules inside the@media (min-width: 500px)block. These header styles must be moved intosrc/components/Header/Header.cssso that each component owns its own CSS, and the duplicate.headerblock should be removed fromArticle.css.
Once you address these points, your structure will align with the component/CSS-splitting requirement and the default-export expectation, and the app should be ready for approval. You’ve already done a solid job creating separate component folders and CSS files; fixing these remaining mismatches will complete the refactor cleanly.
✨ 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
src/components/Article/Article.css
Outdated
| @media (min-width: 500px) { | ||
| .header { | ||
| text-align: left; | ||
| display: flex; | ||
| justify-content: space-between; | ||
| } |
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.
This file contains .header rules inside the @media (min-width: 500px) block. The project requirement states: "CSS code should be split too." Move these .header rules to the Header component stylesheet (src/components/Header/Header.css) so each component keeps its own styles.
src/components/Article/Article.css
Outdated
| .header { | ||
| text-align: left; | ||
| display: flex; | ||
| justify-content: space-between; | ||
| } |
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.
Header-related rules here duplicate header styles that belong in Header.css. Consolidate header styles into src/components/Header/Header.css and remove the duplicate .header block from this Article.css to avoid duplication. See Header.css for the proper place.
src/App.jsx
Outdated
| @@ -1,5 +1,7 @@ | |||
| import React from 'react'; | |||
| import './App.css'; | |||
| import { Header } from './components/Header/Header'; | |||
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.
This file still contains the welcome markup inline rather than using the Welcome component. The task requires: "Split the App.js into components based on CSS blocks." Move this block to the existing Welcome component and import/use <Welcome /> here. The Welcome component already exists: src/components/Welcome/Welcome.jsx.
src/App.jsx
Outdated
| import React from 'react'; | ||
| import './App.css'; | ||
| import { Header } from './components/Header/Header'; | ||
| import { Article } from './components/Article/Article'; |
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 import Article as a named import. The component files provide default exports — prefer importing components by their default export (e.g. import Article from './components/Article/Article';) so your imports match the components' default exports and project expectations.
| diam. | ||
| </p> | ||
| </article> | ||
| <Header /> |
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.
Change the inline welcome section to use the Welcome component here (import it at the top). Also ensure welcome styles are moved out of src/App.css into src/components/Welcome/Welcome.css — the description requires "CSS code should be split too." See App.css for current welcome rules and move them.
| </p> | ||
| </article> | ||
| <Header /> | ||
| <Article /> |
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.
After moving the welcome block into Welcome, keep App.jsx as a composition of components only (e.g. <Welcome />, <Header />, <Article />). This keeps BEM blocks and their styles isolated per component as requested. The Welcome component exists and can be used: src/components/Welcome/Welcome.jsx.
| export const Navigation = () => { | ||
| return ( | ||
| <nav className="navigation"> | ||
| <a className="navigation__link" href="#about"> | ||
| About | ||
| </a> | ||
| <a className="navigation__link" href="#services"> | ||
| Services | ||
| </a> | ||
| <a className="navigation__link" href="#contact"> | ||
| Contact | ||
| </a> | ||
| </nav> | ||
| ); | ||
| }; |
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.
This file exports Navigation as a named export (export const Navigation = ...) but the task description requires: "Tests expect you to use export default for all the components." Add a default export (for example, export default Navigation;) so the component meets the requirement and can be imported as a default import elsewhere.
src/components/Header/Header.jsx
Outdated
| // Create a Header function returning the HTML of header block | ||
|
|
||
| // Add a default export statement for Header component to use it in the other files | ||
| import { Navigation } from '../Navigation/Navigation'; |
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.
Importing Navigation as a named import (import { Navigation } ...) conflicts with the project requirement that components use default exports. Use a default import instead (e.g. import Navigation from '../Navigation/Navigation';) and ensure Navigation file exports a default export. This keeps imports consistent with the requirement that "Tests expect you to use export default for all the components."
src/components/Header/Header.jsx
Outdated
| // Add a default export statement for Header component to use it in the other files | ||
| import { Navigation } from '../Navigation/Navigation'; | ||
| import './Header.css'; | ||
| import '../Navigation/Navigation.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.
This file imports Navigation CSS here (import '../Navigation/Navigation.css';) while the Navigation component should own its own CSS (Navigation.jsx already imports ./Navigation.css). Remove this redundant import to avoid duplicate style imports.
src/components/Header/Header.jsx
Outdated
| <header className="header"> | ||
| <header className="header"> | ||
| <h1 className="header__title">Site Name</h1> | ||
| <Navigation /> | ||
| </header> |
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.
There is a nested <header> element inside another <header>. Keep only one <header className="header"> that contains the title and <Navigation />. The nested duplicate likely causes incorrect semantics/DOM structure — remove the inner or outer one.
mateacademy-ai-mentor
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.
Review Summary
I am requesting changes because there are still a couple of requirement-level issues that block this task from being fully correct.
Critical issues that must be fixed
- In
src/App.jsx, you still import the Navigation module as a side effect (e.g.import './components/Navigation/Navigation';). This violates the requirement thatNavigationis owned and used byHeaderonly, not byApp. Please remove this import fromApp.jsxand ensureHeader.jsxis the component that importsNavigationviaimport Navigation from '../Navigation/Navigation';. - In
src/components/Header/Header.jsx, there is a redundantimport '../Navigation/Navigation.css';. The checklist explicitly states thatNavigationshould own its own CSS, and yourNavigation.jsxalready imports./Navigation.css. Remove this extra CSS import fromHeader.jsxso each component is responsible for its own styles.
Once you remove the Navigation side-effect import from App.jsx and the extra Navigation.css import from Header.jsx, your component ownership and imports will align with the task requirements. Overall, your component structure and CSS separation look good, and these changes will complete the refactor cleanly.
✨ 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
src/App.jsx
Outdated
| import Header from './components/Header/Header'; | ||
| import Article from './components/Article/Article'; | ||
|
|
||
| import './components/Navigation/Navigation'; |
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.
This line imports Navigation as a side-effect into App. Remove this import — the Navigation component should be owned/used by Header (not imported in App). Per the task: “Move the navigation into a Navigation component (you may create a folder for it) and use that component.” Ensure Navigation is exported as a default export and that Header.jsx imports it like import Navigation from '../Navigation/Navigation';.
src/components/Header/Header.jsx
Outdated
| // import a css file containig header styles | ||
| import Navigation from '../Navigation/Navigation'; | ||
| import './Header.css'; | ||
| import '../Navigation/Navigation.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.
This violates checklist item: "Remove the redundant import '../Navigation/Navigation.css'; from Header.jsx because the Navigation component imports its own CSS." Remove this import (the Navigation component should import its own CSS) so each component owns its styles.
mateacademy-ai-mentor
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.
Review Summary
I am approving your solution as part of an educational override so you can keep progressing while you learn, even though the CI currently fails due to a platform-specific dependency issue during npm install (a Windows-only Rollup binary on a Linux runner). You did a very good job structuring the React app: App.jsx composes Welcome, Header, and Article, each component lives in its own folder with its own .css file, and Navigation is correctly owned and used only by Header with its own Navigation.css [CHECKLIST ITEM #2]. Your components use default exports consistently and the JSX/CSS in Article, Header, Navigation, and Welcome is clean and focused, matching the requirement for component-scoped styling.
The main issue to address next is the CI install error: your dependencies (or package-lock.json) include @rollup/rollup-win32-x64-msvc, which only works on Windows, but the CI runs on Linux, causing EBADPLATFORM and blocking linter/tests. To fix this, regenerate package-lock.json on a Linux environment (rm -rf node_modules package-lock.json && npm install, then commit) or adjust the CI to use npm install --no-optional or run on windows-latest, depending on your course guidelines. Once that is resolved, run npm test locally to make sure everything passes and confirm your Prettier/VSCode formatting rules are applied consistently. Overall, your component design and file organization are strong; resolving the dependency/CI setup will bring the project to a fully production-ready state—well done so far and keep going.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.