fix: don't highlight inactive org in management settings sidebar (#14059)

This commit is contained in:
Kayla Washburn-Love
2024-07-30 09:33:22 -06:00
committed by GitHub
parent cf1fcab514
commit 56dfc64bb0
@@ -15,11 +15,15 @@ import { useOrganizationSettings } from "./ManagementSettingsLayout";
export const Sidebar: FC = () => {
const { organizations } = useOrganizationSettings();
const { organization = getOrganizationNameByDefault(organizations) } =
useParams() as { organization: string };
const { organization } = useParams() as { organization?: string };
const { multiple_organizations: organizationsEnabled } =
useFeatureVisibility();
let organizationName = organization;
if (location.pathname === "/organizations") {
organizationName = getOrganizationNameByDefault(organizations);
}
// TODO: Do something nice to scroll to the active org.
return (
@@ -44,7 +48,7 @@ export const Sidebar: FC = () => {
<OrganizationSettingsNavigation
key={org.id}
organization={org}
active={org.name === organization}
active={org.name === organizationName}
/>
))}
</>