-
Notifications
You must be signed in to change notification settings - Fork 3
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
#305 Active tab highlighting #323
Conversation
data.is_registered && document.getElementById('about-company') ? 'about-company' : | ||
data.is_startup && document.getElementById('startup') ? 'startup' : '' |
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.
This is a very bad practice to rely on DOM. Do we need to use document.getElementById
here and could we replace it?
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.
Yes, I read about it. But I didn't find another solution.
Only tabs for components with provided information have to be shown. And I wanted to check if component is on the page using id of that component.
Maybe you can recommend some solution? What is better to use here?
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.
Menu tabs functionality has been implemented with Context.
<div className={classes['navbar-menu']}> | ||
{Object.entries(MENU_LINKS).map( | ||
([link, label]) => | ||
dataInComponents.includes(link) && ( |
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.
Since we store links could we provide a better name for the context that describes it? Like activeTabs
or activeLinks
. Same for the context provider
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.
Done
The logic of active tab highlighting has been updated:
Star button removed for profile owner in profile list.
UPD. Menu tabs functionality has been implemented with Context.