From fc6805afcc73900162df5ee7742c22450d9f8ec0 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 3 May 2022 22:01:04 +0800 Subject: ... --- FrontEnd/src/views/settings/index.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'FrontEnd/src/views/settings') diff --git a/FrontEnd/src/views/settings/index.tsx b/FrontEnd/src/views/settings/index.tsx index 3cd5d889..31726dc2 100644 --- a/FrontEnd/src/views/settings/index.tsx +++ b/FrontEnd/src/views/settings/index.tsx @@ -16,6 +16,7 @@ import ChangeAvatarDialog from "./ChangeAvatarDialog"; import ChangeNicknameDialog from "./ChangeNicknameDialog"; import "./index.css"; +import { pushAlert } from "@/services/alert"; interface SettingSectionProps { title: I18nText; @@ -196,7 +197,22 @@ const SettingsPage: React.FC = (_) => { ) : registerCode === null ? ( Noop ) : ( - {registerCode} + { + void navigator.clipboard + .writeText(registerCode) + .then(() => { + pushAlert({ + type: "success", + message: "settings.myRegisterCodeCopied", + }); + }); + event.stopPropagation(); + }} + > + {registerCode} + )}