2FA screens: plain en/pl texts and tab title; CookieButton moves up above the footer

- TOTP_TEXTS (admin-ux.md wording) merged over @clocklimited/payload-2fa's
  long, informal texts; the project's i18n.translations still win;
  twoFactor.texts: false keeps the package's. Setup/verify screens titled
  "Two-step verification" / "Weryfikacja dwuetapowa" instead of "Payload".
- CookieButton: position via --ipal-cookie-button-offset / -inset and
  --ipal-z-header; lifts above the footer (avoid, default COOKIE_BUTTON_AVOID)
  while it is on screen; side prop; className still replaces the look.
- dev: a footer in the frontend layout to check the button against.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-29 15:34:01 +01:00
co-authored by Claude Opus 5.5
parent d992d131a2
commit 2886c89d8a
15 changed files with 281 additions and 11 deletions
+51
View File
@@ -0,0 +1,51 @@
/**
* Texts of the 2FA screens and the user field (@clocklimited/payload-2fa reads
* them as `totpPlugin:*` through Payload's i18n). The package ships long,
* informal texts; these follow docs/dev/admin-ux.md. ipalKit merges them over
* the package's and under the project's own `i18n.translations`, so a project
* still overrides any key. `setup.description` is rendered as HTML by the package.
*/
const AUTHENTICATOR =
'<a href="https://support.google.com/accounts/answer/1066447" target="_blank" rel="nofollow noopener noreferrer">Google Authenticator</a>'
export const TOTP_TEXTS = {
en: {
totpPlugin: {
authApp: 'Authenticator app',
configured: 'Set up',
errors: { alreadySet: 'Two-step verification is already set up.' },
fieldDescription: 'Codes from an authenticator app protect this account.',
forceTotp: { description: 'The user must set up two-step verification.', label: 'Require 2FA' },
setup: {
addCodeManually: 'Enter the key manually',
button: 'Set up',
description: `Scan the QR code with an authenticator app, e.g. ${AUTHENTICATOR} or Microsoft Authenticator.`,
enterCode: 'Enter the {digits}-digit code from the app:',
incorrectCode: 'Incorrect code. Check the time on your phone or scan the QR code again.',
title: 'Set up two-step verification',
},
verify: { title: 'Two-step verification' },
},
},
pl: {
totpPlugin: {
authApp: 'Aplikacja uwierzytelniająca',
configured: 'Skonfigurowano',
errors: { alreadySet: 'Weryfikacja dwuetapowa jest już skonfigurowana.' },
fieldDescription: 'Kody z aplikacji uwierzytelniającej chronią to konto.',
forceTotp: { description: 'Użytkownik musi skonfigurować weryfikację dwuetapową.', label: 'Wymagaj 2FA' },
setup: {
addCodeManually: 'Wpisz klucz ręcznie',
button: 'Skonfiguruj',
description: `Zeskanuj kod QR aplikacją uwierzytelniającą, np. ${AUTHENTICATOR} lub Microsoft Authenticator.`,
enterCode: 'Wpisz {digits}-cyfrowy kod z aplikacji:',
incorrectCode: 'Nieprawidłowy kod. Sprawdź czas w telefonie lub zeskanuj kod QR ponownie.',
title: 'Konfiguracja weryfikacji dwuetapowej',
},
verify: { title: 'Weryfikacja dwuetapowa' },
},
},
}
/** Browser-tab title of the 2FA screens (Payload view meta is a plain string: the site's language). */
export const TOTP_VIEW_TITLE = { en: 'Two-step verification', pl: 'Weryfikacja dwuetapowa' }