Skip to content

fixed components#4368

Open
Yurii-Leniv wants to merge 4 commits intomate-academy:masterfrom
Yurii-Leniv:master
Open

fixed components#4368
Yurii-Leniv wants to merge 4 commits intomate-academy:masterfrom
Yurii-Leniv:master

Conversation

@Yurii-Leniv
Copy link
Copy Markdown

No description provided.

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

Changes are needed before this can be considered complete because there are still a few critical issues that break the build and tests. The most severe problems are malformed JSX tags with leading spaces (for example < Welcome /> and < Navigation /> in your component files), which will cause syntax/parsing errors; these must be corrected to <Welcome /> and <Navigation /> so JSX is valid. The Welcome component currently only has a named export, but other files (and the tests) import it as a default; you need to add export default Welcome; in src/components/Welcome/Welcome.jsx so those imports resolve correctly. In src/components/Article/Article.jsx the CSS is imported as import 'Article.css';, which is a non-relative path and fails both linting and tests; change this to import './Article.css'; and ensure the CSS file exists in the same folder. Additionally, base header styles such as .header and .header__title are still in src/App.css instead of being fully moved into src/components/Header/Header.css, which violates the requirement to split CSS per component; move those rules so the Header’s styles live alongside the component. Apart from these issues, your overall component structure and CSS separation are on the right track, so once you fix these blocking items you should be very close to a fully passing solution.


✨ 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

box-shadow: rgba(0, 0, 0, 0.05) 0 3px 15px;
}

.article__paragraph {
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 JSX tag has a leading space: < Welcome />. Remove the space after < and use <Welcome />. Leading whitespace in the tag can cause a syntax error.

}

.article__paragraph {
margin: 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.

This JSX tag has extra spaces: < Header />. Remove the leading space and extra internal spaces; use <Header /> so the tag is valid.

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.

You're importing Welcome as a default export (import Welcome from './components/Welcome/Welcome';) but the Welcome component file doesn't have export default. Tests expect default exports for all components—add export default Welcome; to the Welcome component file.

@@ -1 +1,33 @@
/* 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 CSS import uses a non-relative path: import 'Article.css';. Use a relative path to load the component CSS, e.g. import './Article.css'; so the bundler can resolve the file.

Comment thread src/App.jsx
Comment on lines 2 to 8
import './App.css';
// Move each BEM block to a separate component (file) and import them here
import Header from './components/Header/Header';
import Article from './components/Article/Article';
import Welcome from './components/Welcome/Welcome';

function 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.

This file only contains a media-query override for .header. According to the task description ("Split the CSS code too, corresponding to the decomposed components"), the base .header and .header__title styles should be moved here from src/App.css so the header block's styles are fully contained in the component folder.

padding: 0 0.5em;
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.

This JSX tag has a leading space: < Navigation />. Remove the space after < and use <Navigation />. The leading whitespace makes the tag invalid and may cause a syntax error.

@@ -0,0 +1,14 @@
.navigation__link {
display: inline-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.

You import ./Header.css here, but the base .header and .header__title rules are still in the global src/App.css. The task requires splitting CSS per component: "Split the App.js into components based on CSS blocks. CSS code should be split too." Move the base header styles into src/components/Header/Header.css so the header block's styles are fully contained in the component folder.


.welcome__text {
margin: 0;
font-size: 400%;
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 JSX usage has a leading space: < Navigation />. Remove the space after < and use <Navigation />. Leading whitespace inside the tag is invalid JSX and will cause a syntax error.

import './Welcome.css';

// Create a Welcome function returning the HTML of welcome block
export const 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.

The component is declared as a named export (export const Welcome = ...) but the task description requires default exports: "Tests expect you to use export default for all the components." Add a default export so other files can import it with import Welcome from ....

Comment thread src/components/Welcome/Welcome.jsx Outdated
);

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

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 a placeholder comment about adding a default export but no implementation. Add export default Welcome; (for example at the end of this file) to satisfy the requirement and fix the failing import in App.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

I am requesting changes because there is still a JSX syntax error that will break the build and prevent the task from being completed successfully.

Critical blocker that must be fixed:

  • In src/components/Header/Header.jsx, the line where you render the navigation component uses a malformed JSX tag: < Navigation /> (with a space after <). JSX does not allow a space there, so this will cause a syntax/parsing error and stop the app from compiling and tests from running. Update that line to <Navigation /> (no space) so the Header component renders correctly and the code can be parsed.

Additional (non-blocking) issues to improve:

  • ESLint is reporting import/no-named-as-default in src/App.jsx for Header, Article, and Welcome. Either switch to named imports like import { Header } from './components/Header/Header'; and export them as named exports, or adjust your lint configuration if the task requires default exports.
  • ESLint also flags import/extensions in src/components/Header/Header.jsx; change import Navigation from '../Navigation/Navigation.jsx'; to import Navigation from '../Navigation/Navigation'; and, if needed, align the import mode (default vs named) with how Navigation is exported.

Overall, your component structure, CSS separation, and exports are very close to the requirements; once you correct the malformed JSX tag and address the lint issues, your solution should be in good shape. Keep going—these are fixable details and your overall organization looks solid.


✨ 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/Header/Header.jsx Outdated
export const Header = () => (
<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.

This line contains a malformed JSX tag: < Navigation /> has a leading space which makes the JSX invalid and will cause a syntax/build error. Change it to <Navigation /> (remove the space).

padding: 0 0.5em;
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.

This line contains a malformed JSX tag with a leading space: < Navigation />. JSX does not allow a space after the '<'. Change it to <Navigation /> to fix the syntax error (this addresses the previous HIGH priority correction to fix malformed JSX tags).

About
</a>
<a className="navigation__link" href="#services">
Services
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Critical: malformed JSX tag with a leading space. Change < Navigation /> to <Navigation /> in Header.jsx — the leading space makes the JSX invalid and will cause a syntax/build error.

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

I am approving your solution as an educational override so you can keep progressing while you address a few remaining issues. You’ve done well structuring the app into separate Header, Article, Welcome, and Navigation components with their own CSS files, and App.jsx correctly composes them. The most critical fix is the malformed JSX tag in src/components/Header/Header.jsx around line 9 where < Navigation /> has a space after <; change it to <Navigation /> so the file compiles. Also in Header.jsx line 3, update import { Navigation } from '../Navigation/Navigation.jsx'; to a default import without the extension (for example import Navigation from '../Navigation/Navigation';) to satisfy the import/extensions rule and match how the component is exported. To resolve the import/no-named-as-default errors reported in src/App.jsx lines 4–6, remove the export const ... named exports from src/components/Article/Article.jsx, src/components/Header/Header.jsx, src/components/Welcome/Welcome.jsx, and src/components/Navigation/Navigation.jsx, keeping only const ComponentName = () => ... plus export default ComponentName; in each file. As a minor improvement, double-check similar JSX spacing and import/export patterns in Navigation.jsx and Welcome.jsx (for example any < Navigation /> usage or extra named exports) to keep your code consistent and lint-clean. Overall, your component decomposition and styling setup are solid; once you apply these small fixes and rerun npm test/npm run lint, your solution will be in great shape—well done continuing to iterate on it.


✨ 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 on lines +4 to +6
text-align: left;
display: flex;
justify-content: space-between;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

App imports components as defaults here. ESLint import/no-named-as-default warnings can appear if the component files also export named exports. Ensure your component files export only default (remove the extra export const ...) so imports like these are clean and lint-friendly.

.header {
text-align: left;
display: flex;
justify-content: space-between;
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 component file currently uses a named export (export const Article = ...) and also a default export. Tests expect default exports and the named export causes import/no-named-as-default warnings. Change this to a plain const Article = () => ... and keep export default Article; only.

@@ -0,0 +1,14 @@
.navigation__link {
display: inline-block;
outline: none;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Import currently uses a named import and includes the .jsx extension: import { Navigation } from '../Navigation/Navigation.jsx';. Prefer a default import without the extension: import Navigation from '../Navigation/Navigation'; and ensure Navigation is exported as default to avoid import/extensions and import/no-named-as-default issues.

padding: 0 0.5em;
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.

Malformed JSX: < Navigation /> has a space after <, which is invalid and causes a parse error. Change it to <Navigation />. This syntax error will stop the app from compiling and tests from running (HIGH priority).

outline: none;
text-decoration: none;
opacity: 0.7;
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.

Header is declared as a named export here (export const Header = ...) and also exported as default at the bottom. Tests expect default exports for components — change this to const Header = () => ... and keep export default Header; to avoid import/no-named-as-default warnings.

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.

Export style: the file uses a named export (export const Header = ...) and also a default export. To avoid import/no-named-as-default lint warnings in other files, change the named export to a plain declaration (e.g. const Header = () => ...) and keep only export default Header; at the bottom.

About
</a>
<a className="navigation__link" href="#services">
Services
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

HIGH: Malformed JSX tag — JSX does not allow a space after the opening '<'. Change < Navigation /> to <Navigation /> so the file parses and the app can compile.

@@ -0,0 +1,18 @@
import './Navigation.css';

export const 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.

Import style: you're using a named import and including the .jsx extension. Change this to a default import without the extension, for example import Navigation from '../Navigation/Navigation'; and ensure Navigation is exported as default in its file to avoid import/extensions and import/no-named-as-default warnings.

export const Navigation = () => (
<nav className="navigation">
<a className="navigation__link" href="#about">
About
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Named export present: export const Header = ... will trigger import/no-named-as-default when you import this component as a default elsewhere. Convert this to const Header = () => (...) and keep export default Header; (line 14) so the component is exported only as default as required.

import './Welcome.css';

// Create a Welcome function returning the HTML of welcome block
export const 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.

This file uses a named export (export const Welcome = ...) alongside a default export. The description says: "Tests expect you to use export default for all the components." Remove the named export and declare the component as const Welcome = () => (...), keeping only export default Welcome; to satisfy the requirement and avoid lint warnings.

Copy link
Copy Markdown

@etojeDenys etojeDenys left a comment

Choose a reason for hiding this comment

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

good job

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