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

feat: hide tokens tab #270

Merged
merged 1 commit into from
Jul 3, 2024
Merged

feat: hide tokens tab #270

merged 1 commit into from
Jul 3, 2024

Conversation

r4mmer
Copy link
Member

@r4mmer r4mmer commented Jul 1, 2024

Acceptance Criteria

  • Only show tokens tab if at least one of its options are enabled

Motivation

All items under the tokens tab are protected behind an unleash feature flag, but if all feature flags are disabled the UI would show an empty dropdown

image

To prevent this, we need to remove the tokens tab altogether when all feature flags are disabled.

For reference, when all items are enabled we have this:

image

Alternatives

Ideally we should have a component to conditionally render the tab, but using unleash's useFlag on callbacks and not on the component body directly would fail building the explorer.

Later we can refactor this with a custom hook to check multiple flags, but since this is the only instance where this behavior is required we can use conditional rendering without any code repetition.

Security Checklist

  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

@r4mmer r4mmer self-assigned this Jul 1, 2024
@r4mmer r4mmer changed the base branch from master to dev July 1, 2024 18:08
@r4mmer r4mmer force-pushed the feat/hide-tokens-tab branch from f8fd622 to c3bb45d Compare July 1, 2024 19:00
@r4mmer r4mmer merged commit 71b44e0 into dev Jul 3, 2024
1 check passed
@r4mmer r4mmer deleted the feat/hide-tokens-tab branch July 3, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants