diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index 5a2ae2448b..f1fa89331d 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -140,6 +140,7 @@ "slide_zoom_drag_instructions": "Slide to zoom, drag to reposition", "view_notifications": "View notifications", "view_public_page": "View public page", + "copy_public_page_link":"Copy public page link", "sign_out": "Sign out", "add_another": "Add another", "install_another": "Install another", diff --git a/packages/ui/v2/core/Shell.tsx b/packages/ui/v2/core/Shell.tsx index 6c25e8faf0..abbf53e120 100644 --- a/packages/ui/v2/core/Shell.tsx +++ b/packages/ui/v2/core/Shell.tsx @@ -30,6 +30,7 @@ import Dropdown, { import { Icon } from "@calcom/ui/Icon"; import TimezoneChangeDialog from "@calcom/ui/TimezoneChangeDialog"; import Button from "@calcom/ui/v2/core/Button"; +import showToast from "@calcom/ui/v2/core/notifications"; /* TODO: Get this from endpoint */ import pkg from "../../../../apps/web/package.json"; @@ -314,16 +315,33 @@ function UserDropdown({ small }: { small?: boolean }) { {user.username && ( - - - {" "} - {t("view_public_page")} - - + <> + + + {" "} + {t("view_public_page")} + + + + { + e.preventDefault(); + navigator.clipboard.writeText( + `${process.env.NEXT_PUBLIC_WEBSITE_URL}/${user.username}` + ); + showToast(t("link_copied"), "success"); + }} + className="flex items-center px-4 py-2 text-sm text-gray-700"> + {" "} + {t("copy_public_page_link")} + + + )}