Skip to content

Solution#4325

Open
Denixify wants to merge 1 commit intomate-academy:masterfrom
Denixify:develop
Open

Solution#4325
Denixify wants to merge 1 commit intomate-academy:masterfrom
Denixify:develop

Conversation

@Denixify
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

Great job on decomposing the application into Header, Welcome, and Article components and separating their styles. The project structure is well-organized.

However, changes are needed because a key part of the decomposition is incomplete. The task suggests creating a separate Navigation component, but the navigation logic and styles are still inside the Header component. To complete the task, please move the <nav> element from Header.jsx and its associated styles from Header.css into a new Navigation component.

I also noticed that your components use both named and default exports. The task requires only a default export, so you can remove the export keyword from the function declarations to avoid redundancy.

Once the Navigation component is created, your solution will fully meet the requirements. Keep up the great work!


✨ 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 +3 to +5
import PageHeader from './components/Header/Header';
import PageWelcome from './components/Welcome/Welcome';
import PageArticle from './components/Article/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.

While this works, it's a common convention in React to name the imported component the same as the component itself. For instance, import Header from './components/Header/Header';. Using prefixes like Page can make the code slightly more verbose than necessary.

import './Article.css';

// Create an Article function returning the HTML of article block
export function 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.

You're exporting this component in two ways: as a named export on this line and as a default export at the end of the file. While this works, it's a common practice to have a single export per component file. Since the task requires a default export, you can remove the export keyword from this function declaration and rely solely on the export default Article; at the bottom. Alternatively, you could combine them into one line: export default function Article() { ... }.

Comment on lines +21 to +34
.navigation__link {
display: inline-block;
outline: none;
text-decoration: none;
opacity: 0.7;
padding: 0 0.5em;
color: black;
transition: opacity 0.2s ease-in-out;
}

.navigation__link:hover,
.navigation__link:focus {
opacity: 1;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good job splitting the CSS. However, the task description suggests creating a separate Navigation component. To follow this structure, the styles related to .navigation__link should be moved to a new Navigation.css file inside the Navigation component's folder.

import './Welcome.css';

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

Similar to the other components, you have both a named and a default export. The task requires a default export, so the named export on this line is redundant. To simplify, you can remove the export keyword here and just use the export default Welcome; at the end of the file.

import './Header.css';

// Create a Header function returning the HTML of header block
export function 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.

You have both a named export here and a default export at the end of the file. To keep the code consistent and follow the task's requirement for default exports, it's better to use only one. You can remove the export keyword from this line and just keep the export default Header; at the bottom.

Comment on lines +7 to +17
<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>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good job creating the Header component. However, the task description suggests that the navigation part should also be a separate component. To complete the decomposition, you should create a new Navigation component in its own folder (src/components/Navigation), move this <nav> block into it, and then import and use the <Navigation /> component here.

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