master
mahdi andalib 3 years ago
parent 7a70b37c30
commit 78c7dd7b80
  1. 34
      src/components/ReactTable4/Buttons.js
  2. 4
      src/components/ReactTable4/RenderRowSubComponent.js

@ -8,20 +8,28 @@ export const Buttons = ({ row, addTab }) => {
const [activeDetails, setActiveDetails] = useState(null); const [activeDetails, setActiveDetails] = useState(null);
return ( return (
<div className="flex flex-row items-center justify-end"> <div className="flex flex-row items-center justify-end">
<button <div
className="mx-1 flex flex-row items-center justify-around p-2 rounded border border-gray-300" className=""
onClick={() => setActiveDetails(!activeDetails)} onClick={() => {
{...row.getToggleRowExpandedProps()} console.log("mahdi");
setActiveDetails(!activeDetails);
}}
> >
جزئیات <button
<img className="mx-1 flex flex-row items-center justify-around p-2 rounded border border-gray-300"
src={arrowIcon} {...row.getToggleRowExpandedProps()}
alt="" >
className={`mx-1 w-3 cursor-pointer mr-2 ${ جزئیات
activeDetails ? "rotate-60" : "rotate-90" <img
}`} // onClick={() => setActiveDetails(!activeDetails)}
/> src={arrowIcon}
</button> alt=""
className={`mx-1 w-3 cursor-pointer mr-2 ${
activeDetails ? "rotate-60" : "rotate-90"
}`}
/>
</button>
</div>
<div <div
className="mx-1 p-2 rounded border border-gray-300 cursor-pointer" className="mx-1 p-2 rounded border border-gray-300 cursor-pointer"
onClick={() => { onClick={() => {

@ -5,12 +5,12 @@ const RenderRowSubComponent = ({ columns, addTab, row }) => {
return ( return (
<div <div
className="w-full flex flex-row items-center border-r-4 border-blue-600 p-2" className="w-full flex flex-row items-center border-r-4 border-blue-600 p-2 "
style={{ backgroundColor: "#FBFCFE" }} style={{ backgroundColor: "#FBFCFE" }}
> >
{/* right */} {/* right */}
<div <div
className="flex flex-row flex-wrap items-center" className="flex flex-row flex-wrap items-center "
style={{ width: "90%" }} style={{ width: "90%" }}
> >
{/* 1 */} {/* 1 */}

Loading…
Cancel
Save