From 189c30efc700bcb758729f9bd4e3478c0a37e557 Mon Sep 17 00:00:00 2001 From: Nicolay Arefyeu Date: Tue, 19 Mar 2024 17:17:32 +0200 Subject: [PATCH 1/2] Add invite link inside share Workspace --- src/pages/workspace/WorkspaceProfileSharePage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceProfileSharePage.tsx b/src/pages/workspace/WorkspaceProfileSharePage.tsx index 56fd8b783742..0bb6eefa28a4 100644 --- a/src/pages/workspace/WorkspaceProfileSharePage.tsx +++ b/src/pages/workspace/WorkspaceProfileSharePage.tsx @@ -32,9 +32,11 @@ function WorkspaceProfileSharePage({policy}: WithPolicyProps) { const policyName = policy?.name ?? ''; const id = policy?.id ?? ''; + const adminEmail = policy?.owner ?? ''; const urlWithTrailingSlash = Url.addTrailingForwardSlash(environmentURL); - const url = `${urlWithTrailingSlash}${ROUTES.WORKSPACE_PROFILE.getRoute(id)}`; + const url = `${urlWithTrailingSlash}${ROUTES.WORKSPACE_JOIN_USER.getRoute(id, adminEmail)}`; + return ( Date: Wed, 20 Mar 2024 09:42:38 +0200 Subject: [PATCH 2/2] use email from session --- src/pages/workspace/WorkspaceProfileSharePage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceProfileSharePage.tsx b/src/pages/workspace/WorkspaceProfileSharePage.tsx index 0bb6eefa28a4..340c63c19ea7 100644 --- a/src/pages/workspace/WorkspaceProfileSharePage.tsx +++ b/src/pages/workspace/WorkspaceProfileSharePage.tsx @@ -6,6 +6,7 @@ import ContextMenuItem from '@components/ContextMenuItem'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import * as Expensicons from '@components/Icon/Expensicons'; import MenuItem from '@components/MenuItem'; +import {useSession} from '@components/OnyxProvider'; import QRShareWithDownload from '@components/QRShare/QRShareWithDownload'; import type QRShareWithDownloadHandle from '@components/QRShare/QRShareWithDownload/types'; import ScreenWrapper from '@components/ScreenWrapper'; @@ -29,10 +30,11 @@ function WorkspaceProfileSharePage({policy}: WithPolicyProps) { const {environmentURL} = useEnvironment(); const qrCodeRef = useRef(null); const {isSmallScreenWidth} = useWindowDimensions(); + const session = useSession(); const policyName = policy?.name ?? ''; const id = policy?.id ?? ''; - const adminEmail = policy?.owner ?? ''; + const adminEmail = session?.email ?? ''; const urlWithTrailingSlash = Url.addTrailingForwardSlash(environmentURL); const url = `${urlWithTrailingSlash}${ROUTES.WORKSPACE_JOIN_USER.getRoute(id, adminEmail)}`;