From 6474b85fbcbb8d9ef6545c596dbb22634fe3293c Mon Sep 17 00:00:00 2001 From: Ben White Date: Wed, 20 Dec 2023 15:16:39 +0100 Subject: [PATCH] feat: Add logout button for impersonation (#19445) --- frontend/src/layout/navigation/ProjectNotice.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/layout/navigation/ProjectNotice.tsx b/frontend/src/layout/navigation/ProjectNotice.tsx index 4155b6682ede8..d2fdc9af280d8 100644 --- a/frontend/src/layout/navigation/ProjectNotice.tsx +++ b/frontend/src/layout/navigation/ProjectNotice.tsx @@ -22,7 +22,7 @@ interface ProjectNoticeBlueprint { export function ProjectNotice(): JSX.Element | null { const { projectNoticeVariantWithClosability } = useValues(navigationLogic) const { currentOrganization } = useValues(organizationLogic) - const { updateCurrentTeam } = useActions(userLogic) + const { updateCurrentTeam, logout } = useActions(userLogic) const { user } = useValues(userLogic) const { closeProjectNotice } = useActions(navigationLogic) const { showInviteModal } = useActions(inviteLogic) @@ -104,6 +104,11 @@ export function ProjectNotice(): JSX.Element | null { is_impersonated: { message: 'You are currently impersonating another user.', type: 'warning', + action: { + 'data-attr': 'stop-impersonation-cta', + onClick: () => logout(), + children: 'Logout', + }, }, }