eleven-solutions-common-website-unique-web 3.0.40 → 3.0.41
Sign up to get free protection for your applications and to get access to all the features.
@@ -13,6 +13,7 @@ import { addTaxonomyApi, fetchTaxonomyByIdApi, updateTaxonomyApi, fetchTaxonomie
|
|
13
13
|
import { FaPlus } from "react-icons/fa";
|
14
14
|
const TaxonomyForm = () => {
|
15
15
|
const [type, setType] = useState("");
|
16
|
+
const [inputType, setInputType] = useState("");
|
16
17
|
const [code, setCode] = useState("");
|
17
18
|
const [value, setValue] = useState("");
|
18
19
|
const [isEditMode, setIsEditMode] = useState(false);
|
@@ -262,7 +263,7 @@ const TaxonomyForm = () => {
|
|
262
263
|
console.error("Error deleting Taxonomy:", error);
|
263
264
|
}
|
264
265
|
});
|
265
|
-
return (_jsxs("div", { className: `${isEditMode && isMultiple ? "w-full" : "max-w-4xl"} p-6 mx-auto dark:bg-gray-800`, children: [_jsxs("div", { className: `transition duration-300 ${isModalOpen ? "filter blur-sm" : ""}`, children: [_jsx("h1", { className: "text-3xl font-bold text-center text-blue-600 capitalize dark:text-white mb-4", children: isEditMode ? "Edit Taxonomy" : "Add Taxonomy" }), _jsx("h1", { className: "text-2xl text-blue-600 capitalize dark:text-white mb-4", children: isEditMode ? `Taxonomy Type: ${type}` : "" }), !isMultiple &&
|
266
|
+
return (_jsxs("div", { className: `${isEditMode && isMultiple ? "w-full" : "max-w-4xl"} p-6 mx-auto dark:bg-gray-800`, children: [_jsxs("div", { className: `transition duration-300 ${isModalOpen ? "filter blur-sm" : ""}`, children: [_jsx("h1", { className: "text-3xl font-bold text-center text-blue-600 capitalize dark:text-white mb-4", children: isEditMode ? "Edit Taxonomy" : "Add Taxonomy" }), _jsx("h1", { className: "text-2xl text-blue-600 capitalize dark:text-white mb-4", children: isEditMode ? `Taxonomy Type: ${type}` : "" }), !isMultiple && (_jsxs("form", { children: [!isEditMode && (_jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["Type ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { required: true, value: inputType, onChange: (e) => setInputType(e.target.value), type: "text", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter Type" })] })), _jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["Code ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { required: true, value: code, onChange: (e) => setCode(e.target.value === "" ? "" : Number(e.target.value)), type: "number", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter Code", disabled: similarTaxonomies.some((taxonomy) => taxonomy.isEdit === false) })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["Value ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { required: true, value: value, onChange: (e) => setValue(e.target.value), type: "text", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter Value", disabled: similarTaxonomies.some((taxonomy) => taxonomy.isEdit === false) })] }), _jsxs("div", { className: "flex space-x-4 mt-6 justify-between", children: [_jsx("div", { children: isEditMode && (_jsx("div", { children: similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (_jsx("button", { type: "button", onClick: () => {
|
266
267
|
handleDeleteClick(id);
|
267
268
|
window.location.href = "/admin/taxinomies";
|
268
269
|
}, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: "Delete" })) })) }), _jsxs("div", { className: "flex space-x-4 justify-end", children: [similarTaxonomies.some((taxonomy) => taxonomy.isEdit) && (_jsx("button", { type: "submit", onClick: handleSave, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: isEditMode ? "Save" : "Add" })), !similarTaxonomies.some((taxonomy) => taxonomy.isEdit) &&
|
package/package.json
CHANGED
@@ -13,6 +13,7 @@ import { FaPlus } from "react-icons/fa";
|
|
13
13
|
|
14
14
|
const TaxonomyForm = () => {
|
15
15
|
const [type, setType] = useState<string>("");
|
16
|
+
const [inputType, setInputType] = useState<string>("");
|
16
17
|
const [code, setCode] = useState<number | string>("");
|
17
18
|
const [value, setValue] = useState<string>("");
|
18
19
|
|
@@ -342,7 +343,7 @@ const TaxonomyForm = () => {
|
|
342
343
|
{isEditMode ? `Taxonomy Type: ${type}` : ""}
|
343
344
|
</h1>
|
344
345
|
|
345
|
-
{!isMultiple &&
|
346
|
+
{!isMultiple && (
|
346
347
|
<form>
|
347
348
|
{!isEditMode && (
|
348
349
|
<div className="mb-6 w-full">
|
@@ -351,8 +352,8 @@ const TaxonomyForm = () => {
|
|
351
352
|
</label>
|
352
353
|
<input
|
353
354
|
required
|
354
|
-
value={
|
355
|
-
onChange={(e) =>
|
355
|
+
value={inputType}
|
356
|
+
onChange={(e) => setInputType(e.target.value)}
|
356
357
|
type="text"
|
357
358
|
className="w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring"
|
358
359
|
placeholder="Enter Type"
|