parent
45e2b6c945
commit
e8f62a62cb
3 changed files with 55 additions and 35 deletions
After Width: | Height: | Size: 555 B |
@ -0,0 +1,43 @@ |
||||
import React, { useState } from "react"; |
||||
|
||||
import Button from "../Button"; |
||||
import FormInput from "../FormInput"; |
||||
|
||||
const Modal = () => { |
||||
const [openModal, setOpenModal] = useState(false); |
||||
console.log(openModal); |
||||
|
||||
return ( |
||||
<div> |
||||
<Button |
||||
className={`bg-[#046AE8] text-white rounded-md px-2 py-2 text-sm`} |
||||
iconHolderClassName={"bg-transparent mr-1"} |
||||
iconClassName={"w-5"} |
||||
icon={"images/blue-edit-icon.svg"} |
||||
text={"ویرایش"} |
||||
onClick={() => setOpenModal(true)} |
||||
/> |
||||
|
||||
<div |
||||
className={`cursor-pointer w-screen h-screen flex items-center justify-center bg-black fixed left-0 top-0 duration-300 transition-all
|
||||
${openModal ? "opacity-60" : "opacity-0 pointer-events-none"} |
||||
`}
|
||||
> |
||||
<div |
||||
className="w-1/2 flex flex-col bg-white border border-gray-400 rounded-sm p-5" |
||||
onClick={(e) => e.stopPropagation()} |
||||
> |
||||
<Button |
||||
className="bg-[#D11B1B] w-fit p-1.5 rounded-sm self-end" |
||||
text={false} |
||||
icon={"images/white-cancel.svg"} |
||||
iconHolderClassName={"mr-0"} |
||||
/> |
||||
<FormInput /> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
); |
||||
}; |
||||
|
||||
export default Modal; |
Loading…
Reference in new issue