Fix sidebar display on no org zone
Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
@@ -27,7 +27,6 @@ import {
|
||||
ToyBrick,
|
||||
Users,
|
||||
} from "lucide-react";
|
||||
import { NavMainSkeleton } from "./NavMainSkeleton";
|
||||
|
||||
interface NavItem {
|
||||
title: string;
|
||||
@@ -47,7 +46,7 @@ export function NavMain() {
|
||||
const items: NavItem[] = getNavItems(organizationId);
|
||||
|
||||
if (!organizationId) {
|
||||
return <NavMainSkeleton />;
|
||||
return null;
|
||||
}
|
||||
|
||||
const isItemActive = (item: { url?: string; items?: { url: string }[] }) => {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { ChevronsUpDown, LogOut } from "lucide-react";
|
||||
import { graphql, useFragment } from "react-relay";
|
||||
import { useParams } from "react-router";
|
||||
|
||||
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
|
||||
import {
|
||||
@@ -20,7 +19,6 @@ import {
|
||||
useSidebar,
|
||||
} from "@/components/ui/sidebar";
|
||||
import { NavUser_viewer$key } from "./__generated__/NavUser_viewer.graphql";
|
||||
import { NavUserSkeleton } from "./NavUserSkeleton";
|
||||
import { buildEndpoint } from "@/utils";
|
||||
|
||||
export const navUserFragment = graphql`
|
||||
@@ -34,7 +32,6 @@ export const navUserFragment = graphql`
|
||||
export function NavUser({ viewer }: { viewer: NavUser_viewer$key }) {
|
||||
const { isMobile } = useSidebar();
|
||||
const currentUser = useFragment(navUserFragment, viewer);
|
||||
const { organizationId } = useParams();
|
||||
|
||||
const handleLogout = async () => {
|
||||
fetch(buildEndpoint("/api/console/v1/auth/logout"), {
|
||||
@@ -45,10 +42,6 @@ export function NavUser({ viewer }: { viewer: NavUser_viewer$key }) {
|
||||
});
|
||||
};
|
||||
|
||||
if (!organizationId) {
|
||||
return <NavUserSkeleton />;
|
||||
}
|
||||
|
||||
return (
|
||||
<SidebarMenu>
|
||||
<SidebarMenuItem>
|
||||
|
||||
@@ -25,7 +25,6 @@ import {
|
||||
OrganizationSwitcher_organizations$data,
|
||||
} from "./__generated__/OrganizationSwitcher_organizations.graphql";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { OrganizationSwitcherSkeleton } from "./OrganizationSwitcherSkeleton";
|
||||
|
||||
export const organizationSwitcherFragment = graphql`
|
||||
fragment OrganizationSwitcher_organizations on User {
|
||||
@@ -95,10 +94,6 @@ export function OrganizationSwitcher({
|
||||
navigate(`/organizations/${org.id}`);
|
||||
};
|
||||
|
||||
if (!hasOrganizations) {
|
||||
return <OrganizationSwitcherSkeleton />;
|
||||
}
|
||||
|
||||
return (
|
||||
<SidebarMenu>
|
||||
<SidebarMenuItem>
|
||||
|
||||
Reference in New Issue
Block a user