From 62baee44fe4dba3be711649122e57e7892d5c1f7 Mon Sep 17 00:00:00 2001 From: Finley Ge <32237950+FinleyGe@users.noreply.github.com> Date: Thu, 13 Mar 2025 17:39:18 +0800 Subject: [PATCH] pref: copy link (#4147) --- packages/web/i18n/en/account_team.json | 3 ++- packages/web/i18n/zh-CN/account_team.json | 3 ++- packages/web/i18n/zh-Hant/account_team.json | 3 ++- .../account/team/Invite/InviteModal.tsx | 17 ++++++++++++++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/packages/web/i18n/en/account_team.json b/packages/web/i18n/en/account_team.json index 320a079cb..ea1f723d2 100644 --- a/packages/web/i18n/en/account_team.json +++ b/packages/web/i18n/en/account_team.json @@ -58,5 +58,6 @@ "user_team_invite_member": "Invite members", "user_team_leave_team": "Leave the team", "user_team_leave_team_failed": "Failure to leave the team", - "waiting": "To be accepted" + "waiting": "To be accepted", + "invitation_copy_link": "[{{systemName}}] {{userName}} invites you to join the {{teamName}} team, link: {{url}}" } diff --git a/packages/web/i18n/zh-CN/account_team.json b/packages/web/i18n/zh-CN/account_team.json index ad2138e82..7f140b3b0 100644 --- a/packages/web/i18n/zh-CN/account_team.json +++ b/packages/web/i18n/zh-CN/account_team.json @@ -73,5 +73,6 @@ "user_team_invite_member": "邀请成员", "user_team_leave_team": "离开团队", "user_team_leave_team_failed": "离开团队失败", - "waiting": "待接受" + "waiting": "待接受", + "invitation_copy_link": "【{{systemName}}】 {{userName}} 邀请您加入{{teamName}}团队,链接:{{url}}" } diff --git a/packages/web/i18n/zh-Hant/account_team.json b/packages/web/i18n/zh-Hant/account_team.json index 8e28b5ae1..a37ab2604 100644 --- a/packages/web/i18n/zh-Hant/account_team.json +++ b/packages/web/i18n/zh-Hant/account_team.json @@ -58,5 +58,6 @@ "user_team_invite_member": "邀請成員", "user_team_leave_team": "離開團隊", "user_team_leave_team_failed": "離開團隊失敗", - "waiting": "待接受" + "waiting": "待接受", + "invitation_copy_link": "【{{systemName}}】 {{userName}} 邀請您加入{{teamName}}團隊,連結:{{url}}" } diff --git a/projects/app/src/pageComponents/account/team/Invite/InviteModal.tsx b/projects/app/src/pageComponents/account/team/Invite/InviteModal.tsx index 99860a5d0..744941e37 100644 --- a/projects/app/src/pageComponents/account/team/Invite/InviteModal.tsx +++ b/projects/app/src/pageComponents/account/team/Invite/InviteModal.tsx @@ -1,5 +1,7 @@ import MemberTag from '@/components/support/user/team/Info/MemberTag'; +import { useSystemStore } from '@/web/common/system/useSystemStore'; import { getInvitationLinkList, putUpdateInvitationInfo } from '@/web/support/user/team/api'; +import { useUserStore } from '@/web/support/user/useUserStore'; import { Box, Button, @@ -56,10 +58,23 @@ const InviteModal = ({ const isLoading = isLoadingLink; const { copyData } = useCopyData(); + const { userInfo } = useUserStore(); + const { feConfigs } = useSystemStore(); const onCopy = useCallback( (linkId: string) => { - copyData(location.origin + `/account/team?invitelinkid=${linkId}`); + const url = location.origin + `/account/team?invitelinkid=${linkId}`; + const teamName = userInfo?.team.teamName; + const systemName = feConfigs.systemTitle; + const userName = userInfo?.team.memberName; + copyData( + t('account_team:invitation_copy_link', { + teamName, + systemName, + userName, + url + }) + ); }, [copyData] );