feat: Enhance note dialog layouts, improve text wrapping, and refine component styling.

This commit is contained in:
2025-12-29 14:23:19 +01:00
parent 5634555d89
commit 68a11ea551
5 changed files with 20 additions and 21 deletions

View File

@@ -49,7 +49,7 @@ export function Editor({ value, onChange, placeholder, className }: EditorProps)
editorProps: {
attributes: {
class: cn(
"min-h-[100px] max-h-[400px] overflow-y-auto w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 prose dark:prose-invert max-w-none",
"min-h-[100px] max-h-[400px] overflow-y-auto w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 prose dark:prose-invert max-w-none break-all min-w-0",
className
),
},

View File

@@ -165,10 +165,11 @@ export function NoteCard({ note }: NoteCardProps) {
</Card>
<Dialog open={editing} onOpenChange={setEditing}>
<DialogContent>
<DialogHeader>
<DialogContent className="max-w-3xl max-h-[85vh] flex flex-col p-6 gap-0 overflow-hidden">
<DialogHeader className="pb-4 shrink-0">
<DialogTitle>{t("Edit Note")}</DialogTitle>
</DialogHeader>
<div className="flex-1 min-h-0 overflow-y-auto -mx-6 px-6">
<NoteForm
defaultValues={{
title: note.title,
@@ -180,6 +181,7 @@ export function NoteCard({ note }: NoteCardProps) {
onSubmit={handleEdit}
submitLabel={t("Update")}
/>
</div>
</DialogContent>
</Dialog>

View File

@@ -43,7 +43,7 @@ export function NoteForm({ defaultValues, onSubmit, isLoading, submitLabel = "Sa
return (
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit as any)} className="space-y-4">
<form onSubmit={form.handleSubmit(onSubmit as any)} className="w-full flex flex-col gap-4">
<FormField
control={form.control as any}
name="title"

View File

@@ -27,12 +27,9 @@ export function NoteViewDialog({ note, open, onOpenChange, onEdit, onSelectNote
<DialogContent className={clsx("max-w-3xl max-h-[85vh] flex flex-col p-6 gap-0 overflow-hidden", colorClass)}>
<DialogHeader className="pb-4 shrink-0">
<div className="flex justify-between items-start gap-4">
<DialogTitle className="text-2xl font-bold leading-tight break-words">
<DialogTitle className="text-2xl font-bold leading-tight wrap-break-word">
{note.title}
</DialogTitle>
{note.is_pinned && (
<Pin className="h-5 w-5 text-primary rotate-45 shrink-0" />
)}
</div>
<div className="flex items-center text-sm text-muted-foreground gap-2 mt-1">
<Calendar className="h-3.5 w-3.5" />
@@ -41,7 +38,7 @@ export function NoteViewDialog({ note, open, onOpenChange, onEdit, onSelectNote
</DialogHeader>
<div className="flex-1 min-h-0 overflow-y-auto -mx-6 px-6">
<div className="prose dark:prose-invert max-w-none text-base leading-relaxed break-words pb-6">
<div className="prose dark:prose-invert max-w-none text-base leading-relaxed wrap-break-word pb-6">
<ReactMarkdown remarkPlugins={[remarkGfm]}>{note.content}</ReactMarkdown>
</div>

View File

@@ -81,7 +81,7 @@ export default function DashboardPage() {
return (
<Masonry
breakpointCols={masonryBreakpoints}
className="flex -ml-4 w-auto"
className="flex w-auto"
columnClassName="pl-4 bg-clip-padding"
>
{notesList.map((note: Note) => (