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

#305 Active tab highlighting #323

Merged
merged 10 commits into from
Nov 29, 2023
Merged

Conversation

Lvyshnevska
Copy link
Collaborator

@Lvyshnevska Lvyshnevska commented Nov 24, 2023

The logic of active tab highlighting has been updated:

  • "Про компанію" is initially highlighted for registered company;
  • "Стартап" is initially highlighted for startup;
  • another tab is highlighted when user switches to it;
  • after page reload, highlighting returns to its initial state;
  • only tabs for fields with provided information are shown.

Star button removed for profile owner in profile list.

UPD. Menu tabs functionality has been implemented with Context.

@Lvyshnevska Lvyshnevska added this to the Sprint 7 milestone Nov 24, 2023
@Lvyshnevska Lvyshnevska self-assigned this Nov 24, 2023
@Lvyshnevska Lvyshnevska linked an issue Nov 24, 2023 that may be closed by this pull request
Comment on lines 25 to 26
data.is_registered && document.getElementById('about-company') ? 'about-company' :
data.is_startup && document.getElementById('startup') ? 'startup' : ''
Copy link
Collaborator

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?

Copy link
Collaborator Author

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?

Copy link
Collaborator Author

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) && (
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@Lvyshnevska Lvyshnevska merged commit e39d068 into develop Nov 29, 2023
4 checks passed
@Lvyshnevska Lvyshnevska deleted the #305-ActiveTabHighlighting branch November 29, 2023 19:14
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.

[Profile] Active Tab highlighting
3 participants