-
Notifications
You must be signed in to change notification settings - Fork 20
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
base: v3-master
Are you sure you want to change the base?
Conversation
SonarCloud Quality Gate failed. 0 Bugs 0.0% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
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; |
There was a problem hiding this comment.
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} /> |
There was a problem hiding this comment.
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} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
Refactor of Header to avoid unecessary rerenders and to solidify the logic behind quick access item