From be180d34e28df42cdc491df84c4dc27be04caf0c Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 2 Jun 2023 15:29:52 +0330 Subject: [PATCH] customizable icon color --- .../Modal/Collection/CollectionInfo.tsx | 56 +++++-- components/Sidebar/SidebarItem.tsx | 16 +- components/Sidebar/index.tsx | 137 +++++++++--------- .../controllers/collections/postCollection.ts | 1 + .../collections/updateCollection.ts | 1 + package.json | 1 + pages/collections/[id].tsx | 23 +-- .../migration.sql | 1 + prisma/schema.prisma | 3 +- styles/globals.css | 20 ++- yarn.lock | 5 + 11 files changed, 165 insertions(+), 99 deletions(-) rename prisma/migrations/{20230528224940_init => 20230602115917_init}/migration.sql (98%) diff --git a/components/Modal/Collection/CollectionInfo.tsx b/components/Modal/Collection/CollectionInfo.tsx index 3ba1948..3f26449 100644 --- a/components/Modal/Collection/CollectionInfo.tsx +++ b/components/Modal/Collection/CollectionInfo.tsx @@ -1,10 +1,15 @@ import React, { useState } from "react"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faPenToSquare, faPlus } from "@fortawesome/free-solid-svg-icons"; +import { + faFolder, + faPenToSquare, + faPlus, +} from "@fortawesome/free-solid-svg-icons"; import useCollectionStore from "@/store/collections"; import { CollectionIncludingMembers } from "@/types/global"; import RequiredBadge from "../../RequiredBadge"; import SubmitButton from "@/components/SubmitButton"; +import { HexColorPicker } from "react-colorful"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; type Props = { toggleCollectionModal: Function; @@ -46,21 +51,48 @@ export default function CollectionInfo({ Name

- - setCollection({ ...collection, name: e.target.value }) - } - type="text" - placeholder="e.g. Example Collection" - className="w-full rounded-md p-3 border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" - /> +
+ + setCollection({ ...collection, name: e.target.value }) + } + type="text" + placeholder="e.g. Example Collection" + className="w-full rounded-md p-3 border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" + /> +
+
+

+ Icon Color +

+
+ +
+
+ setCollection({ ...collection, color: "#7dd3fc" }) + } + > + Reset +
+
+ setCollection({ ...collection, color: e })} + /> +
+

Description