diff --git a/src/components/article/ArticleEditor.tsx b/src/components/article/ArticleEditor.tsx index a7a66cb..e57b2cb 100644 --- a/src/components/article/ArticleEditor.tsx +++ b/src/components/article/ArticleEditor.tsx @@ -20,6 +20,16 @@ function extractImages(md: string): { alt: string; url: string }[] { return images; } +function formatSavedAgo(elapsedMs: number): string { + const s = Math.floor(elapsedMs / 1000); + if (s < 5) return "just now"; + if (s < 60) return `${s}s ago`; + const m = Math.floor(s / 60); + if (m < 60) return `${m}m ago`; + const h = Math.floor(m / 60); + return `${h}h ago`; +} + export function ArticleEditor() { const { goBack } = useUIStore(); const { activeDraftId, drafts, updateDraft, deleteDraft, setActiveDraft, createDraft } = useDraftStore(); @@ -279,7 +289,7 @@ export function ArticleEditor() { {wordCount > 0 ? `${wordCount} words` : "New article"} {activeDraft && !published && lastSaved && ( - · saved {Math.floor((Date.now() - lastSaved) / 1000) < 5 ? "just now" : `${Math.floor((Date.now() - lastSaved) / 1000)}s ago`} + · saved {formatSavedAgo(Date.now() - lastSaved)} )} {published && publishedRelays > 0 && ( @@ -396,6 +406,7 @@ export function ArticleEditor() { onChange={(e) => setTitle(e.target.value)} placeholder="Title" className="w-full bg-transparent text-text text-2xl font-bold placeholder:text-text-dim focus:outline-none" + style={{ fontFamily: "var(--font-reading)" }} /> diff --git a/src/components/article/ArticleView.tsx b/src/components/article/ArticleView.tsx index 75b49aa..eb28861 100644 --- a/src/components/article/ArticleView.tsx +++ b/src/components/article/ArticleView.tsx @@ -306,7 +306,7 @@ export function ArticleView() { value={commentText} onChange={(e) => { setCommentText(e.target.value); autoResize(e); }} onKeyDown={(e) => { if (e.key === "Enter" && !e.shiftKey) { e.preventDefault(); handleComment(); } }} - placeholder="Write a comment about this article..." + placeholder="Write a comment…" rows={3} className="w-full bg-bg-raised border border-border rounded-sm px-3 py-2 text-[12px] text-text placeholder:text-text-dim resize-none focus:outline-none focus:border-accent leading-relaxed" autoFocus diff --git a/src/components/feed/ComposeBox.tsx b/src/components/feed/ComposeBox.tsx index ad838b4..e280660 100644 --- a/src/components/feed/ComposeBox.tsx +++ b/src/components/feed/ComposeBox.tsx @@ -270,7 +270,7 @@ export function ComposeBox({ onPublished, onNoteInjected }: { onPublished?: () = )} @@ -125,7 +126,7 @@ export function NoteActions({ event, onReplyToggle, showReply }: NoteActionsProp {showEmojiPicker && ( <>
Based on who your follows follow