Skip to content

fix: split App into components and fix lint issues#4447

Open
olyanderbilokur wants to merge 5 commits into
mate-academy:masterfrom
olyanderbilokur:develop
Open

fix: split App into components and fix lint issues#4447
olyanderbilokur wants to merge 5 commits into
mate-academy:masterfrom
olyanderbilokur:develop

Conversation

@olyanderbilokur
Copy link
Copy Markdown

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Review Summary

Your component decomposition is well-structured with proper folder organization and export default usage throughout. However, there's a critical issue that must be fixed: Navigation is rendered twice in the component tree, which will cause the navigation to appear twice on the page. Specifically: - In src/components/Header/Header.jsx (line 15), Navigation is imported and rendered inside the Header - In src/App.jsx (line 14), Navigation is also rendered as a separate sibling component. According to the original App.jsx structure, Navigation should be a sibling of Header (not nested inside it), so remove the Navigation import and rendering from Header.jsx. The version in App.jsx should remain as-is. Additionally, there are minor formatting issues (extra blank lines in Navigation.jsx and Welcome.css) that should be cleaned up, though these are lower priority than the structural issue above. Once the duplicate Navigation is removed from Header.jsx, the solution should work correctly. The overall component decomposition approach is sound and follows the task requirements well.


✨ 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/components/Article/Article.css Outdated
margin: 5em auto 0;
padding: 1em;
font-size: 140%;
max-width: 800px;
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 imported and rendered inside Header (lines 6 and within the return statement), but it's also rendered separately in App.jsx (line 14). This causes the navigation to appear twice on the page. Remove the Navigation import and rendering from Header.jsx since it should only exist as a direct child of <main> in App.jsx.

Comment on lines +8 to +15
import './Header.css';
import Navigation from '../Navigation/Navigation';

function Header() {
return (
<header className="header">
<h1 className="header__title">Site Name</h1>
<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.

Navigation is imported (line 8) and rendered inside the header (line 15). However, the App.jsx also renders as a separate sibling component, causing duplication. The Navigation should only be rendered once - either inside Header or as a standalone component in App, but not both.

Comment on lines +8 to +14

.welcome__text {
margin: 0;
font-size: 400%;
text-align: center;
line-height: 1;
padding-top: calc(50vh - 20pt);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Navigation is imported and rendered inside Header (lines 8, 14), but it's also rendered as a separate component in App.jsx. According to the original App.jsx structure, Navigation should be a sibling of Header, not nested inside it. Remove the Navigation import and rendering from Header.jsx.

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Review Summary

The implementation has a structural issue that needs to be addressed. According to the file comments on Article.jsx, Navigation.css, Welcome.css, and Welcome.jsx, Navigation is currently nested inside Header.jsx but should be a separate sibling component rendered in App.jsx alongside Header.

This is a critical issue because:

  1. .header and .navigation are separate BEM blocks - per BEM methodology, they should be separate components at the same hierarchy level
  2. The component structure in App.jsx currently does not include Navigation as a sibling of Header

Required fix:

  • Remove the <Navigation /> import and rendering from src/components/Header/Header.jsx
  • Add <Navigation /> to src/App.jsx as a sibling of <Header />

Additionally, there are minor CSS formatting issues mentioned in the general summary regarding extra blank lines in Welcome.css and Navigation.css - these should be cleaned up (single blank line max between rules).

The component decomposition, folder structure, and export default usage throughout the codebase are well-implemented. Once Navigation is moved to be a sibling component as described, the structural requirements will be fully met.


✨ 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/components/Article/Article.jsx Outdated
Comment on lines +3 to +15
// Create an Article function returning the HTML of article block

// Add a default export statement for Article component to use it in the other files

import React from 'react';
import './Article.css';

function Article() {
return (
<article className="article">
<h2 className="article__title">Headline</h2>
<p className="article__paragraph">
In elementum lorem eget est euismod ornare. Phasellus sit amet
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Navigation is rendered inside Header, but it should be a sibling component. Remove <Navigation /> from here and add it to App.jsx as a sibling of <Header />.

Comment on lines +7 to +8
color: black;
transition: opacity 0.2s ease-in-out;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Navigation is nested inside Header, but .header and .navigation are separate BEM blocks - they should be separate components. Remove the Navigation import and rendering from Header.jsx.

Comment thread src/components/Welcome/Welcome.css Outdated
Comment on lines +8 to +15

.welcome__text {
margin: 0;
font-size: 400%;
text-align: center;
line-height: 1;
padding-top: calc(50vh - 20pt);
display: block;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Navigation is rendered inside Header, but based on the original App.jsx structure, it should be a separate sibling component. Remove <Navigation /> from Header and add it to App.jsx alongside <Header />.

Comment on lines +8 to +16
import './Welcome.css';

function Welcome() {
return (
<section className="welcome">
<span className="welcome__text">Sticky Header!</span>
</section>
);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Navigation is nested inside Header, but .navigation and .header are separate BEM blocks - they should be separate sibling components. Remove the Navigation import and rendering from Header.jsx.

Copy link
Copy Markdown

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

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 an educational override to help you progress while learning. You've done an excellent job with the component structure - proper folder organization, correct use of export default, and good BEM naming conventions in your CSS files. However, there are two areas to address for full functionality: 1. Header component needs navigation links - Your tests are failing because the Header component is missing the expected navigation links. Add three <a> tags inside a <nav> element with classes navigation and navigation__link, using href="#about", href="#services", and href="#contact". 2. Template comments - Several files contain leftover instructional comments (lines 1-5 in JSX files and line 1 in CSS files) that should be removed now that the implementation is complete. These are common learning points - template comments are helpful during setup but should be cleaned up once the code is implemented. The navigation structure in the Header component is essential for accessibility and user experience. Keep up the good work with your component decomposition.


✨ 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/components/Article/Article.css Outdated
Comment on lines +1 to +5
/* Put article styles here */
.article {
max-width: 800px;
margin: 5em auto 0;
padding: 1em;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These are template comments that should be removed - the implementation already does all of this (imports CSS, creates the component, and exports it).

Comment on lines +1 to +5
.navigation__link {
display: inline-block;

padding: 0 0.5em;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These are template comments that should be removed - the implementation already does all of this (imports CSS, creates the component, and exports it).

Comment on lines +1 to +5
import React from 'react';
import './Navigation.css';

function Navigation() {
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.

These template comments should be removed - the implementation already does all of this (imports CSS, creates component, exports default).

Comment thread src/components/Header/Header.css Outdated
Comment on lines +1 to +5
/* Put header styles here */
.header {
position: sticky;
top: 0;
right: 0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These are template comments that should be removed - the implementation already does all of this (imports CSS, creates the component, and exports it).

Comment thread src/components/Welcome/Welcome.css Outdated
Comment on lines +1 to +5
/* Put welcome styles here */
.welcome {
height: 100vh;
background: coral;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These are template comments that should be removed - the implementation already does all of this (imports CSS, creates the component, and exports it).

Copy link
Copy Markdown

@2pasha 2pasha left a comment

Choose a reason for hiding this comment

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

lgtm 🔥

*do not forget to deploy your app

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.

3 participants