bug fixed
This commit is contained in:
parent
8af9a36dfa
commit
a0a7ccc952
|
@ -85,7 +85,7 @@ export default function ({
|
||||||
.slice(0, 4)}
|
.slice(0, 4)}
|
||||||
{collection.members.length - 4 > 0 ? (
|
{collection.members.length - 4 > 0 ? (
|
||||||
<div className="h-10 w-10 text-white flex items-center justify-center rounded-full border-[3px] bg-sky-500 border-sky-100 -mr-3">
|
<div className="h-10 w-10 text-white flex items-center justify-center rounded-full border-[3px] bg-sky-500 border-sky-100 -mr-3">
|
||||||
+{collection.members.length - 3}
|
+{collection.members.length - 4}
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,6 +8,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import {
|
import {
|
||||||
faClose,
|
faClose,
|
||||||
faPenToSquare,
|
faPenToSquare,
|
||||||
|
faPlus,
|
||||||
faTrashCan,
|
faTrashCan,
|
||||||
faUser,
|
faUser,
|
||||||
faUserPlus,
|
faUserPlus,
|
||||||
|
@ -80,8 +81,8 @@ export default function CollectionModal({
|
||||||
|
|
||||||
let response = null;
|
let response = null;
|
||||||
|
|
||||||
if (method === "CREATE") response = await updateCollection(collection);
|
if (method === "CREATE") response = await addCollection(collection);
|
||||||
else if (method === "UPDATE") response = await addCollection(collection);
|
else if (method === "UPDATE") response = await updateCollection(collection);
|
||||||
else console.log("Unknown method.");
|
else console.log("Unknown method.");
|
||||||
|
|
||||||
if (response) toggleCollectionModal();
|
if (response) toggleCollectionModal();
|
||||||
|
@ -324,10 +325,15 @@ export default function CollectionModal({
|
||||||
className="bg-sky-500 text-white flex items-center gap-2 py-2 px-5 rounded-md select-none font-bold cursor-pointer duration-100 hover:bg-sky-400"
|
className="bg-sky-500 text-white flex items-center gap-2 py-2 px-5 rounded-md select-none font-bold cursor-pointer duration-100 hover:bg-sky-400"
|
||||||
onClick={submit}
|
onClick={submit}
|
||||||
>
|
>
|
||||||
<FontAwesomeIcon icon={faPenToSquare} className="h-5" />
|
<FontAwesomeIcon
|
||||||
Edit Collection
|
icon={method === "CREATE" ? faPlus : faPenToSquare}
|
||||||
|
className="h-5"
|
||||||
|
/>
|
||||||
|
{method === "CREATE" ? "Add Collection" : "Edit Collection"}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{method === "UPDATE" ? (
|
||||||
|
<>
|
||||||
<div className="flex items-center justify-center gap-2">
|
<div className="flex items-center justify-center gap-2">
|
||||||
<hr className="w-16 border" />
|
<hr className="w-16 border" />
|
||||||
|
|
||||||
|
@ -342,8 +348,13 @@ export default function CollectionModal({
|
||||||
}}
|
}}
|
||||||
className="w-fit inline-flex rounded-md cursor-pointer bg-red-500 hover:bg-red-400 duration-100 p-2"
|
className="w-fit inline-flex rounded-md cursor-pointer bg-red-500 hover:bg-red-400 duration-100 p-2"
|
||||||
>
|
>
|
||||||
<FontAwesomeIcon icon={faTrashCan} className="w-4 h-4 text-white" />
|
<FontAwesomeIcon
|
||||||
|
icon={faTrashCan}
|
||||||
|
className="w-4 h-4 text-white"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{deleteCollectionModal ? (
|
{deleteCollectionModal ? (
|
||||||
|
|
Ŝarĝante…
Reference in New Issue