feat(frontend): locale for dates and tooltip for copy link button (#492)

* Add tooltip for copy button

* Set locale globally for moment.js

* format

* remove debugging log

* refactor: rename translation key

---------

Co-authored-by: Elias Schneider <login@eliasschneider.com>
This commit is contained in:
Leo Li
2024-06-10 17:01:59 +08:00
committed by GitHub
parent 962ec27df4
commit 1c7832ad1f
26 changed files with 3954 additions and 2008 deletions

View File

@@ -83,7 +83,7 @@ const CreateEnableTotpModal = ({
</span>
</Center>
<Tooltip label={t("account.modal.totp.clickToCopy")}>
<Tooltip label={t("common.button.clickToCopy")}>
<Button
onClick={() => {
navigator.clipboard.writeText(options.secret);

View File

@@ -53,10 +53,18 @@ function CopyTextField(props: { link: string }) {
</ActionIcon>
</a>
</Tooltip>
{window.isSecureContext && (
<ActionIcon onClick={copyLink}>
{checkState ? <TbCheck /> : <TbCopy />}
</ActionIcon>
<Tooltip
label={t("common.button.clickToCopy")}
position="top"
offset={-2}
openDelay={200}
>
<ActionIcon onClick={copyLink}>
{checkState ? <TbCheck /> : <TbCopy />}
</ActionIcon>
</Tooltip>
)}
</>
}