Merge branch 'master' of https: update 13 files, create 49 files and delete 2 files //git.sitenevis.com/mahdi/danovinTasks

master
amir hosein gorji 3 years ago
commit 59c14e1604
  1. 30
      package-lock.json
  2. 1
      package.json
  3. 9
      src/App.js
  4. 57
      src/components/Digikala/Banners.js
  5. 75
      src/components/Digikala/Categories.js
  6. BIN
      src/components/Digikala/General.png
  7. 76
      src/components/Digikala/ImageSlider.js
  8. 213
      src/components/Digikala/Offer.js
  9. 19
      src/components/Digikala/SliderData.js
  10. BIN
      src/components/Digikala/belt-bag.jpg
  11. 8
      src/components/Digikala/black-left-arrow.svg
  12. 8
      src/components/Digikala/black-right-arrow.svg
  13. BIN
      src/components/Digikala/camera.jpg
  14. BIN
      src/components/Digikala/club.png
  15. BIN
      src/components/Digikala/danovin.jpg
  16. BIN
      src/components/Digikala/greeeeen.jpg
  17. BIN
      src/components/Digikala/green.jpg
  18. 19
      src/components/Digikala/index.js
  19. 0
      src/components/Digikala/index.scss
  20. BIN
      src/components/Digikala/jet.png
  21. BIN
      src/components/Digikala/mamoriat.png
  22. 10
      src/components/Digikala/more2.svg
  23. BIN
      src/components/Digikala/mouse.jpg
  24. BIN
      src/components/Digikala/o2.jpg
  25. BIN
      src/components/Digikala/o3.jpg
  26. BIN
      src/components/Digikala/oloom4.jpg
  27. BIN
      src/components/Digikala/pay.png
  28. BIN
      src/components/Digikala/pic1.jpg
  29. BIN
      src/components/Digikala/pic2.jpg
  30. BIN
      src/components/Digikala/pic3.jpg
  31. BIN
      src/components/Digikala/pic4.jpg
  32. BIN
      src/components/Digikala/pic5.jpg
  33. BIN
      src/components/Digikala/pic6.jpg
  34. BIN
      src/components/Digikala/pindo.png
  35. BIN
      src/components/Digikala/plus.png
  36. BIN
      src/components/Digikala/r1.jpg
  37. BIN
      src/components/Digikala/r2.jpg
  38. BIN
      src/components/Digikala/radio.jpg
  39. BIN
      src/components/Digikala/shampoo.jpg
  40. BIN
      src/components/Digikala/style.png
  41. 6
      src/components/Digikala/white-left-arrow.svg
  42. 8
      src/components/Digikala/white-right-arrow.svg
  43. 7
      src/components/ProductSuggestion/index.js
  44. 505
      src/components/ReactTable4/BasicTable.js
  45. 8
      src/components/ReactTable4/Buttons.js
  46. 19
      src/components/ReactTable4/ColumnFilter.js
  47. 36
      src/components/ReactTable4/ColumnSearch.js
  48. 51
      src/components/ReactTable4/DropDown.js
  49. 111
      src/components/ReactTable4/EditButtons.js
  50. 52
      src/components/ReactTable4/GlobalFilter.js
  51. 19
      src/components/ReactTable4/GoToPage.js
  52. 102
      src/components/ReactTable4/MOCK_DATA.json
  53. 302
      src/components/ReactTable4/NOTUSINGBasicTableDefaultCode.js
  54. 61
      src/components/ReactTable4/Pagination.js
  55. 56
      src/components/ReactTable4/SelectColumnFilter.js
  56. 56
      src/components/ReactTable4/SelectColumnFilter2.js
  57. 13
      src/components/ReactTable4/Settings.js
  58. 40
      src/components/ReactTable4/SliderColumnFilter.js
  59. 21
      src/components/ReactTable4/ToggleColumns.js
  60. 27
      src/components/ReactTable4/columns.js
  61. 75
      src/components/ReactTable4/index.js
  62. 6
      src/components/ReactTable4/zarbedar-icon.svg
  63. 7
      tailwind.config.js
  64. 28
      yarn.lock

30
package-lock.json generated

@ -30,6 +30,7 @@
"sass": "^1.45.0", "sass": "^1.45.0",
"sweetalert2": "^11.3.4", "sweetalert2": "^11.3.4",
"tw-elements": "^1.0.0-alpha8", "tw-elements": "^1.0.0-alpha8",
"use-draggable-scroll": "^0.1.0",
"web-vitals": "^2.1.2" "web-vitals": "^2.1.2"
}, },
"devDependencies": { "devDependencies": {
@ -15678,9 +15679,9 @@
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}, },
"node_modules/tw-elements": { "node_modules/tw-elements": {
"version": "1.0.0-alpha8", "version": "1.0.0-alpha9",
"resolved": "https://registry.npmjs.org/tw-elements/-/tw-elements-1.0.0-alpha8.tgz", "resolved": "https://registry.npmjs.org/tw-elements/-/tw-elements-1.0.0-alpha9.tgz",
"integrity": "sha512-feqb4XmHWH8KUOT7KEC3lc258VmypcI6ettdR9adN/dEfk9wXcp/G+XPOhnAAQiXeyTDOCuDF/GNo6kMN++YXw==", "integrity": "sha512-Qw88PhQQQzQ6Ohsaze8FBy3ijMJnvMe0BeD5f31tfi5KAi39y6QvmgRBxnSnLNmpvq5ItxNOxlVKMPfUCgDwfw==",
"dependencies": { "dependencies": {
"@popperjs/core": "^2.6.0", "@popperjs/core": "^2.6.0",
"bootstrap": "^5.1.3", "bootstrap": "^5.1.3",
@ -15869,6 +15870,17 @@
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
"integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0="
}, },
"node_modules/use-draggable-scroll": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/use-draggable-scroll/-/use-draggable-scroll-0.1.0.tgz",
"integrity": "sha512-mX6nT3cUqOTtA+8QUH9HfdKtzI6Oquj9QIB0wALWZYmWogNQ746MaUcmqKOKCIlt2UH6egxhSKNPiSlfEqmKhA==",
"engines": {
"node": ">=10"
},
"peerDependencies": {
"react": ">=16"
}
},
"node_modules/util-deprecate": { "node_modules/util-deprecate": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
@ -28136,9 +28148,9 @@
} }
}, },
"tw-elements": { "tw-elements": {
"version": "1.0.0-alpha8", "version": "1.0.0-alpha9",
"resolved": "https://registry.npmjs.org/tw-elements/-/tw-elements-1.0.0-alpha8.tgz", "resolved": "https://registry.npmjs.org/tw-elements/-/tw-elements-1.0.0-alpha9.tgz",
"integrity": "sha512-feqb4XmHWH8KUOT7KEC3lc258VmypcI6ettdR9adN/dEfk9wXcp/G+XPOhnAAQiXeyTDOCuDF/GNo6kMN++YXw==", "integrity": "sha512-Qw88PhQQQzQ6Ohsaze8FBy3ijMJnvMe0BeD5f31tfi5KAi39y6QvmgRBxnSnLNmpvq5ItxNOxlVKMPfUCgDwfw==",
"requires": { "requires": {
"@popperjs/core": "^2.6.0", "@popperjs/core": "^2.6.0",
"bootstrap": "^5.1.3", "bootstrap": "^5.1.3",
@ -28279,6 +28291,12 @@
} }
} }
}, },
"use-draggable-scroll": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/use-draggable-scroll/-/use-draggable-scroll-0.1.0.tgz",
"integrity": "sha512-mX6nT3cUqOTtA+8QUH9HfdKtzI6Oquj9QIB0wALWZYmWogNQ746MaUcmqKOKCIlt2UH6egxhSKNPiSlfEqmKhA==",
"requires": {}
},
"util-deprecate": { "util-deprecate": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",

@ -24,6 +24,7 @@
"redux": "^4.1.2", "redux": "^4.1.2",
"sass": "^1.45.0", "sass": "^1.45.0",
"sweetalert2": "^11.3.4", "sweetalert2": "^11.3.4",
"swiper": "^8.0.6",
"tw-elements": "^1.0.0-alpha8", "tw-elements": "^1.0.0-alpha8",
"use-draggable-scroll": "^0.1.0", "use-draggable-scroll": "^0.1.0",
"web-vitals": "^2.1.2" "web-vitals": "^2.1.2"

@ -44,6 +44,8 @@ import TableDesign1 from "./components/Table/Design1";
import ReactTable2 from "./components/ReactTable2"; import ReactTable2 from "./components/ReactTable2";
import ReactTable3 from "./components/ReactTable3"; import ReactTable3 from "./components/ReactTable3";
import ReactTable4 from "./components/ReactTable4"; import ReactTable4 from "./components/ReactTable4";
import Digikala from "./components/Digikala";
// import Digikala from "./components/Digikala/ImageSlider";
import Switch from "./components/Switch"; import Switch from "./components/Switch";
@ -90,14 +92,17 @@ function App() {
{/* <TableDesign1 /> */} {/* <TableDesign1 /> */}
{/* <ReactTable2 /> */} {/* <ReactTable2 /> */}
{/* <ReactTable3 /> */} {/* <ReactTable3 /> */}
<HeaderDesign1 /> <ReactTable4 />
{/* <Digikala /> */}
{/* <DigikalaShop /> */}
{/* <HeaderDesign1 />
<div className="flex"> <div className="flex">
<SidebarDesign2 className="w-1/5" /> <SidebarDesign2 className="w-1/5" />
<span className="w-4/5 "> <span className="w-4/5 ">
<ReactTable4 /> <ReactTable4 />
<FooterDesign1 /> <FooterDesign1 />
</span> </span>
</div> </div> */}
</div> </div>
</Provider> </Provider>
); );

@ -0,0 +1,57 @@
import React from "react";
import pic2 from "./pic2.jpg";
import danovin from "./danovin.jpg";
import greeeeen from "./greeeeen.jpg";
const Banners = ({ mainBanner, leftBanner, midTopBanner, midBottomBanner }) => {
return (
<div
className="flex justify-between w-10/12 mx-auto my-10"
style={{
height: "400px",
}}
>
<div
className={`h-full w-1/2 rounded-xl flex items-center`}
style={{
background: mainBanner ? "" : "rgba(134,160,185,0.16)",
}}
>
<img src={danovin} className="rounded-xl h-full" />
</div>
<div className="flex h-full w-1/2 ">
<div className="flex flex-col w-1/2 h-full px-6 justify-center items-between">
<div
className={`${midTopBanner ? "" : "h-1/2 "} w-full rounded-xl mb-2`}
style={{
background: midTopBanner ? "" : "rgba(134,160,185,0.16)",
}}
>
<img src={pic2} className="rounded-xl" />
</div>
<div
className={`${
midBottomBanner ? "" : "h-1/2 "
} w-full rounded-xl mt-2`}
style={{
background: midBottomBanner ? "" : "rgba(134,160,185,0.16)",
}}
>
<img src={pic2} className="rounded-xl" />
</div>
</div>
<div
className=" h-full w-1/2 rounded-xl"
style={{
background: leftBanner ? "" : "rgba(134,160,185,0.16)",
}}
>
<img src={greeeeen} className="rounded-xl h-full" />
</div>
</div>
</div>
);
};
export default Banners;

@ -0,0 +1,75 @@
import React from "react";
import jet from "./jet.png";
import style from "./style.png";
import pay from "./pay.png";
import pindo from "./pindo.png";
import mamoriat from "./mamoriat.png";
import plus from "./plus.png";
import club from "./club.png";
import more from "./more2.svg";
const Categories = ({ items }) => {
return (
<section className="my-10 w-7/12 mx-auto">
<div className="flex flex-row items-center justify-between">
{items.slice(0, 7).map((item, index) => (
<div
className="flex flex-col items-center justify-center cursor-pointer"
key={index}
>
<img src={item.image} className="w-14" />
<span className="text-xs mt-3">{item.title}</span>
</div>
))}
<div
// className={`${items.length > 9 ? "bg-blue-600" : "bg-red-600"}`}
className="flex flex-col items-center justify-center "
>
<div
style={{ background: "#f0f0f1" }}
className="cursor-pointer rounded-full w-14 h-14 p-2 flex flex-col items-center justify-center"
>
<img src={more} className="w-8 rotate-90" />
</div>
<span className="text-xs mt-3">بیشتر</span>{" "}
</div>
</div>
</section>
);
};
export default Categories;
Categories.defaultProps = {
items: [
{
image: jet,
title: "دیجی کالا جت",
},
{
image: style,
title: "دیجی استایل",
},
{
image: pay,
title: "دیجی پی",
},
{
image: pindo,
title: "پیندو",
},
{
image: mamoriat,
title: "ماموریت ها",
},
{
image: plus,
title: "دیجی پلاس",
},
{
image: club,
title: "دیجی کلاب",
},
],
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

@ -0,0 +1,76 @@
import React, { useState } from "react";
import rightArrow from "./black-right-arrow.svg";
import leftArrow from "./black-left-arrow.svg";
const ImageSlider = ({ slides }) => {
const [current, setCurrent] = useState(0);
const length = slides.length;
const nextSlide = () => {
setCurrent(current === length - 1 ? 0 : current + 1);
};
const prevSlide = () => {
setCurrent(current === 0 ? length - 1 : current - 1);
};
console.log(current);
if (!Array.isArray(slides) || slides.length <= 0) {
return null;
}
return (
<section className="bg-red-100">
<div className="relative bg-pink-400">
{slides.map((slide, index) => {
return (
<div
className={index === current ? "slide active" : "slide"}
key={index}
>
{index === current && (
<img
src={slide.image}
alt="mahdi"
className="w-full"
style={{ height: "100%" }}
/>
)}
</div>
);
})}
<Tabbar nextSlide={nextSlide} prevSlide={prevSlide} />
</div>
</section>
);
};
export default ImageSlider;
function Tabbar({ nextSlide, prevSlide }) {
const tabs = [
{
icon: rightArrow,
click: nextSlide,
},
{
icon: leftArrow,
click: prevSlide,
},
];
return (
<div className="flex flex-row items-center absolute bottom-7 right-10">
{tabs.map((tab, index) => (
<button
onClick={tab.click}
key={index}
className="bg-white border border-gray-300 rounded-full mx-1 p-2"
>
<img src={tab.icon} className="w-4" />
</button>
))}
</div>
);
}

@ -0,0 +1,213 @@
import React from "react";
import { Swiper, SwiperSlide } from "swiper/react";
// Import Swiper styles
import "swiper/css";
import "swiper/css/navigation";
import "swiper/css/pagination";
import "./index.scss";
import leftArrow from "./white-left-arrow.svg";
import General from "./General.png";
import o2 from "./o2.jpg";
import o3 from "./o3.jpg";
import r1 from "./r1.jpg";
import r2 from "./r2.jpg";
const Offer = ({ products }) => {
return (
<section
className="my-10 w-8/12 mx-auto rounded-2xl p-5"
style={{ backgroundColor: "#ef3a4f" }}
>
<div className="flex flex-row items-center p-2">
{/* right */}
<div className="flex flex-col items-center justify-between w-2/12">
<span className="text-base text-center text-white font-bold leading-8">
پیـــــشنهاد
<br />
شگــــفت
<br />
انـــگیز
</span>
<img src={General} className="w-28 my-2" />
<button className="text-sm text-white flex flex-row items-center">
مشاهده همه
<img src={leftArrow} className="w-3 mr-1" />
</button>
</div>
{/* left */}
<div className="w-10/12 flex flex-row items-center rounded-lg bg-white cursor-pointer">
<Swiper
// spaceBetween={0}
slidesPerView={5}
// navigation
pagination={{ clickable: true }}
scrollbar={{ draggable: true }}
onSlideChange={() => console.log("slide change")}
onSwiper={(swiper) => console.log(swiper)}
>
{/* */}
{products.map((product, index) => (
<SwiperSlide>
<div className="flex flex-col p-2">
<img src={product.image} className="rounded" />
<div className="flex flex-row justify-between items-center mt-4">
<p className="text-xs text-white bg-red-600 px-2 py-0.5 rounded-lg mr-1">
{product.discount}
<span className="">%</span>
</p>
<div className="flex flex-row items-center">
<p className="text-sm ml-1">{product.price}</p>
<div className="relative">
<span className="text-xs">توما</span>
<span className="text-xs absolute left-0.5 -top-2">
ن
</span>
</div>
</div>
</div>
<p
className="text-left text-xs line-through my-2 ml-3"
style={{ color: "#c0c2c5" }}
>
{product.discountPrice}
</p>
<div className="bg-gray-200 h-1.5 mx-auto rounded mt-2 flex flex-row-reverse w-11/12">
<div
className={`h-1.5 rounded duration-500`}
style={{
width: product.rangeWidth,
backgroundColor: "#ef3a4f",
}}
></div>
</div>
</div>
</SwiperSlide>
))}
</Swiper>
</div>
</div>
</section>
);
};
export default Offer;
Offer.defaultProps = {
products: [
{
image: o2,
price: 20900000,
discount: 7,
rangeWidth: "33%",
discountPrice: 75000,
},
{
image: o3,
price: 11000000,
discount: 2,
rangeWidth: "75%",
discountPrice: 75000,
},
{
image: r1,
price: 3205000,
discount: 70,
rangeWidth: "72%",
discountPrice: 75000,
},
{
image: r2,
price: 30000,
discount: 75,
rangeWidth: "44%",
discountPrice: 75000,
},
{
image: o2,
price: 20900000,
discount: 7,
rangeWidth: "33%",
discountPrice: 75000,
},
{
image: o3,
price: 11000000,
discount: 2,
rangeWidth: "75%",
discountPrice: 75000,
},
{
image: r1,
price: 3205000,
discount: 70,
rangeWidth: "72%",
discountPrice: 75000,
},
{
image: r2,
price: 30000,
discount: 75,
rangeWidth: "44%",
discountPrice: 75000,
},
{
image: o2,
price: 20900000,
discount: 7,
rangeWidth: "33%",
discountPrice: 75000,
},
{
image: o3,
price: 11000000,
discount: 2,
rangeWidth: "75%",
discountPrice: 75000,
},
{
image: r1,
price: 3205000,
discount: 70,
rangeWidth: "72%",
discountPrice: 75000,
},
{
image: r2,
price: 30000,
discount: 75,
rangeWidth: "44%",
discountPrice: 75000,
},
{
image: o2,
price: 20900000,
discount: 7,
rangeWidth: "33%",
discountPrice: 75000,
},
{
image: o3,
price: 11000000,
discount: 2,
rangeWidth: "75%",
discountPrice: 75000,
},
{
image: r1,
price: 3205000,
discount: 70,
rangeWidth: "72%",
discountPrice: 75000,
},
{
image: r2,
price: 30000,
discount: 75,
rangeWidth: "44%",
discountPrice: 75000,
},
],
};

@ -0,0 +1,19 @@
import pic4 from "./pic4.jpg";
import pic6 from "./pic6.jpg";
import pic5 from "./pic5.jpg";
import pic3 from "./pic3.jpg";
export const SliderData = [
{
image: pic4,
},
{
image: pic6,
},
{
image: pic5,
},
{
image: pic3,
},
];

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="37.14" height="37.14" viewBox="0 0 37.14 37.14">
<g id="vuesax_linear_arrow-left" data-name="vuesax/linear/arrow-left" transform="translate(-364 -252)">
<g id="arrow-left" transform="translate(364 252)">
<path id="Vector" d="M10.983,24.512.894,14.423a3.073,3.073,0,0,1,0-4.333L10.983,0" transform="translate(12.229 6.314)" fill="none" stroke="#646464" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/>
<path id="Vector-2" data-name="Vector" d="M0,0H37.14V37.14H0Z" transform="translate(37.14 37.14) rotate(180)" fill="none" opacity="0"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 642 B

@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="37.14" height="37.14" viewBox="0 0 37.14 37.14">
<g id="vuesax_linear_arrow-left" data-name="vuesax/linear/arrow-left" transform="translate(401.14 289.14) rotate(180)">
<g id="arrow-left" transform="translate(364 252)">
<path id="Vector" d="M10.983,24.512.894,14.423a3.073,3.073,0,0,1,0-4.333L10.983,0" transform="translate(12.229 6.314)" fill="none" stroke="#646464" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/>
<path id="Vector-2" data-name="Vector" d="M0,0H37.14V37.14H0Z" transform="translate(37.14 37.14) rotate(180)" fill="none" opacity="0"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 658 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB

@ -0,0 +1,19 @@
import React from "react";
import ImageSlider from "./ImageSlider";
import { SliderData } from "./SliderData";
import Categories from "./Categories";
import Offer from "./Offer";
import Banners from "./Banners";
const Digikala = () => {
return (
<div>
<ImageSlider slides={SliderData} />
<Banners />
<Categories />
<Offer />
</div>
);
};
export default Digikala;

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

@ -0,0 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<g id="vuesax_linear_more" data-name="vuesax/linear/more" transform="translate(-188 580) rotate(-90)">
<g id="more">
<path id="Vector" d="M2,0A2,2,0,1,0,4,2,2.006,2.006,0,0,0,2,0Z" transform="translate(559 198)" fill="#6397b5"/>
<path id="Vector-2" data-name="Vector" d="M2,0A2,2,0,1,0,4,2,2.006,2.006,0,0,0,2,0Z" transform="translate(573 198)" fill="#6397b5"/>
<path id="Vector-3" data-name="Vector" d="M2,0A2,2,0,1,0,4,2,2.006,2.006,0,0,0,2,0Z" transform="translate(566 198)" fill="#6397b5"/>
<path id="Vector-4" data-name="Vector" d="M0,0H24V24H0Z" transform="translate(556 188)" fill="#6397b5" opacity="0"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 749 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

@ -0,0 +1,6 @@
<svg id="vuesax_linear_arrow-left" data-name="vuesax/linear/arrow-left" xmlns="http://www.w3.org/2000/svg" width="33.524" height="33.524" viewBox="0 0 33.524 33.524">
<g id="arrow-left" transform="translate(0 0)">
<path id="Vector" d="M9.914,22.126.807,13.018a2.774,2.774,0,0,1,0-3.911L9.914,0" transform="translate(11.038 5.699)" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/>
<path id="Vector-2" data-name="Vector" d="M0,0H33.524V33.524H0Z" transform="translate(33.524 33.524) rotate(180)" fill="none" opacity="0"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 587 B

@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="37.14" height="37.14" viewBox="0 0 37.14 37.14">
<g id="vuesax_linear_arrow-left" data-name="vuesax/linear/arrow-left" transform="translate(401.14 289.14) rotate(180)">
<g id="arrow-left" transform="translate(364 252)">
<path id="Vector" d="M10.983,24.512.894,14.423a3.073,3.073,0,0,1,0-4.333L10.983,0" transform="translate(12.229 6.314)" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/>
<path id="Vector-2" data-name="Vector" d="M0,0H37.14V37.14H0Z" transform="translate(37.14 37.14) rotate(180)" fill="none" opacity="0"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 655 B

@ -19,7 +19,12 @@ const ProductSuggestion = ({ suggestions, selected }) => {
<div <div
className={`flex flex-col items-center border rounded-md border-gray-300 p-5 mx-4 cursor-pointer transition-all ease-in-out duration-500 className={`flex flex-col items-center border rounded-md border-gray-300 p-5 mx-4 cursor-pointer transition-all ease-in-out duration-500
${selectedProduct === suggestion ? "bg-white" : ""}`} ${selectedProduct === suggestion ? "bg-white" : ""}`}
onClick={() => setSelectedProduct(suggestion)} // onClick={() => setSelectedProduct(suggestion)}
onClick={() =>
setSelectedProduct(
selectedProduct === suggestion ? null : suggestion
)
}
> >
<img <img
src={suggestion.productImage} src={suggestion.productImage}

@ -1,6 +1,9 @@
import React, { useMemo } from "react"; import React, { useMemo, useState } from "react";
import "./index.scss"; import "./index.scss";
import { ColumnSearch } from "./ColumnSearch.js";
import { ToggleColumns } from "./ToggleColumns.js";
import { Tabbar } from "./index";
import { import {
useTable, useTable,
@ -11,73 +14,28 @@ import {
useRowSelect, useRowSelect,
useColumnOrder, useColumnOrder,
useExpanded, useExpanded,
useResizeColumns,
} from "react-table"; } from "react-table";
import { COLUMNS } from "./columns"; import { COLUMNS } from "./columns";
import { GlobalFilter } from "./GlobalFilter"; import { GlobalFilter } from "./GlobalFilter";
import { Checkbox } from "./Checkbox";
import MOCK_DATA from "./MOCK_DATA.json";
import dobleLeftArrow from "./double-left-arrow.svg"; import { Pagination } from "./Pagination";
import leftArrow from "./left-arrow.svg"; import { GoToPage } from "./GoToPage";
import rightArrow from "./right-arrow.svg"; import { Settings } from "./Settings";
// This is a custom filter UI for selecting import { Checkbox } from "./Checkbox";
// a unique option from a list import MOCK_DATA from "./MOCK_DATA.json";
export function SelectColumnFilter({
column: { filterValue, setFilter, preFilteredRows, id, render },
}) {
const options = React.useMemo(() => {
const options = new Set();
preFilteredRows.forEach((row) => {
options.add(row.values[id]);
});
return [...options.values()];
}, [id, preFilteredRows]);
// Render a multi-select box
return (
<label className="flex gap-x-2 items-baseline">
<span className="text-gray-700">{render("Header")}: </span>
<select
className="rounded-md border-gray-300 shadow-sm text-xs focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
name={id}
id={id}
value={filterValue}
onChange={(e) => {
setFilter(e.target.value || undefined);
}}
>
<option className="text-xs" value="">
همه
</option>
{options.map((option, i) => (
<option key={i} value={option} className="text-xs">
{(() => {
if (option === 1) {
return "وضعیت عادی";
} else if (option === 2) {
return "اعلان سطح هشدار";
} else if (option === 3) {
return "بررسی و پیگیری";
} else if (option === 4) {
return "وضعیت بحرانی";
} else {
return " وضعیت پایدار";
}
})()}{" "}
</option>
))}
</select>
</label>
);
}
const BasicTable = () => { const BasicTable = ({ settingsIcon }) => {
const columns = React.useMemo(() => COLUMNS, []); const columns = React.useMemo(() => COLUMNS, []);
const data = useMemo(() => MOCK_DATA, []); const data = useMemo(() => MOCK_DATA, []);
const defaultColumn = useMemo(() => {
return {
Filter: ColumnSearch,
};
}, []);
// اگر بخواهیم ردیف های جدولمون یکی در میان زنگ پس زمینه اشون با هم فرق کند // اگر بخواهیم ردیف های جدولمون یکی در میان زنگ پس زمینه اشون با هم فرق کند
const isEven = (idx) => idx % 2 === 0; const isEven = (idx) => idx % 2 === 0;
@ -108,7 +66,7 @@ const BasicTable = () => {
{ {
columns, columns,
data, data,
// initialState: { pageIndex: 2 } defaultColumn,
}, },
useColumnOrder, useColumnOrder,
useFilters, useFilters,
@ -135,117 +93,54 @@ const BasicTable = () => {
} }
); );
const changeOrder = () => {
setColumnOrder([
"name",
"order-number",
"user-job",
"order-level",
"order-status",
"order-price",
]);
};
const { globalFilter, pageIndex, pageSize } = state; const { globalFilter, pageIndex, pageSize } = state;
// const firstPageRows = rows.slice(0, 10);
return ( return (
<> <>
{/* filter */}
{/* <div className="customeClass1">
{headerGroups.map((headerGroup) =>
headerGroup.headers.map((column) =>
column.Filter ? (
<div className="mt-2 sm:mt-0 customeClass2" key={column.id}>
{column.render("Filter")}
</div>
) : null
)
)}
</div> */}
{/* */}
{/* toggle columns */} {/* toggle columns */}
{/* <div> <ToggleColumns
<div> allColumns={allColumns}
<Checkbox {...getToggleHideAllColumnsProps()} /> Toggle All getToggleHideAllColumnsProps={getToggleHideAllColumnsProps}
/>
<div className="flex flex-row items-center justify-between">
{/* right box */}
<div className="" style={{ width: "70%" }}>
<Tabbar />
</div> </div>
{allColumns.map((column) => ( {/* left box */}
<div key={column.id}>
<label>
<input type="checkbox" {...column.getToggleHiddenProps()} />
{column.Header}
</label>
</div>
))}
</div> */}
{/* Change Column Order */}
{/* <button onClick={changeOrder}> Change Column Order </button> */}
<div className="flex flex-row items-center justify-end mb-3 mx-4">
{/* search box */}
<div <div
className="rounded-md py-2 px-4 flex flex-row flex-items-center" className="rounded-md p-2 flex flex-row items-center justify-end"
style={{ backgroundColor: "#F1F6FF" }} style={{ backgroundColor: "#F1F6FF" }}
> >
{/* <GlobalFilter filter={globalFilter} setFilter={setGlobalFilter} /> */} {/* search box */}
<GlobalFilter filter={globalFilter} setFilter={setGlobalFilter} />
{/* pagination */} {/* pagination */}
<div className="flex flex-row flex-items-center bg-white p-1"> <div
className="flex flex-row items-center p-1 rounded"
style={{ backgroundColor: "#F9FBFF" }}
>
{/* go to page */} {/* go to page */}
<div> <GoToPage
<input pageIndex={pageIndex}
className="ml-1 text-xs p-1 rounded border-blue-400" gotoPage={gotoPage}
type="number" pageOptions={pageOptions}
defaultValue={pageIndex + 1} />
onChange={(e) => { {/* vertical line */}
const pageNumber = e.target.value <div
? Number(e.target.value) - 1 className={`w-0.5 h-4 mr-2`}
: 0; style={{ backgroundColor: "#65A9FF" }}
gotoPage(pageNumber); ></div>
}}
style={{ width: "50px" }}
/>
<span className={`text-xs`} style={{ color: "#65A9FF" }}>
{" "}
برو به صفحه{" "}
</span>
</div>
{/* */}
<div className={`bg-gray-400 w-0.5 my-2 mx-1`}></div>
{/* arrows */} {/* arrows */}
<button <Pagination
className="rounded py-1 px-2 mx-1 text-xs font-bold" gotoPage={gotoPage}
style={{ backgroundColor: "#F5F9FF", color: "#65A9FF" }} canPreviousPage={canPreviousPage}
onClick={() => gotoPage(0)} previousPage={previousPage}
disabled={!canPreviousPage} canNextPage={canNextPage}
> pageCount={pageCount}
<img src={dobleLeftArrow} /> nextPage={nextPage}
</button> />
<button
className="rounded py-1 px-2 mx-1 text-xs font-bold"
style={{ backgroundColor: "#F5F9FF", color: "#65A9FF" }}
onClick={() => previousPage()}
disabled={!canPreviousPage}
>
{"<"}
</button>
<button
className="rounded py-1 px-2 mx-1 text-xs font-bold"
style={{ backgroundColor: "#F5F9FF", color: "#65A9FF" }}
onClick={() => nextPage()}
disabled={!canNextPage}
>
{">"}
</button>
<button
className="rounded py-1 px-2 mx-1 text-xs font-bold"
style={{ backgroundColor: "#F5F9FF", color: "#65A9FF" }}
onClick={() => gotoPage(pageCount - 1)}
disabled={!canNextPage}
>
{">>"}
</button>
{/* dobleLeftArrow
leftArrow
import rightArrow from "./right-arrow.svg"; */}
</div> </div>
{/* settings icon */}
{settingsIcon && <Settings />}
</div> </div>
</div> </div>
<table <table
@ -275,6 +170,19 @@ import rightArrow from "./right-arrow.svg"; */}
</tr> </tr>
))} ))}
</thead> </thead>
{/* filter row */}
{/* {selectedFilterRow === !null && ( )} */}
<thead style={{ backgroundColor: "#FAFBFF" }}>
{headerGroups.map((headerGroup) => (
<tr {...headerGroup.getHeaderGroupProps()}>
{headerGroup.headers.map((column) => (
<th {...column.getHeaderProps()} className="py-2 text-sm">
{column.canFilter ? column.render("Filter") : null}
</th>
))}
</tr>
))}
</thead>
<tbody <tbody
{...getTableBodyProps()} {...getTableBodyProps()}
className="divide-y divide-gray-200 bg-white" className="divide-y divide-gray-200 bg-white"
@ -341,15 +249,7 @@ import rightArrow from "./right-arrow.svg"; */}
)} )}
</code> </code>
</pre> </pre>
<div className="mt-3 "> <div className="mt-3 ">
{/* <span className="text-sm ml-4">
صفحه{" "}
<strong className="text-indigo-500">
{pageIndex + 1} از {pageOptions.length}
</strong>
{""}
</span> */}
<span className="text-sm ml-4"> <span className="text-sm ml-4">
صفحه{" "} صفحه{" "}
<strong className="text-indigo-500"> <strong className="text-indigo-500">
@ -369,7 +269,6 @@ import rightArrow from "./right-arrow.svg"; */}
</strong> </strong>
{""} {""}
</span> </span>
<select <select
className="text-white text-sm rounded cursor-pointer" className="text-white text-sm rounded cursor-pointer"
style={{ style={{
@ -399,12 +298,276 @@ import rightArrow from "./right-arrow.svg"; */}
}; };
function renderRowSubComponent({ row }) { function renderRowSubComponent({ row }) {
console.log(row);
const persian = {
weight: "وزن",
pageNumber: "تعداد صفحات",
pageType: "نوع کاغذ",
bookNumber: "شماره شابک",
publisher: "انتشارات",
author: "نویسنده",
bookType: "قطع",
publishedYear: "سال انتشار",
};
return ( return (
<div className="pl-2 pr-5 bg-blue-200"> <div
مبلغ: {row.history} className="w-full flex flex-row items-center border-r-4 border-blue-600 p-2"
<br /> style={{ backgroundColor: "#FAFBFF" }}
<button className="bg-blue-400">ویرایش</button> >
{/* right */}
<div
className="flex flex-row flex-wrap items-center"
style={{ width: "90%" }}
>
{/* 1 */}
<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" }}
>
نام و نام خانوادگی:
<span className="mr-1 text-black">{row.name}</span>
</p>
</div>
{/* 2 */}
<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" }}
>
تاریخ سفارش:
<span className="mr-1 text-black">{row.order_date}</span>
</p>
</div>
{/* 3 */}
<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" }}
>
مبلغ سفارش:
<span className="mr-1 text-black">{row.order_price}</span>
</p>
</div>
{/* 4 */}
<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" }}
>
شماره سفارش:
<span className="mr-1 text-black">{row.order_number}</span>
</p>
</div>
{/* 5 */}
<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" }}
>
شغل کاربر:
<span className="mr-1 text-black">{row.user_job}</span>
</p>
</div>
{/* 6 */}
<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" }}
>
وضعیت سفارش:
<span className="mr-1 text-black">{row.order_status}</span>
</p>
</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" }}
>
سطح اهمیت:
<span className="mr-1 text-black">{row.order_level}</span>
</p>
</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" }}
>
محل تولد:
<span className="mr-1 text-black">{row.birth_place}</span>
</p>
</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" }}
>
تلفن محل کار:
<span className="mr-1 text-black">{row.office_phone}</span>
</p>
</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" }}
>
تحصیلات:
<span className="mr-1 text-black">{row.education}</span>
</p>
</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" }}
>
تاریخ تولد:
<span className="mr-1 text-black">{row.birth_day}</span>
</p>
</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" }}
>
شغل:
<span className="mr-1 text-black">{row.job}</span>
</p>
</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" }}
>
دانشگاه:
<span className="mr-1 text-black">{row.uni}</span>
</p>
</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" }}
>
رشته تحصیلی:
<span className="mr-1 text-black">{row.field_study}</span>
</p>
</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" }}
>
اخلاق:
<span className="mr-1 text-black">{row.behaviour}</span>
</p>
</div>
{/* 16 */}
<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" }}
>
نشانی:
<span className="mr-1 text-black">{row.address}</span>
</p>
</div>
</div>
{/* left */}
<div
className="flex flex-col items-end justify-end"
style={{ width: "10%" }}
>
<button
className="border rounded w-8/12 text-xs py-2 mb-2 bg-white"
style={{ borderColor: "#D53921", color: "#D53921" }}
>
حذف
</button>
<button
className="border rounded w-8/12 text-xs py-2 bg-white"
style={{ borderColor: "#65A9FF", color: "#65A9FF" }}
>
جزیات بیشتر
</button>
</div>
</div> </div>
); );
} }
export default BasicTable; export default BasicTable;
BasicTable.defaultProps = {
settingsIcon: true,
};

@ -9,7 +9,7 @@ export function Buttons({ row }) {
return ( return (
<div className="flex flex-row items-center justify-end"> <div className="flex flex-row items-center justify-end">
<button <button
className="flex flex-row items-center justify-around p-2 rounded border border-gray-300 mx-1" className="mx-1 flex flex-row items-center justify-around p-2 rounded border border-gray-300"
onClick={() => setActiveDetails(!activeDetails)} onClick={() => setActiveDetails(!activeDetails)}
{...row.getToggleRowExpandedProps()} {...row.getToggleRowExpandedProps()}
> >
@ -17,15 +17,15 @@ export function Buttons({ row }) {
<img <img
src={arrowIcon} src={arrowIcon}
alt="" alt=""
className={`w-3 cursor-pointer mr-2 ${ className={`mx-1 w-3 cursor-pointer mr-2 ${
activeDetails ? "rotate-60" : "rotate-90" activeDetails ? "rotate-60" : "rotate-90"
}`} }`}
/> />
</button> </button>
<div className="p-2 rounded border border-gray-300 cursor-pointer mx-1"> <div className="mx-1 p-2 rounded border border-gray-300 cursor-pointer ">
<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 mx-1" /> <img src={more} alt="" className="w-5 cursor-pointer " />
</div> </div>
); );
} }

@ -1,19 +0,0 @@
import React from 'react';
export const ColumnFilter = ({ column }) => {
const { filterValue, setFilter } = column
return (
<span>
Search: {''}
<input value={filterValue || '' }
onChange={(e) => setFilter(e.target.value)} />
</span>
);
};

@ -0,0 +1,36 @@
import React, { useState } from "react";
import search from "./search-normal.svg";
import cancleIcon from "./zarbedar-icon.svg";
export const ColumnSearch = ({ column }) => {
const { filterValue, setFilter } = column;
const [activeSearchBox, setActiveSearchBox] = useState(false);
return (
<div className="flex flex-row items-center">
<div className="flex flex-row items-center relative">
{activeSearchBox && (
<img
src={cancleIcon}
alt=""
className="w-2 h-2 absolute left-16 cursor-pointer"
onClick={() => setActiveSearchBox(false)}
/>
)}
<img
src={search}
alt=""
className="w-4 h-4 absolute left-11 cursor-pointer"
/>
<input
value={filterValue || ""}
onChange={(e) => setFilter(e.target.value)}
onFocus={() => setActiveSearchBox(true)}
className={`w-9/12 text-xs text-blue-400 rounded focus:outline-none border p-1 focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20`}
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
/>
</div>
</div>
);
};

@ -0,0 +1,51 @@
import React from "react";
import more from "./more2.svg";
export const DropDown = ({}) => {
return (
<div>
<button
className=""
id="dropdownButton"
data-dropdown-toggle="dropdown"
type="button"
>
<img src={more} alt="" className={`cursor-pointer w-5`} />
</button>
<div
style={{ backgroundColor: "#65A9FF" }}
id="dropdown"
className="hidden z-10 text-xs list-none rounded divide-y divide-gray-100 shadow"
>
<ul className="" aria-labelledby="dropdownButton">
<li>
<a
href="#"
className="block p-3 text-xs text-white hover:bg-blue-600 hover:rounded"
>
ایتم شماره1
</a>
</li>
<li>
<a
href="#"
className="block p-3 text-xs text-white hover:bg-blue-600 hover:rounded"
>
ایتم شماره1
</a>
</li>
<li>
<a
href="#"
className="block p-3 text-xs text-white hover:bg-blue-600 hover:rounded"
>
ایتم شماره1
</a>
</li>
</ul>
</div>
</div>
);
};
export default DropDown;

@ -1,95 +1,38 @@
import React, { useState } from "react"; import React, { useState } from "react";
import Table from "./BasicTable";
import DropDown from "./DropDown";
import filter from "./filter.svg"; import filter from "./filter.svg";
import plus from "./plus.svg"; import plus from "./plus.svg";
import more from "./more2.svg";
export function EditButtons({ buttons }) { export function EditButtons({}) {
const [selectedButton, setSelectedButton] = useState(null); const [activeFilter, setActiveFilter] = useState(null);
// const [selectedFilterRow, setSelectedFilterRow] = useState(null);
return ( return (
<div className="flex flex-row items-center justify-end"> <div className="flex flex-row items-center justify-end">
{buttons.map((button, index) => ( {/* add new row */}
<div> <button
<div className="mx-1 flex flex-row items-center p-2 text-xs text-white rounded border-b-2 border-blue-600"
className={`flex flex-row items-center justify-around p-1 rounded-md bg-opacity-30 mx-1 ${ style={{ backgroundColor: "#65A9FF" }}
button.border >
} ${button.borderColor} ${ ثبت جدید
selectedButton === button ? "border" : "border-0" <img src={plus} alt="" className={`cursor-pointer w-2 mr-1 `} />
}`} </button>
key={index} {/* filter */}
style={{ <img
backgroundColor: button.backgroundColor, src={filter}
padding: button.padding, // onClick={() => setSelectedFilterRow(!selectedFilterRow)}
}} alt=""
onClick={() => className={`mx-1 p-2 rounded border border-blue-300 cursor-pointer w-8
setSelectedButton(selectedButton === button ? null : button) ${activeFilter ? "border" : "border-0"}`}
} onClick={() => setActiveFilter(!activeFilter)}
> />
<p className={` text-white`}>{button.title}</p> {/* dropDown */}
<img <DropDown />
src={button.logo}
alt=""
className={`cursor-pointer ${button.width} ${button.height} ${
button.title === null ? "mr-0" : "mx-2"
}`}
/>
</div>
</div>
))}
</div> </div>
); );
} }
EditButtons.defaultProps = { EditButtons.defaultProps = {};
buttons: [
{
logo: plus,
width: "w-3",
height: "h-3",
title: "ثبت جدید",
backgroundColor: "#65A9FF",
border: "border-b-4",
borderColor: "#3686EC",
padding: "4px 7px",
components: "d",
buttonSubItems: [],
},
{
logo: filter,
width: "w-5",
height: "h-5",
title: null,
backgroundColor: "#F3F8FF",
border: null,
borderColor: null,
components: "a",
buttonSubItems: [],
},
{
logo: more,
width: "w-5",
height: "h-5",
title: null,
textColor: null,
backgroundColor: "#F3F8FF",
border: null,
borderColor: null,
components: "a",
buttonSubItems: [
{
title: "دراپ داون 1",
},
],
},
],
};
// {
// logo: settings,
// width: "w-5",
// height: "h-5",
// title: null,
// textColor: null,
// backgroundColor: "#F3F8FF",
// components: "b",
// },

@ -2,9 +2,10 @@ import React, { useState } from "react";
import { useAsyncDebounce } from "react-table"; import { useAsyncDebounce } from "react-table";
import search from "./search-normal.svg"; import search from "./search-normal.svg";
import cancleIcon from "./zarbedar-icon.svg";
export const GlobalFilter = ({ filter, setFilter }) => { export const GlobalFilter = ({ filter, setFilter }) => {
const [openModal, setOpenModal] = useState(true); const [activeSearchBox, setActiveSearchBox] = useState(false);
const [value, setValue] = useState(filter); const [value, setValue] = useState(filter);
@ -13,15 +14,44 @@ export const GlobalFilter = ({ filter, setFilter }) => {
}, 400); }, 400);
return ( return (
<input <div className="flex flex-row-reverse items-center relative ml-2 ">
value={value || ""} {activeSearchBox && (
onChange={(e) => { <img
setValue(e.target.value); src={cancleIcon}
onChange(e.target.value); alt=""
}} className="w-3 h-3 absolute left-7 cursor-pointer"
type="text" onClick={() => setActiveSearchBox(false)}
placeholder="نام کالا را جستجو کنید..." />
className="text-xs rounded-sm pr-4 pl-10 py-2 w-full border border-gray-400 font-light text-lightGrayTextColor placeholder-gray-400 focus:outline-none" )}
/> <img
src={search}
alt=""
className="w-4 h-4 absolute left-2 cursor-pointer"
/>
<input
value={filter || ""}
onChange={(e) => setFilter(e.target.value)}
onFocus={() => setActiveSearchBox(true)}
// onBlur={() => setActiveSearchBox(false)}
type="text"
className={`text-xs text-blue-400 rounded focus:outline-none border focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20`}
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
/>
</div>
); );
}; };
{
/* <input
value={value || ""}
onChange={(e) => {
setValue(e.target.value);
onChange(e.target.value);
}}
onFocus={() => setActiveSearchBox(true)}
// onBlur={() => setActiveSearchBox(false)}
type="text"
className={`text-xs text-blue-400 rounded focus:outline-none placeholder-blue-400 border`}
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
/> */
}

@ -0,0 +1,19 @@
import React from "react";
export const GoToPage = ({ pageIndex, gotoPage, pageOptions }) => {
return (
<span className="text-xs text-blue-400 mr-1">
صفحه{" "}
<input
className="ml-1 text-xs p-1 rounded border-blue-400 w-9"
type="number"
defaultValue={pageIndex + 1}
onChange={(e) => {
const pageNumber = e.target.value ? Number(e.target.value) - 1 : 0;
gotoPage(pageNumber);
}}
/>
از {pageOptions.length}
</span>
);
};

@ -1,22 +1,92 @@
[ [
{ {
"name": "mahdi", "name": "خسرو سهرابی",
"order-date": "1399/09/27", "order_date": "1400/11/09",
"order-price": 25, "order_price": 1,
"order-number": "09120023100", "order_number": "09120023100",
"user-job": "مهندس ساختمان", "user_job": "مهندس ساختمان",
"order-status": 1, "order_status": 1,
"order-level": 1, "order_level": 1,
"history": "مهدی" "birth_place": "استان تهران شهر تهران",
"office_phone": "02144407010",
"education": "کارشناسی",
"job": "فروشنده لوازم خانگی",
"field_study": "مدیریت صنعتی",
"birth_day": "1368/09/02",
"uni": "تهران",
"address": "خیابان شریعتی نرسیده به خیابان دولت کوچه عباسی نبش تهیه غذای فارسی پلاک 4 واحد 3",
"behaviour": "بچه پرو و دریده شاخ اما کم آزار اهل رفاقت و مرام خلاق نوآور آشنا به صنایع خلاق"
}, },
{ {
"name": "tannaz", "name": "خسرو شکیبایی",
"order-date": "1399/09/27", "order_date": "1340/04/13",
"order-price": 27, "order_price": 2,
"order-number": "09120023100", "order_number": "09390646589",
"user-job": "مهندس ساختمان", "user_job": "بازیگر",
"order-status": 1, "order_status": 2,
"order-level": 1, "order_level": 2,
"history": "tannaz" "birth_place": "استان تهران شهر تهران",
"office_phone": "02144407010",
"education": "کارشناسی",
"job": "فروشنده لوازم خانگی",
"field_study": "مدیریت صنعتی",
"birth_day": "1368/09/02",
"uni": "تهران",
"address": "خیابان شریعتی نرسیده به خیابان دولت کوچه عباسی نبش تهیه غذای فارسی پلاک 4 واحد 3",
"behaviour": "بچه پرو و دریده شاخ اما کم آزار اهل رفاقت و مرام خلاق نوآور آشنا به صنایع خلاق"
},
{
"name": "علی علوی",
"order_date": "1330/12/05",
"order_price": 3,
"order_number": "09120403285",
"user_job": "تاجر",
"order_status": 3,
"order_level": 3,
"birth_place": "استان تهران شهر تهران",
"office_phone": "02144407010",
"education": "کارشناسی",
"job": "فروشنده لوازم خانگی",
"field_study": "مدیریت صنعتی",
"birth_day": "1368/09/02",
"uni": "تهران",
"address": "خیابان شریعتی نرسیده به خیابان دولت کوچه عباسی نبش تهیه غذای فارسی پلاک 4 واحد 3",
"behaviour": "بچه پرو و دریده شاخ اما کم آزار اهل رفاقت و مرام خلاق نوآور آشنا به صنایع خلاق"
},
{
"name": "پارسا ایرانی",
"order_date": "1372/01/08",
"order_price": 4,
"order_number": "09120336508",
"user_job": "حسابدار",
"order_status": 4,
"order_level": 4,
"birth_place": "استان تهران شهر تهران",
"office_phone": "02144407010",
"education": "کارشناسی",
"job": "فروشنده لوازم خانگی",
"field_study": "مدیریت صنعتی",
"birth_day": "1368/09/02",
"uni": "تهران",
"address": "خیابان شریعتی نرسیده به خیابان دولت کوچه عباسی نبش تهیه غذای فارسی پلاک 4 واحد 3",
"behaviour": "بچه پرو و دریده شاخ اما کم آزار اهل رفاقت و مرام خلاق نوآور آشنا به صنایع خلاق"
},
{
"name": "محمد محمدی",
"order_date": "1389/01/26",
"order_price": 5,
"order_number": "0913698574",
"user_job": "دکتر",
"order_status": 5,
"order_level": 5,
"birth_place": "استان تهران شهر تهران",
"office_phone": "02144407010",
"education": "کارشناسی",
"job": "فروشنده لوازم خانگی",
"field_study": "مدیریت صنعتی",
"birth_day": "1368/09/02",
"uni": "تهران",
"address": "خیابان شریعتی نرسیده به خیابان دولت کوچه عباسی نبش تهیه غذای فارسی پلاک 4 واحد 3",
"behaviour": "بچه پرو و دریده شاخ اما کم آزار اهل رفاقت و مرام خلاق نوآور آشنا به صنایع خلاق"
} }
] ]

@ -1,302 +0,0 @@
import React, { useMemo } from "react";
import {
useTable,
useSortBy,
useGlobalFilter,
useFilters,
usePagination,
useRowSelect,
useColumnOrder,
} from "react-table";
import { COLUMNS } from "./columns";
import { GlobalFilter } from "./GlobalFilter";
import { Checkbox } from "./Checkbox";
import MOCK_DATA from "./MOCK_DATA.json";
const BasicTable = () => {
const columns = React.useMemo(() => COLUMNS, []);
const data = useMemo(() => MOCK_DATA, []);
const {
getTableProps,
getTableBodyProps,
headerGroups,
footerGroups,
rows,
page,
nextPage,
previousPage,
canNextPage,
canPreviousPage,
pageOptions,
gotoPage,
pageCount,
setPageSize,
prepareRow,
allColumns,
getToggleHideAllColumnsProps,
setColumnOrder,
selectedFlatRows,
state,
setGlobalFilter,
} = useTable(
{
columns,
data,
// initialState: { pageIndex: 2 }
},
useColumnOrder,
useFilters,
useGlobalFilter,
useSortBy,
usePagination,
useRowSelect,
(hooks) => {
hooks.visibleColumns.push((columns) => {
return [
{
id: "selection",
Header: ({ getToggleAllRowsSelectedProps }) => (
<Checkbox {...getToggleAllRowsSelectedProps()} />
),
Cell: ({ row }) => (
<Checkbox {...row.getToggleRowSelectedProps()} />
),
},
...columns,
];
});
}
);
const changeOrder = () => {
setColumnOrder([
"name",
"order-number",
"user-job",
"order-level",
"order-status",
"order-price",
]);
};
const { globalFilter, pageIndex, pageSize } = state;
// const firstPageRows = rows.slice(0, 10);
return (
<>
<div className="bg-yellow-500">
{/* search box */}
<GlobalFilter filter={globalFilter} setFilter={setGlobalFilter} />
{/* pagination */}
</div>
{/* toggle columns */}
{/* <div>
<div>
<Checkbox {...getToggleHideAllColumnsProps()} /> Toggle All
</div>
{allColumns.map((column) => (
<div key={column.id}>
<label>
<input type="checkbox" {...column.getToggleHiddenProps()} />
{column.Header}
</label>
</div>
))}
</div> */}
{/* Change Column Order */}
{/* <button onClick={changeOrder}> Change Column Order </button> */}
<table
{...getTableProps()}
className="min-w-full divide-y divide-gray-200"
>
<thead className="bg-gray-300">
{headerGroups.map((headerGroup) => (
<tr {...headerGroup.getHeaderGroupProps()}>
{headerGroup.headers.map((column) => (
<th
{...column.getHeaderProps(column.getSortByToggleProps())}
scope="col"
className="cursor-pointer px-4 py-2 text-right text-xs"
style={{ color: "#3287B9" }}
>
{column.render("Header")}
<span>
{column.isSorted
? column.isSortedDesc
? " 🔽"
: " 🔼"
: ""}
</span>
{/* not using */}
{/* <div>
{column.canFilter ? column.render('Filter') : null }
</div> */}
</th>
))}
</tr>
))}
</thead>
<tbody
{...getTableBodyProps()}
className="bg-white divide-y divide-gray-200"
>
{/* not using */}
{/* {rows.map((row) => {
prepareRow(row)
return(
<tr {...row.getRowProps()}>
{row.cells.map((cell) => {
return <td {...cell.getCellProps()} className="px-4 py-4 whitespace-nowrap text-sm" role="cell" style={{color:'#00253A'}}>
{cell.render('Cell')}
</td>
})}
</tr>
)
})} */}
{page.map((row) => {
prepareRow(row);
return (
<tr {...row.getRowProps()}>
{row.cells.map((cell) => {
return (
<td
{...cell.getCellProps()}
className="px-4 py-4 whitespace-nowrap text-sm"
role="cell"
style={{ color: "#00253A" }}
>
{cell.render("Cell")}
</td>
);
})}
</tr>
);
})}
{/* not using */}
{/* {firstPageRows.map((row) => {
prepareRow(row);
return (
<tr {...row.getRowProps()}>
{row.cells.map((cell) => {
return (
<td
{...cell.getCellProps()}
className="px-4 py-4 whitespace-nowrap text-sm"
role="cell"
style={{ color: "#00253A" }}
>
{cell.render("Cell")}
</td>
);
})}
</tr>
);
})} */}
</tbody>
<tfoot
className={`bg-gray-300 ${rows.length > 10 ? "w-full" : "hidden"}`}
>
{footerGroups.map((footerGroup) => (
<tr {...footerGroup.getFooterGroupProps()}>
{footerGroup.headers.map((column) => (
<td
{...column.getFooterProps}
className="px-4 py-2 text-right text-xs"
style={{ color: "#3287B9" }}
>
{column.render("Footer")}
</td>
))}
</tr>
))}
</tfoot>
</table>
<pre>
<code>
{JSON.stringify(
{
selectedFlatRows: selectedFlatRows.map((row) => row.original),
},
null,
2
)}
</code>
</pre>
<div>
<span>
Page{" "}
<strong>
{pageIndex + 1} of {pageOptions.length}
</strong>
{""}
</span>
<span>
| Go to Page:{" "}
<input
type="number"
defaultValue={pageIndex + 1}
onChange={(e) => {
const pageNumber = e.target.value
? Number(e.target.value) - 1
: 0;
gotoPage(pageNumber);
}}
style={{ width: "50px" }}
/>
</span>
<select
value={pageSize}
onChange={(e) => setPageSize(Number(e.target.value))}
>
{[7, 10, 25, 50].map((pageSize) => (
<option key={pageSize} value={pageSize}>
Show {pageSize}
</option>
))}
</select>
<button onClick={() => gotoPage(0)} disabled={!canPreviousPage}>
{" "}
{"<<"}{" "}
</button>
<button
className="bg-blue-400 m-2 rounded text-white p-2"
onClick={() => previousPage()}
disabled={!canPreviousPage}
>
Previous
</button>
<button
className="bg-blue-400 m-2 rounded text-white p-2"
onClick={() => nextPage()}
disabled={!canNextPage}
>
Next
</button>
<button onClick={() => gotoPage(pageCount - 1)} disabled={!canNextPage}>
{" "}
{">>"}{" "}
</button>
</div>
</>
);
};
export default BasicTable;

@ -0,0 +1,61 @@
import React from "react";
import dobleLeftArrow from "./double-left-arrow.svg";
import leftArrow from "./left-arrow.svg";
import rightArrow from "./right-arrow.svg";
export const Pagination = ({
gotoPage,
canPreviousPage,
previousPage,
canNextPage,
pageCount,
nextPage,
}) => {
return (
<div className="flex flex-row items-center space-x-1">
<button
className="rounded py-1 px-2 text-xs font-bold"
style={{ backgroundColor: "#F5F9FF", color: "#65A9FF" }}
onClick={() => gotoPage(0)}
disabled={!canPreviousPage}
>
<img src={dobleLeftArrow} className="rotate-180 w-4 h-4" />
</button>
<button
className="rounded py-1 px-2 text-xs font-bold"
style={{ backgroundColor: "#F5F9FF", color: "#65A9FF" }}
onClick={() => previousPage()}
disabled={!canPreviousPage}
>
<img src={rightArrow} className="w-3 h-3" />
</button>
<button
className="rounded py-1 px-2 text-xs font-bold"
style={{ backgroundColor: "#F5F9FF", color: "#65A9FF" }}
onClick={() => nextPage()}
disabled={!canNextPage}
>
<img src={leftArrow} className="w-3 h-3" />
</button>
<button
className="rounded py-1 px-2 text-xs font-bold"
style={{ backgroundColor: "#F5F9FF", color: "#65A9FF" }}
onClick={() => gotoPage(pageCount - 1)}
disabled={!canNextPage}
>
<img src={dobleLeftArrow} className="w-4 h-4" />
</button>
</div>
);
};
export default Pagination;
// Pagination.defaultProps = {
// pagintaionButtons: [
// {
// image: { dobleLeftArrow },
// click: gotoPage(0),
// },
// ],
// };

@ -0,0 +1,56 @@
import React from "react";
export const SelectColumnFilter = ({
column: { filterValue, setFilter, preFilteredRows, id, render },
}) => {
const options = React.useMemo(() => {
const options = new Set();
preFilteredRows.forEach((row) => {
options.add(row.values[id]);
});
return [...options.values()];
}, [id, preFilteredRows]);
return (
<select
className="text-xs flex flex-row items-start justify-start p-1 text-blue-400 rounded focus:outline-none border focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
name={id}
id={id}
value={filterValue}
onChange={(e) => {
setFilter(e.target.value || undefined);
}}
>
<option
className="text-white"
value=""
style={{ backgroundColor: "#65A9FF" }}
>
همه
</option>
{options.map((option, i) => (
<option
key={i}
value={option}
className="text-right text-white px-2"
style={{ backgroundColor: "#65A9FF" }}
>
{(() => {
if (option === 1) {
return "وضعیت عادی";
} else if (option === 2) {
return "اعلان سطح هشدار";
} else if (option === 3) {
return "بررسی و پیگیری";
} else if (option === 4) {
return "وضعیت بحرانی";
} else {
return " وضعیت پایدار";
}
})()}{" "}
</option>
))}
</select>
);
};

@ -0,0 +1,56 @@
import React from "react";
export const SelectColumnFilter2 = ({
column: { filterValue, setFilter, preFilteredRows, id, render },
}) => {
const options = React.useMemo(() => {
const options = new Set();
preFilteredRows.forEach((row) => {
options.add(row.values[id]);
});
return [...options.values()];
}, [id, preFilteredRows]);
return (
<select
className="text-xs flex flex-row items-start justify-start p-1 text-blue-400 rounded focus:outline-none border focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20"
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }}
name={id}
id={id}
value={filterValue}
onChange={(e) => {
setFilter(e.target.value || undefined);
}}
>
<option
className="text-white"
value=""
style={{ backgroundColor: "#65A9FF" }}
>
همه
</option>
{options.map((option, i) => (
<option
key={i}
value={option}
className="text-right text-white px-2"
style={{ backgroundColor: "#65A9FF" }}
>
{(() => {
if (option === 1) {
return "ارسال شده";
} else if (option === 2) {
return "رسیدگی";
} else if (option === 3) {
return "لغو شده";
} else if (option === 4) {
return "پیگیری";
} else {
return "خطری";
}
})()}{" "}
</option>
))}
</select>
);
};

@ -0,0 +1,13 @@
import React from "react";
import settings from "./settings.svg";
export const Settings = ({}) => {
return (
<div
style={{ backgroundColor: "#F9FBFF" }}
className="mr-2 flex flex-col items-center justify-center p-1 rounded"
>
<img src={settings} className="w-6 h-6 cursor-pointer" />
</div>
);
};

@ -0,0 +1,40 @@
import React from "react";
import cancleIcon from "./zarbedar-icon.svg";
export const SliderColumnFilter = ({
column: { filterValue, setFilter, preFilteredRows, id },
}) => {
const [min, max] = React.useMemo(() => {
let min = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;
let max = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;
preFilteredRows.forEach((row) => {
min = Math.min(row.values[id], min);
max = Math.max(row.values[id], max);
});
return [min, max];
}, [id, preFilteredRows]);
return (
<div className="flex flex-row items-center justify-between w-10/12">
<input
className=" w-10/12"
type="range"
min={min}
max={max}
value={filterValue || min}
onChange={(e) => {
setFilter(parseInt(e.target.value, 10));
}}
/>
<div className="p-1 rounded bg-blue-300 bg-opacity-20">
<img
src={cancleIcon}
onClick={() => setFilter(undefined)}
className="cursor-pointer w-2 h-2"
/>
</div>
{/* <button onClick={() => setFilter(undefined)}>ریست</button> */}
</div>
);
};

@ -0,0 +1,21 @@
import React from "react";
export const ToggleColumns = ({ allColumns, getToggleHideAllColumnsProps }) => {
return (
<div>
<div>
<input type="checkbox" {...getToggleHideAllColumnsProps()} /> Toggle All
</div>
{allColumns.map((column) => (
<div key={column.id}>
<label>
<input type="checkbox" {...column.getToggleHiddenProps()} />
{column.Header}
</label>
</div>
))}
</div>
);
};
export default ToggleColumns;

@ -1,13 +1,14 @@
import { format } from "date-fns"; import { format } from "date-fns";
import Table, { SelectColumnFilter } from "./BasicTable"; // new import Table from "./BasicTable";
import { ColumnFilter } from "./ColumnFilter";
import { OrderStatus } from "./OrderStatus"; import { OrderStatus } from "./OrderStatus";
import { OrderLevel } from "./OrderLevel"; import { OrderLevel } from "./OrderLevel";
import { Buttons } from "./Buttons"; import { Buttons } from "./Buttons";
import { EditButtons } from "./EditButtons"; import { EditButtons } from "./EditButtons";
import { SelectColumnFilter } from "./SelectColumnFilter.js";
import { SelectColumnFilter2 } from "./SelectColumnFilter2.js";
import { SliderColumnFilter } from "./SliderColumnFilter.js";
export const COLUMNS = [ export const COLUMNS = [
{ {
@ -19,7 +20,8 @@ export const COLUMNS = [
{ {
Header: "تاریخ سفارش", Header: "تاریخ سفارش",
Footer: "تاریخ سفارش", Footer: "تاریخ سفارش",
accessor: "order-date", accessor: "order_date",
Filter: SliderColumnFilter,
Cell: ({ value }) => { Cell: ({ value }) => {
return format(new Date(value), "dd/MM/yyyy"); return format(new Date(value), "dd/MM/yyyy");
}, },
@ -27,32 +29,32 @@ export const COLUMNS = [
{ {
Header: "مبلغ سفارش", Header: "مبلغ سفارش",
Footer: "مبلغ سفارش", Footer: "مبلغ سفارش",
accessor: "order-price", accessor: "order_price",
Filter: ColumnFilter, Filter: SliderColumnFilter,
}, },
{ {
Header: "شماره سفارش", Header: "شماره سفارش",
Footer: "شماره سفارش", Footer: "شماره سفارش",
accessor: "order-number", accessor: "order_number",
}, },
{ {
Header: "شغل کاربر", Header: "شغل کاربر",
Footer: "شغل کاربر", Footer: "شغل کاربر",
accessor: "user-job", accessor: "user_job",
}, },
{ {
Header: "وضعیت سفارش", Header: "وضعیت سفارش",
Footer: "وضعیت سفارش", Footer: "وضعیت سفارش",
accessor: "order-status", accessor: "order_status",
Cell: OrderStatus, Cell: OrderStatus,
Filter: SelectColumnFilter2,
}, },
{ {
Header: "سطح اهمیت", Header: "سطح اهمیت",
Footer: "سطح اهمیت", Footer: "سطح اهمیت",
accessor: "order-level", accessor: "order_level",
Cell: OrderLevel, Cell: OrderLevel,
// Filter: SelectColumnFilter, Filter: SelectColumnFilter,
// new
}, },
{ {
Header: EditButtons, Header: EditButtons,
@ -60,5 +62,6 @@ export const COLUMNS = [
accessor: "edit", accessor: "edit",
Cell: Buttons, Cell: Buttons,
disableSortBy: true, disableSortBy: true,
disableFilters: true,
}, },
]; ];

@ -2,11 +2,12 @@ import React, { useRef } from "react";
import BasicTable from "./BasicTable"; import BasicTable from "./BasicTable";
// import useDraggableScroll from "use-draggable-scroll"; // import useDraggableScroll from "use-draggable-scroll";
const ReactTable4 = ({ breadCrumbs, subTitle, title, className }) => { import cancleIcon from "./zarbedar-icon.svg";
const ReactTable4 = ({ breadCrumbs, subTitle, title }) => {
return ( return (
<div className={`${className} my-10 px-10 mx-auto`}> <div className="my-10 w-11/12 mx-auto">
{/* breadCrumb */} {/* breadCrumb */}
<div className="flex flex-row items-center"> <div className="flex flex-row items-center">
{breadCrumbs.map((breadCrumb, index) => ( {breadCrumbs.map((breadCrumb, index) => (
<div className="flex flex-row items-center"> <div className="flex flex-row items-center">
@ -29,7 +30,6 @@ const ReactTable4 = ({ breadCrumbs, subTitle, title, className }) => {
</div> </div>
))} ))}
</div> </div>
<div className="my-7"> <div className="my-7">
{/* page Title */} {/* page Title */}
<div className="flex flex-row items-center"> <div className="flex flex-row items-center">
@ -49,47 +49,15 @@ const ReactTable4 = ({ breadCrumbs, subTitle, title, className }) => {
}; };
window.isDown = false; window.isDown = false;
export default ReactTable4; export default ReactTable4;
function Tabbar() {
export function Tabbar({}) {
const ref = useRef(null);
// const { onMouseDown } = useDraggableScroll(ref); // const { onMouseDown } = useDraggableScroll(ref);
const tabs = [ const tabs = ["فروشگاه دانوین", "مهدی عندلیب"];
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
"تست۱",
];
return ( return (
<ul <ul
className="tabbar flex no-scrollbar border-b border-gray-200 dark:border-gray-700 overflow-x-scroll scrolling-touch" className="tabbar flex no-scrollbar overflow-x-scroll scrolling-touch"
onMouseDown={(e) => { onMouseDown={(e) => {
const slider = window.document.querySelector(".tabbar"); const slider = window.document.querySelector(".tabbar");
window.isDown = true; window.isDown = true;
@ -112,19 +80,16 @@ function Tabbar() {
}} }}
> >
{tabs.map((el) => ( {tabs.map((el) => (
<li className="mr-2 "> <li
<span onClick={(e) => {
onClick={(e) => { if (window.isDown) return e.preventDefault();
if (window.isDown) return e.preventDefault(); }}
///do here aria-current="page"
}} className="flex flex-row items-center text-sm text-center active px-4 py-4 rounded-sm mx-1"
aria-current="page" style={{ backgroundColor: "#F1F6FF" }}
className="inline-block py-4 px-4 text-sm font-medium text-center text-blue-600 bg-gray-100 rounded-t-lg active dark:bg-gray-800 dark:text-blue-500" >
> <span className="">{el}</span>
<span className="p-2"> <img src={cancleIcon} className="w-2 h-2 mr-2" />
{el} <span className="p-2">x</span>
</span>
</span>
</li> </li>
))} ))}
</ul> </ul>

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="5.397" height="5.397" viewBox="0 0 5.397 5.397">
<g id="Group_1887" data-name="Group 1887" transform="translate(0.707 0.707)">
<path id="Vector" d="M3.943,3.943,0,0" transform="translate(0.04)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<path id="Vector-2" data-name="Vector" d="M3.943,0,0,3.943" transform="translate(0 0.04)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 545 B

@ -2,6 +2,8 @@ module.exports = {
content: [ content: [
"./src/**/*.{js,jsx,ts,tsx}", "./src/**/*.{js,jsx,ts,tsx}",
"./node_modules/@themesberg/flowbite/**/*.js", "./node_modules/@themesberg/flowbite/**/*.js",
"./src/**/*.{html,js}",
"./node_modules/tw-elements/dist/js/**/*.js",
], ],
theme: { theme: {
extend: {}, extend: {},
@ -78,5 +80,8 @@ module.exports = {
darkCrimsonBorderColor: "#132F52", darkCrimsonBorderColor: "#132F52",
}), }),
}, },
plugins: [require("@themesberg/flowbite/plugin")], plugins: [
require("@themesberg/flowbite/plugin"),
require("tw-elements/dist/plugin"),
],
}; };

@ -3751,6 +3751,13 @@ dom-serializer@^1.0.1:
domhandler "^4.2.0" domhandler "^4.2.0"
entities "^2.0.0" entities "^2.0.0"
dom7@^4.0.4:
version "4.0.4"
resolved "https://registry.yarnpkg.com/dom7/-/dom7-4.0.4.tgz#8b68c5d8e5e2ed0fddb1cb93e433bc9060c8f3fb"
integrity sha512-DSSgBzQ4rJWQp1u6o+3FVwMNnT5bzQbMb+o31TjYYeRi05uAcpF8koxdfzeoe5ElzPmua7W7N28YJhF7iEKqIw==
dependencies:
ssr-window "^4.0.0"
domelementtype@1: domelementtype@1:
version "1.3.1" version "1.3.1"
resolved "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz" resolved "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz"
@ -8127,6 +8134,11 @@ sprintf-js@~1.0.2:
resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz"
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
ssr-window@^4.0.0, ssr-window@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-4.0.2.tgz#dc6b3ee37be86ac0e3ddc60030f7b3bc9b8553be"
integrity sha512-ISv/Ch+ig7SOtw7G2+qkwfVASzazUnvlDTwypdLoPoySv+6MqlOV10VwPSE6EWkGjhW50lUmghPmpYZXMu/+AQ==
stable@^0.1.8: stable@^0.1.8:
version "0.1.8" version "0.1.8"
resolved "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz" resolved "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz"
@ -8362,6 +8374,14 @@ sweetalert2@^11.3.4:
resolved "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.3.4.tgz" resolved "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.3.4.tgz"
integrity sha512-o7owEtVtpqnB8y3BDCRn2taYb7URcf6RIUm120LjFxt8IHfPIm0UeHuiS3nEp5r9RKm5GlSSJOh/yuapUQcYcQ== integrity sha512-o7owEtVtpqnB8y3BDCRn2taYb7URcf6RIUm120LjFxt8IHfPIm0UeHuiS3nEp5r9RKm5GlSSJOh/yuapUQcYcQ==
swiper@^8.0.6:
version "8.0.6"
resolved "https://registry.yarnpkg.com/swiper/-/swiper-8.0.6.tgz#3996d3212cb73b93e9f274e18ea58c029340c7c7"
integrity sha512-Ssyu1+FeNATF/G8e84QG+ZUNtUOAZ5vngdgxzczh0oWZPhGUVgkdv+BoePUuaCXLAFXnwVpNjgLIcGnxMdmWPA==
dependencies:
dom7 "^4.0.4"
ssr-window "^4.0.2"
symbol-tree@^3.2.4: symbol-tree@^3.2.4:
version "3.2.4" version "3.2.4"
resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz" resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz"
@ -8561,9 +8581,9 @@ tsutils@^3.21.0:
tslib "^1.8.1" tslib "^1.8.1"
tw-elements@^1.0.0-alpha8: tw-elements@^1.0.0-alpha8:
version "1.0.0-alpha8" version "1.0.0-alpha9"
resolved "https://registry.npmjs.org/tw-elements/-/tw-elements-1.0.0-alpha8.tgz" resolved "https://registry.npmjs.org/tw-elements/-/tw-elements-1.0.0-alpha9.tgz"
integrity sha512-feqb4XmHWH8KUOT7KEC3lc258VmypcI6ettdR9adN/dEfk9wXcp/G+XPOhnAAQiXeyTDOCuDF/GNo6kMN++YXw== integrity sha512-Qw88PhQQQzQ6Ohsaze8FBy3ijMJnvMe0BeD5f31tfi5KAi39y6QvmgRBxnSnLNmpvq5ItxNOxlVKMPfUCgDwfw==
dependencies: dependencies:
"@popperjs/core" "^2.6.0" "@popperjs/core" "^2.6.0"
bootstrap "^5.1.3" bootstrap "^5.1.3"
@ -8706,7 +8726,7 @@ url@^0.11.0:
use-draggable-scroll@^0.1.0: use-draggable-scroll@^0.1.0:
version "0.1.0" version "0.1.0"
resolved "https://registry.yarnpkg.com/use-draggable-scroll/-/use-draggable-scroll-0.1.0.tgz#ca7967eeec9d6a53f965b84f9c295c214aa43ed7" resolved "https://registry.npmjs.org/use-draggable-scroll/-/use-draggable-scroll-0.1.0.tgz"
integrity sha512-mX6nT3cUqOTtA+8QUH9HfdKtzI6Oquj9QIB0wALWZYmWogNQ746MaUcmqKOKCIlt2UH6egxhSKNPiSlfEqmKhA== integrity sha512-mX6nT3cUqOTtA+8QUH9HfdKtzI6Oquj9QIB0wALWZYmWogNQ746MaUcmqKOKCIlt2UH6egxhSKNPiSlfEqmKhA==
util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1:

Loading…
Cancel
Save