From a7b101519af3aa0e59f58d4e90e56955d0c80f58 Mon Sep 17 00:00:00 2001 From: varutasu <104105839+varutasu@users.noreply.github.com> Date: Wed, 3 Jun 2026 16:53:08 -0500 Subject: [PATCH] Extract CollectionsCreateModal and tag helpers (Brief 1). (#82) Moves create-list modal UI to components/CollectionsCreateModal.js and tag input helpers to lib/collection-tag-input.js (shared with edit modal). Co-authored-by: Cursor --- components/CollectionsCreateModal.js | 181 +++++++++++++++++++++++ lib/collection-tag-input.js | 29 ++++ pages/collections.js | 208 +++------------------------ 3 files changed, 231 insertions(+), 187 deletions(-) create mode 100644 components/CollectionsCreateModal.js create mode 100644 lib/collection-tag-input.js diff --git a/components/CollectionsCreateModal.js b/components/CollectionsCreateModal.js new file mode 100644 index 0000000..6eeed29 --- /dev/null +++ b/components/CollectionsCreateModal.js @@ -0,0 +1,181 @@ +import { + addCollectionTag, + handleCollectionTagKeyPress, + removeCollectionTag, +} from '../lib/collection-tag-input.js'; + +export default function CollectionsCreateModal({ + isOpen, + newCollection, + setNewCollection, + tagInput, + setTagInput, + onClose, + onCreate, +}) { + if (!isOpen) { + return null; + } + + return ( +
+
+

+ Create New List +

+
+
+ + setNewCollection({ ...newCollection, name: e.target.value })} + placeholder="Enter list name" + /> +
+
+ +