diff --git a/src/components/Directory/ManageContact.jsx b/src/components/Directory/ManageContact.jsx index 56d45e32..f55ed858 100644 --- a/src/components/Directory/ManageContact.jsx +++ b/src/components/Directory/ManageContact.jsx @@ -23,7 +23,7 @@ import Label from "../common/Label"; const ManageContact = ({ contactId, closeModal }) => { // fetch master data const { buckets, loading: bucketsLoaging } = useBuckets(); - const { data:projects, loading: projectLoading } = useProjects(); + const { data: projects, loading: projectLoading } = useProjects(); const { contactCategory, loading: contactCategoryLoading } = useContactCategory(); const { organizationList } = useOrganization(); @@ -205,12 +205,12 @@ const ManageContact = ({ contactId, closeModal }) => { - setValue("organization", val, { shouldValidate: true })} - error={errors.organization?.message} -/> + setValue("organization", val, { shouldValidate: true })} + error={errors.organization?.message} + /> @@ -408,6 +408,7 @@ const ManageContact = ({ contactId, closeModal }) => { label="Tags" options={contactTags} isRequired={true} + placeholder="Enter Tag" /> {errors.tags && ( {errors.tags.message} @@ -482,7 +483,7 @@ const ManageContact = ({ contactId, closeModal }) => { - + diff --git a/src/components/ServiceProject/ManageJob.jsx b/src/components/ServiceProject/ManageJob.jsx index d769470b..3207957d 100644 --- a/src/components/ServiceProject/ManageJob.jsx +++ b/src/components/ServiceProject/ManageJob.jsx @@ -108,6 +108,7 @@ const ManageJob = ({ Job }) => { type="text" {...register("title")} className="form-control form-control" + placeholder="Enter Title" /> @@ -144,6 +145,7 @@ const ManageJob = ({ Job }) => { options={JobTags?.data} name="tags" label="Tag" + placeholder="Enter Tag" required /> diff --git a/src/components/common/TagInput.jsx b/src/components/common/TagInput.jsx index 3241d548..d0a015ae 100644 --- a/src/components/common/TagInput.jsx +++ b/src/components/common/TagInput.jsx @@ -2,7 +2,7 @@ import { useFormContext, useWatch } from "react-hook-form"; import React, { useEffect, useState } from "react"; import Label from "./Label"; -const TagInput = ({ label, name, placeholder, color = "#e9ecef", required=false, options = [] }) => { +const TagInput = ({ label, name, placeholder, color = "#e9ecef", required = false, options = [] }) => { const { setValue, watch } = useFormContext(); const tags = watch(name) || []; const [input, setInput] = useState(""); @@ -33,29 +33,29 @@ const TagInput = ({ label, name, placeholder, color = "#e9ecef", required=false, } }; -const handleChange = (e) => { - const val = e.target.value; - setInput(val); + const handleChange = (e) => { + const val = e.target.value; + setInput(val); - if (val) { - setSuggestions( - options - .filter((opt) => { - const label = typeof opt === "string" ? opt : opt.name; - return ( - label.toLowerCase().includes(val.toLowerCase()) && - !tags.some((t) => t.name === label) - ); - }) - .map((opt) => ({ - name: typeof opt === "string" ? opt : opt.name, - isActive: true, - })) - ); - } else { - setSuggestions([]); - } -}; + if (val) { + setSuggestions( + options + .filter((opt) => { + const label = typeof opt === "string" ? opt : opt.name; + return ( + label.toLowerCase().includes(val.toLowerCase()) && + !tags.some((t) => t.name === label) + ); + }) + .map((opt) => ({ + name: typeof opt === "string" ? opt : opt.name, + isActive: true, + })) + ); + } else { + setSuggestions([]); + } + }; const handleSuggestionClick = (sugg) => { handleAdd(sugg); @@ -105,6 +105,9 @@ const handleChange = (e) => { outline: "none", flex: 1, minWidth: "120px", + backgroundColor: "white", + color: "black" + }} />