copy to cliboard

This commit is contained in:
hamid zarghami
2025-08-02 09:28:02 +03:30
parent fd542a7868
commit ae56486404
2 changed files with 8 additions and 2 deletions
+2 -1
View File
@@ -154,7 +154,8 @@
"disable_2fa": "غیر فعال کردن دو مرحله ای",
"enter_2fa_code": "کد دو مرحله ای خود را وارد کنید",
"cancel": "انصراف",
"confirm_disable": "تایید غیر فعال سازی"
"confirm_disable": "تایید غیر فعال سازی",
"seed_copied": "کد پشتیبان با موفقیت کپی شد"
},
"confrim": {
"subject": "حذف",
+6 -1
View File
@@ -67,6 +67,11 @@ const TwoFactor: FC = () => {
setToken(value)
}
const handleCopySeed = (seed: string) => {
navigator.clipboard.writeText(seed)
toast(t('setting.seed_copied'), 'success')
}
if (isEnabled) {
return (
<Enabled />
@@ -124,7 +129,7 @@ const TwoFactor: FC = () => {
</div>
<div className='text-xs text-gray-500 bg-gray-50 p-3 rounded-lg'>
<div className='font-medium mb-1'>{t('setting.manual_entry')}:</div>
<div className='font-mono break-all text-gray-700'>{qrData.seed}</div>
<div onClick={() => handleCopySeed(qrData.seed)} className='font-mono break-all text-gray-700 cursor-pointer'>{qrData.seed}</div>
</div>
</div>