add: Verge Version copy button (#4164)

This commit is contained in:
Dyna
2025-07-23 11:11:34 +08:00
committed by GitHub
parent f209d17e3c
commit f580409ade
4 changed files with 26 additions and 3 deletions

View File

@@ -61,6 +61,12 @@ const SettingVergeAdvanced = ({ onError }: Props) => {
showNotice("success", t("Copy Success"), 1000);
}, []);
const copyVersion = useCallback(() => {
navigator.clipboard.writeText(`v${version}`).then(() => {
showNotice("success", t("Version copied to clipboard"), 1000);
});
}, [version, t]);
return (
<SettingList title={t("Verge Advanced Setting")}>
<ThemeViewer ref={themeRef} />
@@ -135,7 +141,16 @@ const SettingVergeAdvanced = ({ onError }: Props) => {
}
></SettingItem>
<SettingItem label={t("Verge Version")}>
<SettingItem
label={t("Verge Version")}
extra={
<TooltipIcon
icon={ContentCopyRounded}
onClick={copyVersion}
title={t("Copy Version")}
/>
}
>
<Typography sx={{ py: "7px", pr: 1 }}>v{version}</Typography>
</SettingItem>
</SettingList>