master
mahdi andalib 3 years ago
parent a298e5fee3
commit 6b7e36b906
  1. 4
      src/components/ReactTable4/Buttons.js
  2. 1
      src/components/ReactTable4/Checkbox.js
  3. 630
      src/components/ReactTable4/EditRow.js

@ -3,6 +3,7 @@ import { useState } from "react";
import arrowIcon from "./arrow-icon.svg"; import arrowIcon from "./arrow-icon.svg";
import more from "./more2.svg"; import more from "./more2.svg";
import edit from "./edit.svg"; import edit from "./edit.svg";
import DropDown from "./DropDown";
export const Buttons = ({ row, addTab }) => { export const Buttons = ({ row, addTab }) => {
const [activeDetails, setActiveDetails] = useState(null); const [activeDetails, setActiveDetails] = useState(null);
@ -36,7 +37,8 @@ export const Buttons = ({ row, addTab }) => {
> >
<img src={edit} alt="" className="w-4" /> <img src={edit} alt="" className="w-4" />
</div> </div>
<img src={more} alt="" className="w-5 cursor-pointer" /> {/* <img src={more} alt="" className="w-5 cursor-pointer" /> */}
<DropDown />
</div> </div>
); );
}; };

@ -11,7 +11,6 @@ export const Checkbox = React.forwardRef(({ indeterminate, ...rest }, ref) => {
return ( return (
<> <>
<input type="checkbox" ref={resolvedRef} {...rest} /> <input type="checkbox" ref={resolvedRef} {...rest} />
<h2>mahdi</h2>
</> </>
); );
}); });

@ -2,301 +2,357 @@ import React from "react";
const EditRow = ({ row, columns }) => { const EditRow = ({ row, columns }) => {
// console.log(columns); // console.log(columns);
return ( return (
<div <section className="bg-white p-4 rounded shadow-md ">
className="flex flex-col border-r-4 border-blue-600 p-2 rounded-sm" <div
style={{ backgroundColor: "#F1F5FE" }} className="flex flex-col border-r-4 border-blue-600 p-2 rounded-md"
> style={{ backgroundColor: "#F1F5FE" }}
{/* 1 */} >
<div className="flex flex-col mr-2 my-2"> {/* 1 */}
<div className="flex flex-row"> <div className="flex flex-col mr-2 my-2">
<div <div className="flex flex-row">
className="w-1 h-4 ml-1 rounded" <div
style={{ backgroundColor: "#65A9FF" }} className="w-1 h-4 ml-1 rounded"
></div> style={{ backgroundColor: "#65A9FF" }}
<p ></div>
className="text-xs text-blue-400" <p
style={{ borderColor: "#65A9FF" }} className="text-xs text-blue-400"
> style={{ borderColor: "#65A9FF" }}
نام و نام خانوادگی: >
</p> نام و نام خانوادگی:
</p>
</div>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.name}
// style={{ width: "100%" }}
/>
</div> </div>
<input {/* 2 */}
type="text" <div className="flex flex-col mr-2 my-2">
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }} <div className="flex flex-row">
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20" <div
value={row.name} className="w-1 h-4 ml-1 rounded"
// style={{ width: "100%" }} style={{ backgroundColor: "#65A9FF" }}
/> ></div>
</div> <p
{/* 2 */} className="text-xs text-blue-400"
<div className="flex flex-col mr-2 my-2"> style={{ borderColor: "#65A9FF" }}
<div className="flex flex-row"> >
<div تاریخ سفارش:
className="w-1 h-4 ml-1 rounded" </p>
style={{ backgroundColor: "#65A9FF" }} </div>
></div> <input
<p type="text"
className="text-xs text-blue-400" style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
style={{ borderColor: "#65A9FF" }} className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
> value={row.order_date}
تاریخ سفارش: />
</p>
</div> </div>
<input {/* 3 */}
type="text" <div className="flex flex-col mr-2 my-2">
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }} <div className="flex flex-row">
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20" <div
value={row.order_date} className="w-1 h-4 ml-1 rounded"
/> style={{ backgroundColor: "#65A9FF" }}
</div> ></div>
{/* 3 */} <p
<div className="flex flex-col mr-2 my-2"> className="text-xs text-blue-400"
<div className="flex flex-row"> style={{ borderColor: "#65A9FF" }}
<div >
className="w-1 h-4 ml-1 rounded" مبلغ سفارش:
style={{ backgroundColor: "#65A9FF" }} </p>
></div> </div>
<p <input
className="text-xs text-blue-400" type="text"
style={{ borderColor: "#65A9FF" }} style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
> className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
مبلغ سفارش: value={row.order_price}
</p> />
</div> </div>
<input {/* 4 */}
type="text" <div className="flex flex-col mr-2 my-2">
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }} <div className="flex flex-row">
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20" <div
value={row.order_price} className="w-1 h-4 ml-1 rounded"
/> style={{ backgroundColor: "#65A9FF" }}
</div> ></div>
{/* 4 */} <p
<div className="flex flex-col mr-2 my-2"> className="text-xs text-blue-400"
<div className="flex flex-row"> style={{ borderColor: "#65A9FF" }}
<div >
className="w-1 h-4 ml-1 rounded" شماره سفارش:
style={{ backgroundColor: "#65A9FF" }} </p>
></div> </div>
<p <input
className="text-xs text-blue-400" type="text"
style={{ borderColor: "#65A9FF" }} style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
> className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
شماره سفارش: value={row.order_number}
</p> />
</div> </div>
<input {/* 5 */}
type="text" <div className="flex flex-col mr-2 my-2">
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }} <div className="flex flex-row">
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20" <div
value={row.order_number} className="w-1 h-4 ml-1 rounded"
/> style={{ backgroundColor: "#65A9FF" }}
</div> ></div>
{/* 5 */} <p
<div className="flex flex-col mr-2 my-2"> className="text-xs text-blue-400"
<div className="flex flex-row"> style={{ borderColor: "#65A9FF" }}
<div >
className="w-1 h-4 ml-1 rounded" شغل کاربر:
style={{ backgroundColor: "#65A9FF" }} </p>
></div> </div>
<p <input
className="text-xs text-blue-400" type="text"
style={{ borderColor: "#65A9FF" }} style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
> className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
شغل کاربر: value={row.user_job}
</p> />
</div> </div>
<input {/* 6 */}
type="text" <div className="flex flex-col mr-2 my-2">
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }} <div className="flex flex-row">
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20" <div
value={row.user_job} className="w-1 h-4 ml-1 rounded"
/> style={{ backgroundColor: "#65A9FF" }}
</div> ></div>
{/* 6 */} <p
<div className="flex flex-col mr-2 my-2"> className="text-xs text-blue-400"
<div className="flex flex-row"> style={{ borderColor: "#65A9FF" }}
<div >
className="w-1 h-4 ml-1 rounded" وضعیت سفارش:
style={{ backgroundColor: "#65A9FF" }} </p>
></div> </div>
<p <input
className="text-xs text-blue-400" type="text"
style={{ borderColor: "#65A9FF" }} style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
> className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
وضعیت سفارش: value={row.order_status}
</p> />
</div>
{/* 7 */}
<div className="flex flex-col mr-2 my-2">
<div className="flex flex-row">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#65A9FF" }}
></div>
<p
className="text-xs text-blue-400"
style={{ borderColor: "#65A9FF" }}
>
سطح اهمیت:
</p>
</div>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.order_level}
/>
</div>
{/* 8 */}
<div className="flex flex-col mr-2 my-2">
<div className="flex flex-row">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#65A9FF" }}
></div>
<p
className="text-xs text-blue-400"
style={{ borderColor: "#65A9FF" }}
>
محل تولد:
</p>
</div>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.birth_place}
/>
</div>
{/* 9 */}
<div className="flex flex-col mr-2 my-2">
<div className="flex flex-row">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#65A9FF" }}
></div>
<p
className="text-xs text-blue-400"
style={{ borderColor: "#65A9FF" }}
>
تلفن محل کار:
</p>
</div>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.office_phone}
/>
</div>
{/* 10 */}
<div className="flex flex-col mr-2 my-2">
<div className="flex flex-row">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#65A9FF" }}
></div>
<p
className="text-xs text-blue-400"
style={{ borderColor: "#65A9FF" }}
>
تحصیلات:
</p>
</div>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.education}
/>
</div>
{/* 11 */}
<div className="flex flex-col mr-2 my-2">
<div className="flex flex-row">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#65A9FF" }}
></div>
<p
className="text-xs text-blue-400"
style={{ borderColor: "#65A9FF" }}
>
تاریخ تولد:
</p>
</div>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.birth_day}
/>
</div>
{/* 12 */}
<div className="flex flex-col mr-2 my-2">
<div className="flex flex-row">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#65A9FF" }}
></div>
<p
className="text-xs text-blue-400"
style={{ borderColor: "#65A9FF" }}
>
شغل:
</p>
</div>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.job}
/>
</div>
{/* 13 */}
<div className="flex flex-col mr-2 my-2">
<div className="flex flex-row">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#65A9FF" }}
></div>
<p
className="text-xs text-blue-400"
style={{ borderColor: "#65A9FF" }}
>
دانشگاه:
</p>
</div>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.uni}
/>
</div>
{/* 14 */}
<div className="flex flex-col mr-2 my-2">
<div className="flex flex-row">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#65A9FF" }}
></div>
<p
className="text-xs text-blue-400"
style={{ borderColor: "#65A9FF" }}
>
رشته تحصیلی:
</p>
</div>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.field_study}
/>
</div>
{/* 15 */}
<div className="flex flex-col mr-2 my-2">
<div className="flex flex-row">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#65A9FF" }}
></div>
<p
className="text-xs text-blue-400"
style={{ borderColor: "#65A9FF" }}
>
اخلاق:
</p>
</div>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.behaviour}
/>
</div>
{/* 16 */}
<div className="flex flex-col mr-2 my-2">
<div className="flex flex-row">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#65A9FF" }}
></div>
<p
className="text-xs text-blue-400"
style={{ borderColor: "#65A9FF" }}
>
نشانی:
</p>
</div>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.address}
/>
</div> </div>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-12/12 mx-4 text-black text-xs rounded-sm mt-4 border p-2 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.order_status}
/>
</div>
{/* 7 */}
<div className="flex flex-row items-center mr-2 my-2">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#EDF2FB" }}
></div>
<p className="text-xs text-blue-400" style={{ borderColor: "#65A9FF" }}>
سطح اهمیت:
</p>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-fit mr-1 text-black text-xs rounded-sm border p-1 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
// {columns[6].Cell({ value: row.order_level })}
value={row.order_level}
/>
</div>
{/* 8 */}
<div className="flex flex-row items-center mr-2 my-2">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#EDF2FB" }}
></div>
<p className="text-xs text-blue-400" style={{ borderColor: "#65A9FF" }}>
محل تولد:
</p>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-fit mr-1 text-black text-xs rounded-sm border p-1 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.birth_place}
/>
</div>
{/* 9 */}
<div className="flex flex-row items-center mr-2 my-2">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#EDF2FB" }}
></div>
<p className="text-xs text-blue-400" style={{ borderColor: "#65A9FF" }}>
تلفن محل کار:
</p>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-fit mr-1 text-black text-xs rounded-sm border p-1 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.office_phone}
/>
</div>
{/* 10 */}
<div className="flex flex-row items-center mr-2 my-2">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#EDF2FB" }}
></div>
<p className="text-xs text-blue-400" style={{ borderColor: "#65A9FF" }}>
تحصیلات:
</p>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-fit mr-1 text-black text-xs rounded-sm border p-1 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.education}
/>
</div>
{/* 11 */}
<div className="flex flex-row items-center mr-2 my-2">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#EDF2FB" }}
></div>
<p className="text-xs text-blue-400" style={{ borderColor: "#65A9FF" }}>
تاریخ تولد:
</p>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-fit mr-1 text-black text-xs rounded-sm border p-1 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.birth_day}
/>
</div>
{/* 12 */}
<div className="flex flex-row items-center mr-2 my-2">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#EDF2FB" }}
></div>
<p className="text-xs text-blue-400" style={{ borderColor: "#65A9FF" }}>
شغل:
</p>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-fit mr-1 text-black text-xs rounded-sm border p-1 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.job}
/>
</div>
{/* 13 */}
<div className="flex flex-row items-center mr-2 my-2">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#EDF2FB" }}
></div>
<p className="text-xs text-blue-400" style={{ borderColor: "#65A9FF" }}>
دانشگاه:
</p>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-fit mr-1 text-black text-xs rounded-sm border p-1 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.uni}
/>
</div>
{/* 14 */}
<div className="flex flex-row items-center mr-2 my-2">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#EDF2FB" }}
></div>
<p className="text-xs text-blue-400" style={{ borderColor: "#65A9FF" }}>
رشته تحصیلی:
</p>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-fit mr-1 text-black text-xs rounded-sm border p-1 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.field_study}
/>
</div>
{/* 15 */}
<div className="flex flex-row items-center mr-2 my-2">
<div
className="w-1 h-4 ml-1 rounded"
style={{ backgroundColor: "#EDF2FB" }}
></div>
<p className="text-xs text-blue-400" style={{ borderColor: "#65A9FF" }}>
اخلاق:
</p>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-full mr-1 text-black text-xs rounded-sm border p-1 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.behaviour}
/>
</div> </div>
{/* 16 */} <button
<div className=" mr-2 my-2"> className="text-sm text-white mt-4 rounded px-4 py-2 mr-10"
<div style={{ backgroundColor: "#65A9FF" }}
className="w-1 h-4 ml-1 rounded" >
style={{ backgroundColor: "#EDF2FB" }} به روز رسانی
></div> </button>
<p className="text-xs text-blue-400" style={{ borderColor: "#65A9FF" }}> </section>
نشانی:
</p>
<input
type="text"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
className="w-full mr-1 text-black text-xs rounded-sm border p-1 focus:outline-none focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
value={row.address}
/>
</div>{" "}
</div>
); );
}; };

Loading…
Cancel
Save