add task solution#4455
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation has critical syntax errors that will prevent the application from rendering. Both Header.jsx and Welcome.jsx are missing return statements — the JSX blocks need to be wrapped with return( at the beginning and ); at the end. Without these, your components return undefined instead of actual UI content, which is why all 6 Header tests and 2 Welcome tests are failing in Cypress. The Article component passes correctly, so you can use that as a reference for the proper function structure. Additionally, the task requires creating a separate Navigation component folder under src/components/Navigation/, but the navigation element remains embedded in the Header component. These issues are blocking — the application won't work until the return statements are added.
✨ 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
| return ( | ||
| <article className="article"> | ||
| <h2 className="article__title">Headline</h2> | ||
| <p className="article__paragraph"> | ||
| In elementum lorem eget est euismod ornare. Phasellus sit amet | ||
| pellentesque mauris. Aliquam quis malesuada ex. Nullam eu aliquam nibh. | ||
| Mauris molestie, urna accumsan ornare semper, augue nibh posuere lorem, | ||
| vitae feugiat sem magna eget massa. Vivamus quis tincidunt dolor. Fusce | ||
| efficitur, orci non vestibulum consequat, lectus turpis bibendum odio, | ||
| in efficitur leo felis sed justo. Fusce commodo iaculis orci, quis | ||
| imperdiet urna. Sed mollis facilisis lacus non condimentum. Nunc | ||
| efficitur massa non neque elementum semper. Vestibulum lorem arcu, |
There was a problem hiding this comment.
Missing return statement - the function body contains JSX but doesn't return it. Add return ( before the JSX and ); after it.
| function Article() { | ||
| return ( | ||
| <article className="article"> | ||
| <h2 className="article__title">Headline</h2> | ||
| <p className="article__paragraph"> |
There was a problem hiding this comment.
Missing return statement - the function body contains JSX but doesn't return it. Add return ( before the JSX and ); after it.
| padding: 1em; | ||
| font-size: 140%; | ||
| position: sticky; | ||
| top: 0; | ||
| left: 0; | ||
| right: 0; | ||
| transition: opacity 0.2s ease-in-out; | ||
| text-align: center; | ||
| } | ||
|
|
||
| .header__title { | ||
| font-weight: 600; | ||
| display: inline; | ||
| margin: 0; | ||
| padding: 0; | ||
| font-size: inherit; | ||
| } |
There was a problem hiding this comment.
The Header function is missing return( before the JSX and ) after it. Without return, this component won't render anything. Add return( at line 3 before <header and ) after </header>; at line 19.
| padding: 1em; | ||
| font-size: 140%; | ||
| max-width: 800px; | ||
| background: white; | ||
| box-shadow: rgba(0, 0, 0, 0.05) 0 3px 15px; | ||
| } | ||
|
|
||
| .article__paragraph { | ||
| margin: 0; | ||
| color: #333; | ||
| } | ||
|
|
||
| .article__paragraph:not(:first-child) { | ||
| margin-top: 0.7em; | ||
| } | ||
|
|
||
| @media (min-width: 500px) { | ||
| .article { | ||
| margin: 3.5em auto 0; |
There was a problem hiding this comment.
CRITICAL: Header component is missing the return keyword. The function body contains JSX but will return undefined instead of rendering. Add return ( before the opening <header> tag and ); after the closing </header> tag.
| padding: 1em; | ||
| font-size: 140%; | ||
| max-width: 800px; | ||
| background: white; |
There was a problem hiding this comment.
CRITICAL: Welcome component is missing the return keyword. The function body contains JSX but will return undefined instead of rendering. Add return ( before the opening <section> tag.
| background: coral; | ||
| } | ||
|
|
There was a problem hiding this comment.
CRITICAL BUG: Missing return statement. The function body contains JSX but will return undefined. Add return ( before the opening <section> tag and close with ); after </section>;
| function Header() { | ||
| <header className="header"> | ||
| <h1 className="header__title">Site Name</h1> | ||
| <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.
CRITICAL: Missing return statement. The JSX inside this function is never returned, so the component will render nothing. Add return ( before <header> and ); after </header>;.
| // 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 './Header.css'; |
There was a problem hiding this comment.
CRITICAL: Missing return statement. The JSX inside this function is never returned, so the component will render nothing. Add return ( before <section> and ); after </section>;.
| function Header() { | ||
| <header className="header"> | ||
| <h1 className="header__title">Site Name</h1> | ||
| <nav className="navigation"> |
There was a problem hiding this comment.
The task description states: 'You may also create a folder for the Navigation component and move navigation there.' The <nav> element with .navigation__link CSS styles should be extracted into a separate Navigation component folder.
| <section className="welcome"> | ||
| <span className="welcome__text">Sticky Header!</span> | ||
| </section>; |
There was a problem hiding this comment.
CRITICAL: Missing return statement - the function body contains JSX but doesn't return it. Add return ( before <section on line 4 and ); after </section>; on line 6.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
The implementation is very close to complete, but Header.css still contains duplicate .navigation__link styles (lines 20-33) that violate the task requirement 'CSS code must be split along with components'. Since the Navigation component now has its own folder with Navigation.css, those navigation styles should only exist there. Please remove lines 20-33 (the .navigation__link styles) from Header.css to complete the CSS separation requirement.
✨ 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
| </p> | ||
| <p className="article__paragraph"> | ||
| In ac nisi lacus. Fusce est dolor, tincidunt ut bibendum vitae, | ||
| fermentum ac quam. Aliquam pretium tristique nibh quis iaculis. In et | ||
| cursus ex, eu aliquet ex. Proin facilisis lacus sit amet sapien | ||
| ultrices, ut vehicula arcu lobortis. Vivamus mollis ipsum ut hendrerit | ||
| molestie. Morbi lacinia, sapien eu dictum dignissim, tellus tortor | ||
| congue magna, sit amet bibendum libero nisi id massa. | ||
| </p> | ||
| <p className="article__paragraph"> | ||
| Donec arcu elit, euismod vel lobortis eu, fringilla sit amet dolor. Cras | ||
| congue, massa nec sagittis mollis, dui felis ultrices magna, tincidunt | ||
| finibus lorem quam in sem. Morbi odio turpis, pulvinar sit amet | ||
| vulputate quis, ultricies eu libero. Donec ac maximus neque, nec maximus |
There was a problem hiding this comment.
This violates the task requirement 'CSS code must be split along with components'. The .navigation__link styles (lines 20-33) should not be in Header.css - they belong only in Navigation.css since there's a separate Navigation component. Remove these styles from Header.css to avoid duplication.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation is complete and meets all requirements. The App.jsx has been properly decomposed into separate components (Article, Header, Welcome, Navigation) with their own folders and co-located CSS files, and all components correctly use export default as required. The CSS is cleanly split along component boundaries - each component owns its specific styles. Great work on maintaining proper file structure and encapsulation!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
DEMO LINK