diff --git a/src/components/ReactTable3/EditButtons.js b/src/components/ReactTable3/EditButtons.js
index 2bf28a8..13691f3 100644
--- a/src/components/ReactTable3/EditButtons.js
+++ b/src/components/ReactTable3/EditButtons.js
@@ -8,34 +8,25 @@ import plus from './plus.svg';
import { GlobalFilter } from './GlobalFilter';
export function EditButtons({buttons }) {
- const [openModal, setOpenModal] = useState(false);
+ const [selectedButton, setSelectedButton] = useState(null);
return (
- {/* serach box */}
{buttons.map((button,index) =>(
setOpenModal(true)}
- >
+ // onClick={() => setOpenModal(true)}
+ onClick={() => setSelectedButton(selectedButton === button ? null : button)}
+ >
{button.title}
))}
- {/*
*/}
- setOpenModal(false)}
- >
- {/*
*/}
-
e.stopPropagation()}
->
-
+
+ {selectedButton?.components}
+
);
@@ -50,6 +41,9 @@ EditButtons.defaultProps = {
title: null,
textColor: null,
backgroundColor: "#F3F8FF",
+ // components: " tannaz1",
+ components: ,
+
},
{
logo: filter,
@@ -58,6 +52,7 @@ EditButtons.defaultProps = {
title: null,
textColor: null,
backgroundColor: "#F3F8FF",
+ components: " tannaz1",
},
{
logo: settings,
@@ -66,6 +61,8 @@ EditButtons.defaultProps = {
title: null,
textColor: null,
backgroundColor: "#F3F8FF",
+ components: "mahdi ",
+
},
{
logo: arrow,
@@ -74,6 +71,8 @@ EditButtons.defaultProps = {
title: 'عملیات',
textColor: "text-blue-400",
backgroundColor: "#F3F8FF",
+ components: "tannaz",
+
},
{
logo: plus,
@@ -82,6 +81,8 @@ EditButtons.defaultProps = {
title: 'ثبت جدید',
textColor: "text-white",
backgroundColor: "#65A9FF",
+ components: "mahdi",
+
},
]
}
diff --git a/src/components/ReactTable3/GlobalFilter.js b/src/components/ReactTable3/GlobalFilter.js
index 397329e..09c818a 100644
--- a/src/components/ReactTable3/GlobalFilter.js
+++ b/src/components/ReactTable3/GlobalFilter.js
@@ -4,6 +4,7 @@ import { useAsyncDebounce } from 'react-table';
import search from "./search-normal.svg";
export const GlobalFilter = ({ filter, setFilter }) => {
+ const [openModal, setOpenModal] = useState(true);
const [value, setValue] = useState(filter);
@@ -12,23 +13,53 @@ export const GlobalFilter = ({ filter, setFilter }) => {
}, 1000)
return (
-
-
-
{
- setValue(e.target.value)
- onChange(e.target.value)
- }}
- type="text"
- placeholder="نام کالا را جستجو کنید..."
- className="text-xs rounded-sm pr-4 pl-10 py-2 w-full border border-gray-400 font-light text-lightGrayTextColor placeholder-gray-400 focus:outline-none"
- />
-
+ setOpenModal(false)}
+ className={`cursor-pointer w-screen h-screen backdrop-filter backdrop-blur-lg flex items-center justify-center bg-gray-900 fixed left-0 top-0 duration-1000 transition-all
+ ${openModal ? "opacity-90" : "opacity-0 pointer-events-none"}`}>
+
e.stopPropagation()}>
+
+
+
{
+ setValue(e.target.value)
+ onChange(e.target.value)
+ }}
+ type="text"
+ placeholder="نام کالا را جستجو کنید..."
+ className="text-xs rounded-sm pr-4 pl-10 py-2 w-full border border-gray-400 font-light text-lightGrayTextColor placeholder-gray-400 focus:outline-none"
+ />
+
+
+
+ // setOpenModal(false)}>
+ //
e.stopPropagation()}>
+ //
+ //
+ //
{
+ // setValue(e.target.value)
+ // onChange(e.target.value)
+ // }}
+ // type="text"
+ // placeholder="نام کالا را جستجو کنید..."
+ // className="text-xs rounded-sm pr-4 pl-10 py-2 w-full border border-gray-400 font-light text-lightGrayTextColor placeholder-gray-400 focus:outline-none"
+ // />
+ //
+ //
+ //
);
};