Skip to content
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

Chore : Refactor Header.tsx #390

Open
wants to merge 1 commit into
base: v3-master
Choose a base branch
from
Open

Conversation

Grafikart
Copy link
Collaborator

Refactor of Header to avoid unecessary rerenders and to solidify the logic behind quick access item

@sonarcloud
Copy link

sonarcloud bot commented Sep 11, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@Grafikart Grafikart changed the title Refactor Header.tsx Chore : Refactor Header.tsx Sep 11, 2023
@Grafikart Grafikart added the quality Improves code quality label Sep 11, 2023
Comment on lines +16 to +19
const brandTop = header?.brandTop ?? DEFAULT_HEADER.brandTop;
const homeLinkProps = header?.homeLinkProps ?? DEFAULT_HEADER.homeLinkProps;
const serviceTitle = header?.serviceTitle ?? DEFAULT_HEADER.serviceTitle;
const operatorLogo = header?.operatorLogo ?? DEFAULT_HEADER.operatorLogo;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it will clearer to extract this into function that will take header and return brandTop, homeLinkProps ...

);
})}
{quickAccessItems.map((item, index) => (
<QuickAccessLi key={index} item={item} />
Copy link
Contributor

@ddecrulle ddecrulle Sep 11, 2023

Choose a reason for hiding this comment

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

use index as key could cause trouble, use an id

);
})}
{quickAccessItems.map((item, index) => (
<QuickAccessLi key={index} item={item} />
Copy link
Contributor

Choose a reason for hiding this comment

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

same

Base automatically changed from v3-develop to v3-master December 18, 2023 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy-review quality Improves code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants