From fb0457b8d6c08a977e1d2c7c1c2a4a2b29679fe6 Mon Sep 17 00:00:00 2001 From: Nicolas Cantu Date: Wed, 14 Jan 2026 01:08:33 +0100 Subject: [PATCH] create for series --- components/ConnectedUserMenu.tsx | 8 +- components/ImageUploadField.tsx | 17 +-- components/ProfileSeriesBlock.tsx | 7 +- components/SeriesCard.tsx | 8 +- components/UserArticlesList.tsx | 15 ++- components/authorPage/SeriesList.tsx | 7 +- components/authorPage/SponsoringSummary.tsx | 7 +- .../AuthorPresentationEditor.tsx | 10 +- .../PresentationForm.tsx | 23 ++-- .../CreateSeriesModalView.tsx | 62 ++++------ .../KeyManagementImportSection.tsx | 8 +- components/nip95Config/Nip95ConfigContent.tsx | 19 +-- .../relayManager/RelayManagerContent.tsx | 19 +-- components/syncProgressBar/view.tsx | 16 +-- hooks/useAuthorPresentation.ts | 15 --- lib/authorQueries.ts | 19 +++ lib/nostr/service.ts | 116 ++++++++++++++---- lib/nostrAuth.ts | 11 +- pages/profile.tsx | 17 ++- 19 files changed, 252 insertions(+), 152 deletions(-) diff --git a/components/ConnectedUserMenu.tsx b/components/ConnectedUserMenu.tsx index afdc6f2..1387ec6 100644 --- a/components/ConnectedUserMenu.tsx +++ b/components/ConnectedUserMenu.tsx @@ -1,5 +1,6 @@ import Image from 'next/image' import Link from 'next/link' +import { Button } from './ui' import type { NostrProfile } from '@/types/nostr' import { NotificationCenter } from './NotificationCenter' @@ -36,13 +37,14 @@ export function ConnectedUserMenu({ )} {displayName} - + ) } diff --git a/components/ImageUploadField.tsx b/components/ImageUploadField.tsx index f681fb8..b3ecd82 100644 --- a/components/ImageUploadField.tsx +++ b/components/ImageUploadField.tsx @@ -1,5 +1,6 @@ import { useState } from 'react' import { uploadNip95Media } from '@/lib/nip95' +import { Button } from './ui' import { t } from '@/lib/i18n' import Image from 'next/image' import { UnlockAccountModal } from './UnlockAccountModal' @@ -37,13 +38,14 @@ function RemoveButton({ value, onChange }: { value: string | undefined; onChange return null } return ( - + ) } @@ -62,11 +64,10 @@ function ImageUploadControls({ }): React.ReactElement { return (
-
) diff --git a/components/SeriesCard.tsx b/components/SeriesCard.tsx index 8da48a7..be09c21 100644 --- a/components/SeriesCard.tsx +++ b/components/SeriesCard.tsx @@ -1,5 +1,6 @@ import Image from 'next/image' import Link from 'next/link' +import { Button } from './ui' import type { Series } from '@/types/nostr' import { t } from '@/lib/i18n' @@ -33,13 +34,14 @@ export function SeriesCard({ series, onSelect, selected }: SeriesCardProps): Rea

{series.description}

{series.category === 'science-fiction' ? t('category.science-fiction') : t('category.scientific-research')} - +
diff --git a/components/UserArticlesList.tsx b/components/UserArticlesList.tsx index 0328901..c1024d7 100644 --- a/components/UserArticlesList.tsx +++ b/components/UserArticlesList.tsx @@ -1,4 +1,5 @@ import { ArticleCard } from './ArticleCard' +import { Button } from './ui' import type { Article } from '@/types/nostr' import { memo } from 'react' import Link from 'next/link' @@ -56,19 +57,21 @@ function ArticleActions({ }): React.ReactElement { return (
- - +
) } diff --git a/components/authorPage/SeriesList.tsx b/components/authorPage/SeriesList.tsx index edda1ba..b6487c5 100644 --- a/components/authorPage/SeriesList.tsx +++ b/components/authorPage/SeriesList.tsx @@ -2,6 +2,7 @@ import Link from 'next/link' import { useState } from 'react' import { CreateSeriesModal } from '@/components/CreateSeriesModal' import { SeriesCard } from '@/components/SeriesCard' +import { Button } from '@/components/ui' import { useNostrAuth } from '@/hooks/useNostrAuth' import { t } from '@/lib/i18n' import type { Series } from '@/types/nostr' @@ -30,13 +31,13 @@ function SeriesListHeader(params: { isAuthor: boolean; onCreate: () => void }):

{t('series.title')}

{params.isAuthor && ( - + )}
) diff --git a/components/authorPage/SponsoringSummary.tsx b/components/authorPage/SponsoringSummary.tsx index 07dd2d3..fc89582 100644 --- a/components/authorPage/SponsoringSummary.tsx +++ b/components/authorPage/SponsoringSummary.tsx @@ -1,4 +1,5 @@ import { useState } from 'react' +import { Button } from '@/components/ui' import { SponsoringForm } from '@/components/SponsoringForm' import { t } from '@/lib/i18n' import type { AuthorPresentationArticle } from '@/types/nostr' @@ -27,12 +28,12 @@ function SponsoringSummaryHeader(params: { showSponsorButton: boolean; onSponsor

{t('author.sponsoring')}

{params.showSponsorButton && ( - + )}
) diff --git a/components/authorPresentationEditor/AuthorPresentationEditor.tsx b/components/authorPresentationEditor/AuthorPresentationEditor.tsx index 6872240..26c6678 100644 --- a/components/authorPresentationEditor/AuthorPresentationEditor.tsx +++ b/components/authorPresentationEditor/AuthorPresentationEditor.tsx @@ -1,6 +1,7 @@ import { useEffect } from 'react' import { useNostrAuth } from '@/hooks/useNostrAuth' import { useAuthorPresentation } from '@/hooks/useAuthorPresentation' +import { Button } from '../ui' import { t } from '@/lib/i18n' import { NoAccountView } from './NoAccountView' import { PresentationForm } from './PresentationForm' @@ -14,11 +15,10 @@ function SuccessNotice(params: { pubkey: string | null }): React.ReactElement {

{t('presentation.successMessage')}

{params.pubkey ? (
- - {t('presentation.manageSeries')} + +
) : null} diff --git a/components/authorPresentationEditor/PresentationForm.tsx b/components/authorPresentationEditor/PresentationForm.tsx index 33d24a0..1c8a386 100644 --- a/components/authorPresentationEditor/PresentationForm.tsx +++ b/components/authorPresentationEditor/PresentationForm.tsx @@ -1,5 +1,6 @@ import type { FormEvent } from 'react' import { PresentationFormHeader } from '../PresentationFormHeader' +import { Button, ErrorState } from '../ui' import { t } from '@/lib/i18n' import { PresentationFields } from './fields' import type { AuthorPresentationDraft } from './types' @@ -29,13 +30,15 @@ export function PresentationForm(props: PresentationFormProps): React.ReactEleme
- +
{props.hasExistingPresentation ? : null}
@@ -47,23 +50,21 @@ function ValidationError(params: { message: string | null }): React.ReactElement if (!params.message) { return null } - return ( -
-

{params.message}

-
- ) + return } function DeleteButton(params: { onDelete: () => void; deleting: boolean }): React.ReactElement { return ( - + ) } diff --git a/components/createSeriesModal/CreateSeriesModalView.tsx b/components/createSeriesModal/CreateSeriesModalView.tsx index ef39ec9..4011bdc 100644 --- a/components/createSeriesModal/CreateSeriesModalView.tsx +++ b/components/createSeriesModal/CreateSeriesModalView.tsx @@ -1,5 +1,6 @@ import React from 'react' import { ImageUploadField } from '../ImageUploadField' +import { Button, Input, Textarea } from '../ui' import { t } from '@/lib/i18n' import type { SeriesDraft } from './createSeriesModalTypes' import type { CreateSeriesModalController } from './useCreateSeriesModalController' @@ -145,21 +146,22 @@ function SeriesError({ error }: { error: string | null }): React.ReactElement | function SeriesActions(params: { loading: boolean; canPublish: boolean; onClose: () => void }): React.ReactElement { return (
- - +
) } @@ -173,20 +175,15 @@ function TextField(params: { onChange: (value: string) => void }): React.ReactElement { return ( -
- - params.onChange(e.target.value)} - className="w-full px-3 py-2 bg-cyber-darker border border-cyber-accent/30 rounded text-cyber-light focus:border-neon-cyan focus:outline-none" - required={params.required} - disabled={params.disabled} - /> -
+ params.onChange(e.target.value)} + required={params.required} + disabled={params.disabled} + /> ) } @@ -201,20 +198,15 @@ function TextAreaField(params: { onChange: (value: string) => void }): React.ReactElement { return ( -
- -