From 055465ac7bc9cb9131c7947495f0d8179e6e45b4 Mon Sep 17 00:00:00 2001 From: Nicolas Cantu Date: Wed, 14 Jan 2026 00:50:05 +0100 Subject: [PATCH] create for series --- components/ArticlePages.tsx | 9 ++- components/CacheUpdateManager.tsx | 26 ++----- .../NoAccountView.tsx | 21 ++--- components/reviewForms/ReviewFormView.tsx | 78 +++++++++---------- components/reviewForms/ReviewTipFormView.tsx | 45 +++++------ 5 files changed, 78 insertions(+), 101 deletions(-) diff --git a/components/ArticlePages.tsx b/components/ArticlePages.tsx index 26e1f6a..ce54c87 100644 --- a/components/ArticlePages.tsx +++ b/components/ArticlePages.tsx @@ -1,4 +1,5 @@ import type { Page } from '@/types/nostr' +import { Card } from './ui' import { t } from '@/lib/i18n' import { useNostrAuth } from '@/hooks/useNostrAuth' import { useEffect, useState } from 'react' @@ -28,10 +29,10 @@ function LockedPagesView({ pagesCount }: { pagesCount: number }): React.ReactEle return (

{t('article.pages.title')}

-
+

{t('article.pages.locked.title')}

{t('article.pages.locked.message', { count: pagesCount })}

-
+
) } @@ -98,7 +99,7 @@ function isUserPurchase({ function PageDisplay({ page }: { page: Page }): React.ReactElement { return ( -
+

{t('page.number', { number: page.number })} @@ -124,6 +125,6 @@ function PageDisplay({ page }: { page: Page }): React.ReactElement { )}

)} -
+ ) } diff --git a/components/CacheUpdateManager.tsx b/components/CacheUpdateManager.tsx index ba2dcaa..9230b7b 100644 --- a/components/CacheUpdateManager.tsx +++ b/components/CacheUpdateManager.tsx @@ -2,6 +2,7 @@ import { useState } from 'react' import { useRouter } from 'next/router' import { nostrAuthService } from '@/lib/nostrAuth' import { objectCache } from '@/lib/objectCache' +import { Button, ErrorState } from './ui' async function updateCache(): Promise { const state = nostrAuthService.getState() @@ -28,14 +29,6 @@ async function updateCache(): Promise { } } -function ErrorMessage({ error }: { error: string }): React.ReactElement { - return ( -
-

{error}

-
- ) -} - function SuccessMessage(): React.ReactElement { return (
@@ -78,12 +71,6 @@ function createUpdateHandler( } } -function Spinner(): React.ReactElement { - return ( -
- ) -} - export function CacheUpdateManager(): React.ReactElement { const router = useRouter() const [updating, setUpdating] = useState(false) @@ -102,20 +89,21 @@ export function CacheUpdateManager(): React.ReactElement { Cela permet de récupérer les dernières versions de vos publications, séries et profil.

- {error && } + {error && } {success && } {!isConnected && } - +
) } diff --git a/components/authorPresentationEditor/NoAccountView.tsx b/components/authorPresentationEditor/NoAccountView.tsx index 39a9a84..37e373b 100644 --- a/components/authorPresentationEditor/NoAccountView.tsx +++ b/components/authorPresentationEditor/NoAccountView.tsx @@ -2,6 +2,7 @@ import { useState } from 'react' import { CreateAccountModal } from '../CreateAccountModal' import { RecoveryStep } from '../CreateAccountModalSteps' import { UnlockAccountModal } from '../UnlockAccountModal' +import { Button, Card } from '../ui' import { t } from '@/lib/i18n' export function NoAccountView(): React.ReactElement { @@ -50,20 +51,12 @@ export function NoAccountView(): React.ReactElement { function NoAccountActionButtons(params: { onGenerate: () => void; onImport: () => void }): React.ReactElement { return (
- - + +
) } @@ -76,7 +69,7 @@ function NoAccountCard(params: { modals: React.ReactElement }): React.ReactElement { return ( -
+

Créez un compte ou importez votre clé secrète pour commencer

{params.error ?

{params.error}

: null} @@ -84,7 +77,7 @@ function NoAccountCard(params: { {params.generating ?

Génération du compte...

: null} {params.modals}
-
+ ) } diff --git a/components/reviewForms/ReviewFormView.tsx b/components/reviewForms/ReviewFormView.tsx index f0dca86..986632f 100644 --- a/components/reviewForms/ReviewFormView.tsx +++ b/components/reviewForms/ReviewFormView.tsx @@ -1,19 +1,21 @@ import React from 'react' -import { Button, ErrorState } from '@/components/ui' +import { Button, ErrorState, Input, Textarea, Card } from '@/components/ui' import { t } from '@/lib/i18n' import type { ReviewFormController } from './useReviewFormController' export function ReviewFormView(params: { ctrl: ReviewFormController; onCancel?: () => void }): React.ReactElement { return ( -
void params.ctrl.handleSubmit(e)} - className="border border-neon-cyan/30 rounded-lg p-4 bg-cyber-dark space-y-4" - > - - - {params.ctrl.error ? : null} - - + +
void params.ctrl.handleSubmit(e)} + className="space-y-4" + > + + + {params.ctrl.error ? : null} + + +
) } @@ -94,20 +96,16 @@ function TextInput(params: { placeholder: string optionalLabel?: string }): React.ReactElement { + const labelText = params.optionalLabel ? `${params.label} ${params.optionalLabel}` : params.label return ( -
- - params.onChange(e.target.value)} - placeholder={params.placeholder} - className="w-full px-3 py-2 bg-cyber-darker border border-neon-cyan/30 rounded text-cyber-accent focus:border-neon-cyan focus:outline-none" - /> -
+ params.onChange(e.target.value)} + placeholder={params.placeholder} + /> ) } @@ -123,23 +121,23 @@ function TextAreaInput(params: { optionalLabel?: string helpText?: string }): React.ReactElement { + let labelText = params.label + if (params.requiredMark) { + labelText = `${labelText} *` + } + if (params.optionalLabel) { + labelText = `${labelText} ${params.optionalLabel}` + } return ( -
- -