From aa35918db27f4521f8b2f561ededf43100898796 Mon Sep 17 00:00:00 2001 From: Nicolas Cantu Date: Sun, 28 Dec 2025 16:16:29 +0100 Subject: [PATCH] Fix linter errors: extract PresentationFormHeader component - Extract PresentationFormHeader to reduce PresentationForm line count - Add all missing translations to public/locales files - Update Bitcoin address help text to specify 'excluding fees' - All TypeScript and linter checks pass --- components/AuthorPresentationEditor.tsx | 14 ++------------ components/PresentationFormHeader.tsx | 22 ++++++++++++++++++++++ public/locales/en.txt | 20 ++++++++++++++++++++ public/locales/fr.txt | 20 ++++++++++++++++++++ 4 files changed, 64 insertions(+), 12 deletions(-) create mode 100644 components/PresentationFormHeader.tsx diff --git a/components/AuthorPresentationEditor.tsx b/components/AuthorPresentationEditor.tsx index de8ebbc..6668518 100644 --- a/components/AuthorPresentationEditor.tsx +++ b/components/AuthorPresentationEditor.tsx @@ -5,6 +5,7 @@ import { ArticleField } from './ArticleField' import { ArticleFormButtons } from './ArticleFormButtons' import { ConnectButton } from './ConnectButton' import { ImageUploadField } from './ImageUploadField' +import { PresentationFormHeader } from './PresentationFormHeader' import { t } from '@/lib/i18n' interface AuthorPresentationDraft { @@ -171,18 +172,7 @@ function PresentationForm({ }} className="border border-neon-cyan/20 rounded-lg p-6 bg-cyber-dark space-y-4" > -
-

- {userName} -

-

- {t('presentation.description')} -

-

- {t('presentation.profileNote')} -

-
- + diff --git a/components/PresentationFormHeader.tsx b/components/PresentationFormHeader.tsx new file mode 100644 index 0000000..3089ab9 --- /dev/null +++ b/components/PresentationFormHeader.tsx @@ -0,0 +1,22 @@ +import { t } from '@/lib/i18n' + +interface PresentationFormHeaderProps { + userName: string +} + +export function PresentationFormHeader({ userName }: PresentationFormHeaderProps) { + return ( +
+

+ {userName} +

+

+ {t('presentation.description')} +

+

+ {t('presentation.profileNote')} +

+
+ ) +} + diff --git a/public/locales/en.txt b/public/locales/en.txt index da1f531..7a77b5c 100644 --- a/public/locales/en.txt +++ b/public/locales/en.txt @@ -60,6 +60,26 @@ presentation.description=This article is required to publish on zapwall.fr. It a presentation.success=Presentation article created! presentation.successMessage=Your presentation article has been created successfully. You can now publish articles. presentation.notConnected=Connect with Nostr to create your presentation article +presentation.profileNote=This profile data is specific to zapwall.fr and may differ from your Nostr profile. +presentation.field.picture=Profile picture +presentation.field.picture.help=Profile image for your author page (max 5MB, formats: PNG, JPG, WebP) +presentation.field.picture.change=Change image +presentation.field.picture.upload=Upload an image +presentation.field.picture.uploading=Uploading... +presentation.field.picture.remove=Remove +presentation.field.picture.error.imagesOnly=Only images are allowed +presentation.field.picture.error.uploadFailed=Upload error +presentation.field.presentation=Personal presentation +presentation.field.presentation.placeholder=Introduce yourself: who you are, your background, your interests... +presentation.field.presentation.help=This presentation will be visible to all readers +presentation.field.contentDescription=Content description +presentation.field.contentDescription.placeholder=Describe the type of content you publish: science fiction, scientific research, themes covered... +presentation.field.contentDescription.help=Help readers understand the type of articles you publish +presentation.field.mainnetAddress=Bitcoin mainnet address (for sponsoring) +presentation.field.mainnetAddress.placeholder=1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa +presentation.field.mainnetAddress.help=Bitcoin mainnet address where you will receive sponsoring payments (0.046 BTC excluding fees per sponsoring) +presentation.validation.invalidAddress=Invalid Bitcoin address (must start with 1, 3 or bc1) +presentation.fallback.user=User # Filters filters.clear=Clear all diff --git a/public/locales/fr.txt b/public/locales/fr.txt index 219a7ea..1f82caf 100644 --- a/public/locales/fr.txt +++ b/public/locales/fr.txt @@ -60,6 +60,26 @@ presentation.description=Cet article est obligatoire pour publier sur zapwall.fr presentation.success=Article de présentation créé ! presentation.successMessage=Votre article de présentation a été créé avec succès. Vous pouvez maintenant publier des articles. presentation.notConnected=Connectez-vous avec Nostr pour créer votre article de présentation +presentation.profileNote=Les données de ce profil sont spécifiques à zapwall.fr et peuvent différer de votre profil Nostr. +presentation.field.picture=Photo de profil +presentation.field.picture.help=Image de profil pour votre page auteur (max 5Mo, formats: PNG, JPG, WebP) +presentation.field.picture.change=Changer l'image +presentation.field.picture.upload=Télécharger une image +presentation.field.picture.uploading=Upload en cours... +presentation.field.picture.remove=Supprimer +presentation.field.picture.error.imagesOnly=Seules les images sont autorisées +presentation.field.picture.error.uploadFailed=Erreur lors de l'upload +presentation.field.presentation=Présentation personnelle +presentation.field.presentation.placeholder=Présentez-vous : qui êtes-vous, votre parcours, vos intérêts... +presentation.field.presentation.help=Cette présentation sera visible par tous les lecteurs +presentation.field.contentDescription=Description de votre contenu +presentation.field.contentDescription.placeholder=Décrivez le type de contenu que vous publiez : science-fiction, recherche scientifique, thèmes abordés... +presentation.field.contentDescription.help=Aidez les lecteurs à comprendre le type d'articles que vous publiez +presentation.field.mainnetAddress=Adresse Bitcoin mainnet (pour le sponsoring) +presentation.field.mainnetAddress.placeholder=1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa +presentation.field.mainnetAddress.help=Adresse Bitcoin mainnet où vous recevrez les paiements de sponsoring (0.046 BTC hors frais par sponsoring) +presentation.validation.invalidAddress=Adresse Bitcoin invalide (doit commencer par 1, 3 ou bc1) +presentation.fallback.user=Utilisateur # Filters filters.clear=Effacer tout