This commit is contained in:
aet 2021-12-19 02:06:15 -05:00
parent e16202f8b2
commit 7362222f16
3 changed files with 28 additions and 4 deletions

View File

@ -2,6 +2,7 @@ import styled from "@emotion/styled"
import type { ItemSection, ItemField } from "opvault.js"
import { FieldType } from "opvault.js"
import { useCallback, useMemo, useState } from "react"
import { useTranslate } from "../i18n"
import { parseMonthYear } from "../utils"
import { BigTextView } from "./BigTextView"
import { ErrorBoundary } from "./ErrorBoundary"
@ -31,6 +32,7 @@ export { Password as PasswordFieldView }
const Password: React.FC<{
field: Pick<ItemSection.Concealed, "v">
}> = ({ field }) => {
const t = useTranslate()
const [show, setShow] = useState(false)
const [bigText, showBigText] = useState(false)
@ -59,9 +61,11 @@ const Password: React.FC<{
</Container>
{bigText && <BigTextView onClose={onCloseBigText}>{field.v}</BigTextView>}
<ContextMenuContainer>
<Item onClick={onCopy}>Copier</Item>
<Item onClick={onToggle}>{show ? "Cacher" : "Afficher"}</Item>
{!bigText && <Item onClick={onOpenBigText}>Afficher en gros caractères</Item>}
<Item onClick={onCopy}>{t.action.copy}</Item>
<Item onClick={onToggle}>{show ? t.action.hide : t.action.show}</Item>
{!bigText && (
<Item onClick={onOpenBigText}>{t.action.show_in_big_characters}</Item>
)}
</ContextMenuContainer>
</>
)

View File

@ -103,6 +103,26 @@ action:
fr: Déverouiller
ja: ロック解除
copy:
en: Copy
fr: Copier
ja: コピー
hide:
en: Hide
fr: Cacher
ja: 非表示
show:
en: Show
fr: Afficher
ja: 表示
show_in_big_characters:
en: Show in large characters
fr: Afficher en gros caractères
ja: 大きく表示
go_back:
en: Back
fr: Revenir

View File

@ -158,7 +158,7 @@ export const VaultView: React.FC<{ vault: Vault; onLock(): void }> = ({
<TabButton onClick={onLock} title={t.action.lock}>
<FiLock />
</TabButton>
<TabButton onClick={() => setShowSettings(true)}>
<TabButton onClick={() => setShowSettings(true)} title={t.label.settings}>
<BsGear />
</TabButton>
</TabContainer>