From feda50464cb0848f53548e2d3166fb0c64b4c59b Mon Sep 17 00:00:00 2001 From: Yee Jia Wei Date: Mon, 18 Dec 2023 08:28:52 +0800 Subject: [PATCH 1/3] update missing collection color picker icon --- .../ModalContent/NewCollectionModal.tsx | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/components/ModalContent/NewCollectionModal.tsx b/components/ModalContent/NewCollectionModal.tsx index 23b4344..511769b 100644 --- a/components/ModalContent/NewCollectionModal.tsx +++ b/components/ModalContent/NewCollectionModal.tsx @@ -27,27 +27,22 @@ export default function NewCollectionModal({ onClose }: Props) { const { addCollection } = useCollectionStore(); const submit = async () => { - if (!submitLoader) { - setSubmitLoader(true); - if (!collection) return null; + if (submitLoader) return; + if (!collection) return null; - setSubmitLoader(true); + setSubmitLoader(true); - const load = toast.loading("Creating..."); + const load = toast.loading("Creating..."); - let response; + let response = await addCollection(collection as any); + toast.dismiss(load); - response = await addCollection(collection as any); + if (response.ok) { + toast.success("Created!"); + onClose(); + } else toast.error(response.data as string); - toast.dismiss(load); - - if (response.ok) { - toast.success("Created!"); - onClose(); - } else toast.error(response.data as string); - - setSubmitLoader(false); - } + setSubmitLoader(false); }; return ( @@ -73,8 +68,7 @@ export default function NewCollectionModal({ onClose }: Props) {

Color

-
-
+
From fbc083c3737455fa5256e56023fcbfc6ac3eda41 Mon Sep 17 00:00:00 2001 From: Yee Jia Wei Date: Mon, 18 Dec 2023 08:30:14 +0800 Subject: [PATCH 2/3] add icon to link create modal more option collapse icon --- components/ModalContent/NewLinkModal.tsx | 87 ++++++++++++------------ 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a/components/ModalContent/NewLinkModal.tsx b/components/ModalContent/NewLinkModal.tsx index 156fe28..2b0ef25 100644 --- a/components/ModalContent/NewLinkModal.tsx +++ b/components/ModalContent/NewLinkModal.tsx @@ -145,53 +145,56 @@ export default function NewLinkModal({ onClose }: Props) {
- {optionsExpanded ? ( -
- {/*
*/} -
-
-

Name

- setLink({ ...link, name: e.target.value })} - placeholder="e.g. Example Link" - className="bg-base-200" - /> -
- -
-

Tags

- { - return { label: e.name, value: e.id }; - })} - /> -
- -
-

Description

-