From 94b428d168a6a4c0680f29ed0155393efb165d10 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Sun, 8 Mar 2026 00:25:50 -0500 Subject: [PATCH] refactor: enforce shared Modal component (#100) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: enforce shared Modal component in remaining custom modals - ShareSessionModal: replaced custom modal markup with - CreateCategoryModal: replaced custom modal markup with - EditCategoryModal: replaced custom modal markup with - All now get focus trapping, Escape close, body scroll lock for free Co-Authored-By: Claude Opus 4.6 * refactor: adopt shared Button component in 18 modal components Replace raw + Cancel + + + + } + > +
+ {error && ( +
+ {error} +
+ )} + +
+ + setName(e.target.value)} + disabled={isSaving} + maxLength={100} + placeholder="e.g., Network Troubleshooting" + required + className={cn( + 'w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground', + 'placeholder:text-muted-foreground', + 'focus:border-primary focus:outline-hidden focus:ring-1 focus:ring-primary/20', + 'disabled:opacity-50' + )} + /> +

+ {name.length}/100 characters +

- {/* Form */} - - {/* Error Message */} - {error && ( -
- {error} -
- )} - - {/* Name Field */} -
- - setName(e.target.value)} - disabled={isSaving} - maxLength={100} - placeholder="e.g., Network Troubleshooting" - required - className={cn( - 'w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground', - 'placeholder:text-muted-foreground', - 'focus:border-primary focus:outline-hidden focus:ring-1 focus:ring-primary/20', - 'disabled:opacity-50' - )} - /> -

- {name.length}/100 characters -

-
- - {/* Description Field */} -
- -