From 53991c77918f9136bbd537012f7fbcc6b3e3c582 Mon Sep 17 00:00:00 2001 From: Nicolas Cantu Date: Wed, 14 Jan 2026 13:47:03 +0100 Subject: [PATCH] create for series --- components/ArticleEditor.tsx | 5 +- components/ArticleEditorForm.tsx | 37 +++++----- components/ArticleFilters.tsx | 2 +- components/AuthorFilterButton.tsx | 8 ++- components/AuthorFilterDropdown.tsx | 16 +++-- components/ClearButton.tsx | 15 ++-- components/LanguageSelector.tsx | 14 ++-- components/NotificationActions.tsx | 3 +- components/NotificationBadge.tsx | 11 +-- components/NotificationBadgeButton.tsx | 9 ++- components/NotificationPanel.tsx | 5 +- components/NotificationPanelHeader.tsx | 64 +++++++++++------ components/ProfileBackButton.tsx | 10 ++- .../CreateSeriesModalView.tsx | 2 +- .../KeyManagementImportSection.tsx | 11 +-- .../MarkdownEditorTwoColumns.tsx | 23 ++++--- .../markdownEditorTwoColumns/PagesManager.tsx | 30 +++++--- components/ui/Button.tsx | 68 ++++++++++++++----- .../unlockAccount/UnlockAccountButtons.tsx | 17 +++-- .../unlockAccount/UnlockAccountForm.tsx | 7 +- components/unlockAccount/WordSuggestions.tsx | 13 ++-- docs/migration-status.md | 50 ++++---------- 22 files changed, 248 insertions(+), 172 deletions(-) diff --git a/components/ArticleEditor.tsx b/components/ArticleEditor.tsx index df357cc..ce7b276 100644 --- a/components/ArticleEditor.tsx +++ b/components/ArticleEditor.tsx @@ -1,4 +1,5 @@ import { useState } from 'react' +import { Card } from './ui' import { useNostrAuth } from '@/hooks/useNostrAuth' import { useArticlePublishing } from '@/hooks/useArticlePublishing' import type { ArticleDraft } from '@/lib/articlePublisher' @@ -14,10 +15,10 @@ interface ArticleEditorProps { function SuccessMessage(): React.ReactElement { return ( -
+

Article Published!

Your article has been successfully published.

-
+ ) } diff --git a/components/ArticleEditorForm.tsx b/components/ArticleEditorForm.tsx index c29a6c3..e82f005 100644 --- a/components/ArticleEditorForm.tsx +++ b/components/ArticleEditorForm.tsx @@ -1,4 +1,5 @@ import React from 'react' +import { Card, ErrorState } from './ui' import type { ArticleDraft } from '@/lib/articlePublisher' import { ArticleFormButtons } from './ArticleFormButtons' import type { RelayPublishStatus } from '@/lib/publishResult' @@ -22,11 +23,7 @@ function ErrorAlert({ error }: { error: string | null }): React.ReactElement | n if (!error) { return null } - return ( -
-

{error}

-
- ) + return } export function ArticleEditorForm({ @@ -41,19 +38,21 @@ export function ArticleEditorForm({ onSelectSeries, }: ArticleEditorFormProps): React.ReactElement { return ( -
-

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

-
- - -
- - - + +
+

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

+
+ + +
+ + + +
) } diff --git a/components/ArticleFilters.tsx b/components/ArticleFilters.tsx index 35cea91..afcb92e 100644 --- a/components/ArticleFilters.tsx +++ b/components/ArticleFilters.tsx @@ -1,6 +1,6 @@ import React from 'react' import type { Article } from '@/types/nostr' -import { Button, Card, Input } from './ui' +import { Button, Card } from './ui' import { t } from '@/lib/i18n' import { AuthorFilter } from './AuthorFilter' diff --git a/components/AuthorFilterButton.tsx b/components/AuthorFilterButton.tsx index e63c8c1..46c6ef7 100644 --- a/components/AuthorFilterButton.tsx +++ b/components/AuthorFilterButton.tsx @@ -1,4 +1,5 @@ import React from 'react' +import { Button } from './ui' import { AuthorAvatar } from './AuthorFilterDropdown' export function AuthorMnemonicIcons({ value, getMnemonicIcons }: { value: string; getMnemonicIcons: (pubkey: string) => string[] }): React.ReactElement { @@ -70,12 +71,13 @@ export function AuthorFilterButton({ buttonRef: React.RefObject }): React.ReactElement { return ( - + ) } diff --git a/components/AuthorFilterDropdown.tsx b/components/AuthorFilterDropdown.tsx index dc9924d..5039074 100644 --- a/components/AuthorFilterDropdown.tsx +++ b/components/AuthorFilterDropdown.tsx @@ -1,5 +1,5 @@ import Image from 'next/image' -import { Card } from './ui' +import { Button, Card } from './ui' import { t } from '@/lib/i18n' export function AuthorAvatar({ picture, displayName }: { picture?: string; displayName: string }): React.ReactElement { @@ -35,10 +35,11 @@ export function AuthorOption({ onSelect: () => void }): React.ReactElement { return ( - + ) } @@ -67,20 +68,21 @@ export function AllAuthorsOption({ setIsOpen: (open: boolean) => void }): React.ReactElement { return ( - + ) } diff --git a/components/ClearButton.tsx b/components/ClearButton.tsx index 0fade62..b18c8a6 100644 --- a/components/ClearButton.tsx +++ b/components/ClearButton.tsx @@ -1,3 +1,4 @@ +import { Button } from './ui' import { t } from '@/lib/i18n' interface ClearButtonProps { @@ -6,14 +7,12 @@ interface ClearButtonProps { export function ClearButton({ onClick }: ClearButtonProps): React.ReactElement { return ( - + ) } diff --git a/components/LanguageSelector.tsx b/components/LanguageSelector.tsx index 31caaca..7fb5ef1 100644 --- a/components/LanguageSelector.tsx +++ b/components/LanguageSelector.tsx @@ -1,4 +1,5 @@ import { useState, useEffect } from 'react' +import { Button } from './ui' import { setLocale, getLocale, type Locale } from '@/lib/i18n' import { localeStorage } from '@/lib/localeStorage' @@ -12,16 +13,15 @@ interface LocaleButtonProps { function LocaleButton({ locale, label, currentLocale, onClick }: LocaleButtonProps): React.ReactElement { const isActive = currentLocale === locale return ( - + ) } diff --git a/components/NotificationActions.tsx b/components/NotificationActions.tsx index b18470b..21054b0 100644 --- a/components/NotificationActions.tsx +++ b/components/NotificationActions.tsx @@ -11,7 +11,8 @@ export function NotificationActions({ timestamp, onDelete }: NotificationActions
{formatTime(timestamp)} + ) } diff --git a/components/NotificationBadgeButton.tsx b/components/NotificationBadgeButton.tsx index 642a8df..843a28b 100644 --- a/components/NotificationBadgeButton.tsx +++ b/components/NotificationBadgeButton.tsx @@ -1,3 +1,4 @@ +import { Button } from './ui' interface NotificationBadgeButtonProps { unreadCount: number @@ -6,9 +7,11 @@ interface NotificationBadgeButtonProps { export function NotificationBadgeButton({ unreadCount, onClick }: NotificationBadgeButtonProps): React.ReactElement { return ( - + ) } diff --git a/components/NotificationPanel.tsx b/components/NotificationPanel.tsx index 11ced1c..1c9f257 100644 --- a/components/NotificationPanel.tsx +++ b/components/NotificationPanel.tsx @@ -1,3 +1,4 @@ +import { Card } from './ui' import type { Notification } from '@/lib/notificationService' import { NotificationItem } from './NotificationItem' import { NotificationPanelHeader } from './NotificationPanelHeader' @@ -50,7 +51,7 @@ export function NotificationPanel({ return ( <>
-
+
-
+ ) } diff --git a/components/NotificationPanelHeader.tsx b/components/NotificationPanelHeader.tsx index fb3b3fe..84a73ef 100644 --- a/components/NotificationPanelHeader.tsx +++ b/components/NotificationPanelHeader.tsx @@ -1,3 +1,4 @@ +import { Button } from './ui' import { t } from '@/lib/i18n' interface NotificationPanelHeaderProps { @@ -6,6 +7,45 @@ interface NotificationPanelHeaderProps { onClose: () => void } +function MarkAllAsReadButton({ unreadCount, onMarkAllAsRead }: { unreadCount: number; onMarkAllAsRead: () => void }): React.ReactElement | null { + if (unreadCount === 0) { + return null + } + return ( + + ) +} + +function CloseButton({ onClose }: { onClose: () => void }): React.ReactElement { + return ( + + ) +} + export function NotificationPanelHeader({ unreadCount, onMarkAllAsRead, @@ -15,28 +55,8 @@ export function NotificationPanelHeader({

{t('notification.title')}

- {unreadCount > 0 && ( - - )} - + +
) diff --git a/components/ProfileBackButton.tsx b/components/ProfileBackButton.tsx index df24017..462489a 100644 --- a/components/ProfileBackButton.tsx +++ b/components/ProfileBackButton.tsx @@ -1,15 +1,19 @@ +import { Button } from './ui' import { useRouter } from 'next/router' export function BackButton(): React.ReactElement { const router = useRouter() return ( - + ) } diff --git a/components/createSeriesModal/CreateSeriesModalView.tsx b/components/createSeriesModal/CreateSeriesModalView.tsx index a292c03..3e15555 100644 --- a/components/createSeriesModal/CreateSeriesModalView.tsx +++ b/components/createSeriesModal/CreateSeriesModalView.tsx @@ -112,7 +112,7 @@ function SeriesCategoryField(params: { id="series-category" value={params.draft.category} onChange={(e) => params.setDraft({ ...params.draft, category: e.target.value as SeriesDraft['category'] })} - 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" + className="w-full bg-cyber-darker border-cyber-accent/30 text-cyber-light" required disabled={disabled} > diff --git a/components/keyManagement/KeyManagementImportSection.tsx b/components/keyManagement/KeyManagementImportSection.tsx index 15b6dcf..99596e2 100644 --- a/components/keyManagement/KeyManagementImportSection.tsx +++ b/components/keyManagement/KeyManagementImportSection.tsx @@ -100,10 +100,10 @@ function KeyManagementNoAccountBanner(params: { return null } return ( -
+

{t('settings.keyManagement.noAccount.title')}

{t('settings.keyManagement.noAccount.description')}

-
+ ) } @@ -116,12 +116,13 @@ function KeyManagementImportButton(params: { return null } return ( - + ) } diff --git a/components/markdownEditorTwoColumns/MarkdownEditorTwoColumns.tsx b/components/markdownEditorTwoColumns/MarkdownEditorTwoColumns.tsx index fd47233..6255e34 100644 --- a/components/markdownEditorTwoColumns/MarkdownEditorTwoColumns.tsx +++ b/components/markdownEditorTwoColumns/MarkdownEditorTwoColumns.tsx @@ -1,4 +1,5 @@ import { useState } from 'react' +import { Button } from '../ui' import type { MediaRef, Page } from '@/types/nostr' import { t } from '@/lib/i18n' import { createPagesHandlers, PagesManager } from './PagesManager' @@ -104,8 +105,10 @@ function MarkdownPreview(params: { value: string }): React.ReactElement { function ToolbarUploadButton(params: { onFileSelected: (file: File) => void }): React.ReactElement { return ( -
) @@ -75,11 +78,12 @@ function PageEditorHeader(params: { page: Page; onTypeChange: (type: 'markdown' function PageEditorBody(params: { page: Page; onContentChange: (content: string) => void; onImageUpload: (file: File) => Promise }): React.ReactElement { if (params.page.type === 'markdown') { return ( -