aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/views
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-05-03 22:01:04 +0800
committercrupest <crupest@outlook.com>2022-05-03 22:01:04 +0800
commitfc6805afcc73900162df5ee7742c22450d9f8ec0 (patch)
treef5a3301a3097aeb040daabe33743871444eaa295 /FrontEnd/src/views
parent28ee8811b60e782f1b8d556f5c73f64d49d1707b (diff)
downloadtimeline-fc6805afcc73900162df5ee7742c22450d9f8ec0.tar.gz
timeline-fc6805afcc73900162df5ee7742c22450d9f8ec0.tar.bz2
timeline-fc6805afcc73900162df5ee7742c22450d9f8ec0.zip
...
Diffstat (limited to 'FrontEnd/src/views')
-rw-r--r--FrontEnd/src/views/settings/index.tsx18
1 files changed, 17 insertions, 1 deletions
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 ? (
<span>Noop</span>
) : (
- <code className="register-code">{registerCode}</code>
+ <code
+ className="register-code"
+ onClick={(event) => {
+ void navigator.clipboard
+ .writeText(registerCode)
+ .then(() => {
+ pushAlert({
+ type: "success",
+ message: "settings.myRegisterCodeCopied",
+ });
+ });
+ event.stopPropagation();
+ }}
+ >
+ {registerCode}
+ </code>
)}
</SettingItemContainer>
<ButtonSettingItem