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: nav updates #9973

Merged
merged 5 commits into from
Jul 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/client/components/DashNavList/DashNavList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import graphql from 'babel-plugin-relay/macro'
import React from 'react'
import {useFragment} from 'react-relay'
import {DashNavList_organization$key} from '../../__generated__/DashNavList_organization.graphql'
import {TierEnum} from '../../__generated__/OrganizationSubscription.graphql'
import {Tooltip} from '../../ui/Tooltip/Tooltip'
import {TooltipContent} from '../../ui/Tooltip/TooltipContent'
import {TooltipTrigger} from '../../ui/Tooltip/TooltipTrigger'
Expand Down Expand Up @@ -43,11 +44,11 @@ const DashNavList = (props: Props) => {
organizationsRef
)

const tiers = ['enterprise', 'team', 'starter']
const TierEnumValues: TierEnum[] = ['enterprise', 'team', 'starter']
Copy link
Member Author

Choose a reason for hiding this comment

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

@nickoferrall does this work to check the tiers?

Copy link
Member Author

Choose a reason for hiding this comment

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

See commit

Copy link
Contributor

Choose a reason for hiding this comment

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

That works!


const sortedOrgs = organizations.toSorted((a, b) => {
const aTier = tiers.indexOf(a.tier)
const bTier = tiers.indexOf(b.tier)
const aTier = TierEnumValues.indexOf(a.tier)
const bTier = TierEnumValues.indexOf(b.tier)
return aTier < bTier ? -1 : aTier > bTier ? 1 : a.name.localeCompare(b.name)
})

Expand Down
Loading