|
|
@ -8,33 +8,24 @@ import plus from './plus.svg'; |
|
|
|
import { GlobalFilter } from './GlobalFilter'; |
|
|
|
import { GlobalFilter } from './GlobalFilter'; |
|
|
|
|
|
|
|
|
|
|
|
export function EditButtons({buttons }) { |
|
|
|
export function EditButtons({buttons }) { |
|
|
|
const [openModal, setOpenModal] = useState(false); |
|
|
|
const [selectedButton, setSelectedButton] = useState(null); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div className="flex flex-row items-center justify-end"> |
|
|
|
<div className="flex flex-row items-center justify-end"> |
|
|
|
{/* serach box */} |
|
|
|
|
|
|
|
{buttons.map((button,index) =>( |
|
|
|
{buttons.map((button,index) =>( |
|
|
|
<div className={`border border-blue-400 flex flex-row items-center justify-around p-1 rounded-sm bg-opacity-30 mx-1`} |
|
|
|
<div className={`border border-blue-400 flex flex-row items-center justify-around p-1 rounded-sm bg-opacity-30 mx-1`} |
|
|
|
style={{backgroundColor: button.backgroundColor}} |
|
|
|
style={{backgroundColor: button.backgroundColor}} |
|
|
|
onClick={() => setOpenModal(true)}
|
|
|
|
// onClick={() => setOpenModal(true)}
|
|
|
|
|
|
|
|
onClick={() => setSelectedButton(selectedButton === button ? null : button)} |
|
|
|
> |
|
|
|
> |
|
|
|
<p className={`text-sm ${button.textColor}`}>{button.title}</p> |
|
|
|
<p className={`text-sm ${button.textColor}`}>{button.title}</p> |
|
|
|
<img src={button.logo} alt="" className={`cursor-pointer ${button.width} ${button.height} ${button.title === null ? "mr-0": "mx-2"}`} /> |
|
|
|
<img src={button.logo} alt="" className={`cursor-pointer ${button.width} ${button.height} ${button.title === null ? "mr-0": "mx-2"}`} /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
))} |
|
|
|
))} |
|
|
|
{/* <GlobalFilter filterr={filter} setFilterr={setFilter}/> */} |
|
|
|
|
|
|
|
<div |
|
|
|
<div |
|
|
|
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-80" : "opacity-0 pointer-events-none"} |
|
|
|
|
|
|
|
`}
|
|
|
|
|
|
|
|
onClick={() => setOpenModal(false)} |
|
|
|
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{/* <GlobalFilter filter={globalFilter} setFilter={setGlobalFilter} /> */} |
|
|
|
{selectedButton?.components} |
|
|
|
<div className="absolute " |
|
|
|
|
|
|
|
style={{top: "20%"}} |
|
|
|
|
|
|
|
onClick={(e) => e.stopPropagation()} |
|
|
|
|
|
|
|
> <GlobalFilter /> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -50,6 +41,9 @@ EditButtons.defaultProps = { |
|
|
|
title: null, |
|
|
|
title: null, |
|
|
|
textColor: null, |
|
|
|
textColor: null, |
|
|
|
backgroundColor: "#F3F8FF", |
|
|
|
backgroundColor: "#F3F8FF", |
|
|
|
|
|
|
|
// components: " tannaz1",
|
|
|
|
|
|
|
|
components: <GlobalFilter />, |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
logo: filter, |
|
|
|
logo: filter, |
|
|
@ -58,6 +52,7 @@ EditButtons.defaultProps = { |
|
|
|
title: null, |
|
|
|
title: null, |
|
|
|
textColor: null, |
|
|
|
textColor: null, |
|
|
|
backgroundColor: "#F3F8FF", |
|
|
|
backgroundColor: "#F3F8FF", |
|
|
|
|
|
|
|
components: " tannaz1", |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
logo: settings, |
|
|
|
logo: settings, |
|
|
@ -66,6 +61,8 @@ EditButtons.defaultProps = { |
|
|
|
title: null, |
|
|
|
title: null, |
|
|
|
textColor: null, |
|
|
|
textColor: null, |
|
|
|
backgroundColor: "#F3F8FF", |
|
|
|
backgroundColor: "#F3F8FF", |
|
|
|
|
|
|
|
components: "mahdi ", |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
logo: arrow, |
|
|
|
logo: arrow, |
|
|
@ -74,6 +71,8 @@ EditButtons.defaultProps = { |
|
|
|
title: 'عملیات', |
|
|
|
title: 'عملیات', |
|
|
|
textColor: "text-blue-400", |
|
|
|
textColor: "text-blue-400", |
|
|
|
backgroundColor: "#F3F8FF", |
|
|
|
backgroundColor: "#F3F8FF", |
|
|
|
|
|
|
|
components: "tannaz", |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
logo: plus, |
|
|
|
logo: plus, |
|
|
@ -82,6 +81,8 @@ EditButtons.defaultProps = { |
|
|
|
title: 'ثبت جدید', |
|
|
|
title: 'ثبت جدید', |
|
|
|
textColor: "text-white", |
|
|
|
textColor: "text-white", |
|
|
|
backgroundColor: "#65A9FF", |
|
|
|
backgroundColor: "#65A9FF", |
|
|
|
|
|
|
|
components: "mahdi", |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
] |
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
|