Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use bold text instead of quotes around "delete" confirmation keyword #1953

Merged
merged 1 commit into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/1953.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use bold text instead of quotes around "delete" confirmation keyword
2 changes: 1 addition & 1 deletion playwright/tests/toolbar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ test.describe('My Accounts tab', () => {
await page.getByText('Delete Account').click()
await page.getByTestId('account-delete-confirmation-input').fill('foo')
await page.getByRole('button', { name: 'Yes, delete' }).click()
expect(page.getByText("Type 'delete'", { exact: true })).toBeVisible()
await expect(page.getByText('Type delete', { exact: true })).toBeVisible()
await page.getByTestId('account-delete-confirmation-input').fill('delete')
await page.getByRole('button', { name: 'Yes, delete' }).click()
await expect(page).not.toHaveURL(new RegExp(`/account/${mnemonicAddress0}`))
Expand Down
15 changes: 10 additions & 5 deletions src/app/components/DeleteInputForm/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ReactNode } from 'react'
import { Box } from 'grommet/es6/components/Box'
import { Button } from 'grommet/es6/components/Button'
import { useTranslation } from 'react-i18next'
import { Trans, useTranslation } from 'react-i18next'
import { TextInput } from 'grommet/es6/components/TextInput'
import { Form } from 'grommet/es6/components/Form'
import { FormField } from 'grommet/es6/components/FormField'
Expand All @@ -21,11 +21,16 @@ export function DeleteInputForm({ children, onCancel, onConfirm }: DeleteInputFo
<FormField
name="type_delete"
validate={(value: string | undefined) =>
!value || value.toLowerCase() !== t('deleteForm.confirmationKeyword', 'delete').toLowerCase()
? t('deleteForm.hint', `Type '{{confirmationKeyword}}'`, {
!value || value.toLowerCase() !== t('deleteForm.confirmationKeyword', 'delete').toLowerCase() ? (
<Trans
i18nKey="deleteForm.hint"
t={t}
defaults="Type <strong>{{confirmationKeyword}}</strong>"
values={{
confirmationKeyword: t('deleteForm.confirmationKeyword', 'delete'),
})
: undefined
}}
/>
) : undefined
}
>
<TextInput data-testid="account-delete-confirmation-input" id="type_delete" name="type_delete" />
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/Persist/DeleteProfileButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function DeleteProfileButton({ prominent, variant }: DeleteProfileButtonP
<Trans
t={t}
i18nKey="persist.loginToProfile.deleteProfile.description"
defaults="This will <strong>permanently remove your private keys from this device.</strong><br/><br/>To confirm and proceed, please type '{{confirmationKeyword}}' below."
defaults="This will <strong>permanently remove your private keys from this device.</strong><br/><br/>To confirm and proceed, please type <strong>{{confirmationKeyword}}</strong> below."
values={{
confirmationKeyword: t('deleteForm.confirmationKeyword', 'delete'),
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const DeleteAccount = ({ onCancel, onDelete, wallet }: DeleteAccountProps
<Paragraph fill textAlign="center">
{t(
'toolbar.settings.delete.inputHelp',
`This action cannot be undone. To continue please type '{{confirmationKeyword}}' below.`,
`This action cannot be undone. To continue please type <strong>{{confirmationKeyword}}</strong> below.`,
{
confirmationKeyword: t('deleteForm.confirmationKeyword', 'delete'),
},
Expand Down
4 changes: 2 additions & 2 deletions src/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"deleteForm": {
"confirm": "Ja, löschen",
"confirmationKeyword": "löschen",
"hint": "Typ '{{confirmationKeyword}}'"
"hint": "Eingeben <strong>{{confirmationKeyword}}</strong>"
},
"errors": {
"LedgerDerivedDifferentAccount": "Dieses Konto gehört nicht zu dem aktuell verbundenen Ledger.",
Expand Down Expand Up @@ -312,7 +312,7 @@
"contacts": "Kontakte",
"delete": {
"description": "Bist du sicher, dass du das folgende Konto löschen möchtest?",
"inputHelp": "Diese Aktion kann nicht rückgängig gemacht werden. Um fortzufahren, gib bitte '{{confirmationKeyword}}' unten ein.",
"inputHelp": "Diese Aktion kann nicht rückgängig gemacht werden. Um fortzufahren, gib bitte <strong>{{confirmationKeyword}}</strong> unten ein.",
"title": "Konto löschen",
"tooltip": "Du musst immer mindestens ein Konto haben."
},
Expand Down
6 changes: 3 additions & 3 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"deleteForm": {
"confirm": "Yes, delete",
"confirmationKeyword": "delete",
"hint": "Type '{{confirmationKeyword}}'"
"hint": "Type <strong>{{confirmationKeyword}}</strong>"
},
"errors": {
"LedgerDerivedDifferentAccount": "This account does not belong to the currently connected Ledger.",
Expand Down Expand Up @@ -415,7 +415,7 @@
"loginToProfile": {
"deleteProfile": {
"button": "Delete profile",
"description": "This will <strong>permanently remove your private keys from this device.</strong><br/><br/>To confirm and proceed, please type '{{confirmationKeyword}}' below.",
"description": "This will <strong>permanently remove your private keys from this device.</strong><br/><br/>To confirm and proceed, please type <strong>{{confirmationKeyword}}</strong> below.",
"forgotPasswordButton": "Forgot password?",
"forgotPasswordDescription": "ROSE Wallet does not store your password and cannot help you retrieve it. If you forgot your password, you can delete your locked profile here. After that, you can create a new one using your mnemonic phrase or private keys, and use your ROSE tokens again.",
"title": "Delete Profile"
Expand Down Expand Up @@ -483,7 +483,7 @@
"contacts": "Contacts",
"delete": {
"description": "Are you sure you want to delete the following account?",
"inputHelp": "This action cannot be undone. To continue please type '{{confirmationKeyword}}' below.",
"inputHelp": "This action cannot be undone. To continue please type <strong>{{confirmationKeyword}}</strong> below.",
"title": "Delete Account",
"tooltip": "You must have at least one account at all times."
},
Expand Down
4 changes: 2 additions & 2 deletions src/locales/sl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"deleteForm": {
"confirm": "Da, izbriši",
"confirmationKeyword": "izbriši",
"hint": "Vtipkajte '{{confirmationKeyword}}'"
"hint": "Vtipkajte <strong>{{confirmationKeyword}}</strong>"
},
"errors": {
"LedgerDerivedDifferentAccount": "Račun ne pripada trenutno povezanemu Ledgerju",
Expand Down Expand Up @@ -460,7 +460,7 @@
"contacts": "Stiki",
"delete": {
"description": "Ali ste prepričani, da želite izbrisati ta račun?",
"inputHelp": "Tega ne bo mogoče razveljaviti. Če želite nadaljevati vnesite '{{confirmationKeyword}}'.",
"inputHelp": "Tega ne bo mogoče razveljaviti. Če želite nadaljevati vnesite <strong>{{confirmationKeyword}}</strong>.",
"title": "Izbriši Račun",
"tooltip": "V denarnici morate imeti vsaj en račun."
},
Expand Down
4 changes: 2 additions & 2 deletions src/locales/tr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"deleteForm": {
"confirm": "Evet, Sil",
"confirmationKeyword": "Sil",
"hint": "'{{confirmationKeyword}}' yazın"
"hint": "<strong>{{confirmationKeyword}}</strong> yazın"
},
"errors": {
"LedgerDerivedDifferentAccount": "Bu hesap şu anda bağlı olan Ledger'a ait değil.",
Expand Down Expand Up @@ -446,7 +446,7 @@
"contacts": "Kontaklar",
"delete": {
"description": "Aşağıdaki hesabı silmek istediğinizden emin misiniz?",
"inputHelp": "Bu eylem geri alınamaz. Devam etmek için lütfen aşağıya {{confirmationKeyword}} girin.",
"inputHelp": "Bu eylem geri alınamaz. Devam etmek için lütfen aşağıya <strong>{{confirmationKeyword}}</strong> girin.",
"title": "Hesabı sil",
"tooltip": "Her zaman en az bir hesabınızın olması gerekir."
},
Expand Down
Loading