chore: added impersonation to sidebar for admins (#19228)
This commit is contained in:
1 parent
552d88ad6d
commit
662ba8dfc6
1 file changed
+10
@@ -11,6 +11,7 @@ import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage";
|
||||
import { getBookerBaseUrlSync } from "@calcom/lib/getBookerUrl/client";
|
||||
import { useCopy } from "@calcom/lib/hooks/useCopy";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { UserPermissionRole } from "@calcom/prisma/enums";
|
||||
import { Avatar, ButtonOrLink, Credits, Icon, SkeletonText, Tooltip, Logo, showToast } from "@calcom/ui";
|
||||
|
||||
import { KBarTrigger } from "../kbar/Kbar";
|
||||
@@ -46,11 +47,13 @@ export function SideBarContainer({ bannersHeight, isPlatformUser = false }: Side
|
||||
}
|
||||
|
||||
export function SideBar({ bannersHeight, user }: SideBarProps) {
|
||||
const session = useSession();
|
||||
const { fetchAndCopyToClipboard } = useCopy();
|
||||
const { t, isLocaleReady } = useLocale();
|
||||
const pathname = usePathname();
|
||||
const isPlatformPages = pathname?.startsWith("/settings/platform");
|
||||
const [isReferalLoading, setIsReferalLoading] = useState(false);
|
||||
const isAdmin = session.data?.user.role === UserPermissionRole.ADMIN;
|
||||
|
||||
const publicPageUrl = `${getBookerBaseUrlSync(user?.org?.slug ?? null)}/${user?.username}`;
|
||||
|
||||
@@ -104,6 +107,13 @@ export function SideBar({ bannersHeight, user }: SideBarProps) {
|
||||
isLoading: isReferalLoading,
|
||||
}
|
||||
: null,
|
||||
isAdmin
|
||||
? {
|
||||
name: "impersonation",
|
||||
href: "/settings/security/impersonation",
|
||||
icon: "lock",
|
||||
}
|
||||
: null,
|
||||
{
|
||||
name: "settings",
|
||||
href: user?.org ? `/settings/organizations/profile` : "/settings/my-account/profile",
|
||||
|
||||
Reference in new issue
Block a user