diff --git a/src/components/ReactTable5/BasicTable.js b/src/components/ReactTable5/BasicTable.js index aad215c..4197396 100644 --- a/src/components/ReactTable5/BasicTable.js +++ b/src/components/ReactTable5/BasicTable.js @@ -255,15 +255,10 @@ const BasicTable = ({ addTab, activeTab }) => { })} {row.isExpanded ? ( - - - - - + ) : null} ); diff --git a/src/components/ReactTable5/COLUMNS.js b/src/components/ReactTable5/COLUMNS.js index fd98661..e8e385e 100644 --- a/src/components/ReactTable5/COLUMNS.js +++ b/src/components/ReactTable5/COLUMNS.js @@ -43,7 +43,7 @@ export const COLUMNS = ({ toggelChekedItems, refChekedItems }) => [ { Header: "ویرایش نمایش", accessor: "edit", - Cell: ViewEdit, + Cell: ({ row }) => ViewEdit({ row }), // Cell: ({ row }) => Buttons({ row, addTab }), }, ]; diff --git a/src/components/ReactTable5/EditRow.js b/src/components/ReactTable5/EditRow.js index 5d5a292..0825dbb 100644 --- a/src/components/ReactTable5/EditRow.js +++ b/src/components/ReactTable5/EditRow.js @@ -1,395 +1,67 @@ -import React from "react"; -import SendForm from "./SendForm"; -import Location from "./Location"; -import History from "./History"; +import React, { useState } from "react"; + +const EditRow = ({ row }) => { + const [openModal, setOpenModal] = useState(true); -const EditRow = ({ row, columns }) => { - // console.log(columns); return ( -
setOpenModal(false)} + data-modal-toggle="large-modal" + className={`cursor-pointer w-screen h-screen backdrop-filter backdrop-blur-lg bg-opacity-90 bg-gray-600 flex items-center justify-center fixed left-0 top-0 + ${openModal ? "opacity-80" : "opacity-0 pointer-events-none"}`} > -
-
-

- اطلاعات هویتی -

-
- {/* table data */} -
- {/* 1 */} -
-

- نام و نام خانوادگی: -

- - {row.name} - -
- {/* 2 */} -
-

- تاریخ سفارش: -

- - {row.order_date} - -
- {/* 3 */} -
-

- مبلغ سفارش: -

- - {row.order_price} - -
- {/* 4 */} -
-

- شماره سفارش: -

- - {row.order_number} - -
- {/* 5 */} -
-

- شغل کاربر: -

- - {row.user_job} - -
- {/* 6 */} -
-

- وضعیت سفارش: -

- - {row.order_status} - -
- {/* 7 */} -
-

- سطح اهمیت: -

- - {row.order_level} - -
- {/* 8 */} -
-

- محل تولد: -

- - {row.birth_place} - -
- {/* 9 */} -
-

- تلفن محل کار: -

- - {row.office_phone} - -
- {/* 10 */} -
-

- تحصیلات: -

- - {row.education} - -
- {/* 11 */} -
-

- تاریخ تولد: -

- - {row.birth_day} - -
- {/* 12 */} -
-

- شغل: -

- - {row.job} - -
- {/* 13 */} -
-

- دانشگاه: -

- - {row.uni} - -
- {/* 14 */} -
-

- رشته تحصیلی: -

- - {row.field_study} - -
- {/* 15 */} -
-

- اخلاق: -

- - {row.behaviour} - -
- {/* 16 */} -
-

- نشانی: -

- - {row.address} - -
-
- {/* title bottom */} -
-
-

- اطلاعات شخصی -

-
- {/* bottom */} -
- {/* right */} -
- {/* map */} - - {/* formInput */} - - {/* previous */} - -
- {/* left */} -
- -
+
e.stopPropagation()} + > + + + {row.original.fileName} + + + {row.original.fileType} + + + {row.original.fileSize} + + + {row.original.fileDate} +
-
+ ); }; diff --git a/src/components/ReactTable5/RenderRowSubComponent.js b/src/components/ReactTable5/RenderRowSubComponent.js index ef5a0d5..6953356 100644 --- a/src/components/ReactTable5/RenderRowSubComponent.js +++ b/src/components/ReactTable5/RenderRowSubComponent.js @@ -1,266 +1,21 @@ -import React from "react"; +import React, { useState } from "react"; + +const RenderRowSubComponent = ({ columns, row }) => { + const [openModal, setOpenModal] = useState(true); -const RenderRowSubComponent = ({ columns, addTab, row }) => { return (
setOpenModal(false)} + data-modal-toggle="large-modal" + className={`cursor-pointer w-screen h-screen backdrop-filter backdrop-blur-lg bg-opacity-90 bg-gray-600 flex items-center justify-center fixed left-0 top-0 + ${openModal ? "opacity-80" : "opacity-0 pointer-events-none"}`} > - {/* right */} -
- {/* 1 */} -
-
-

- نام و نام خانوادگی: - {row.name} -

-
- {/* 2 */} -
-
-

- تاریخ سفارش: - {row.order_date} -

-
- {/* 3 */} -
-
-

- مبلغ سفارش: - {row.order_price} -

-
- {/* 4 */} -
-
-

- شماره سفارش: - {row.order_number} -

-
- {/* 5 */} -
-
-

- شغل کاربر: - {row.user_job} -

-
- {/* 6 */} -
-
-

- وضعیت سفارش: -

- - {columns[5].Cell({ value: row.order_status })} - -
- {/* 7 */} -
-
-

- سطح اهمیت: -

- - {columns[6].Cell({ value: row.order_level })} - -
- {/* 8 */} -
-
-

- محل تولد: - {row.birth_place} -

-
- {/* 9 */} -
-
-

- تلفن محل کار: - {row.office_phone} -

-
- {/* 10 */} -
-
-

- تحصیلات: - {row.education} -

-
- {/* 11 */} -
-
-

- تاریخ تولد: - {row.birth_day} -

-
- {/* 12 */} -
-
-

- شغل: - {row.job} -

-
- {/* 13 */} -
-
-

- دانشگاه: - {row.uni} -

-
- {/* 14 */} -
-
-

- رشته تحصیلی: - {row.field_study} -

-
- {/* 15 */} -
-
-

- اخلاق: - {row.behaviour} -

-
- {/* 16 */} -
-
-

- نشانی: - {row.address} -

-
-
- {/* left */}
e.stopPropagation()} > - - +
); diff --git a/src/components/ReactTable5/ViewEdit.js b/src/components/ReactTable5/ViewEdit.js index 4293975..b782776 100644 --- a/src/components/ReactTable5/ViewEdit.js +++ b/src/components/ReactTable5/ViewEdit.js @@ -1,32 +1,41 @@ -import React from "react"; +import React, { useState } from "react"; import ButtonNewDesign from "../ButtonNewDesign"; +import EditRow from "./EditRow"; -const ViewEdit = () => { +const ViewEdit = ({ row }) => { + const [selectedTab, setSelectedTab] = useState(false); return (
- - +
e.stopPropagation()}> + +
+
e.stopPropagation()}> + setSelectedTab(true)} + /> +
+ {selectedTab === true ? : ""}
); };