From b3f82d5fa94391de9ff87b847eeadc380d0f8217 Mon Sep 17 00:00:00 2001 From: mahdi andalib Date: Mon, 28 Feb 2022 13:27:35 +0330 Subject: [PATCH] update --- src/App.js | 2 + .../BreadCrumb/black-arrow-left.svg | 4 + src/components/BreadCrumb/gray-arrow-left.svg | 4 + src/components/BreadCrumb/index.js | 61 +++++++++++++++ src/components/FileManager/index.js | 7 ++ src/components/FileManager/index.scss | 0 src/components/ReactTable4/index.js | 74 +------------------ src/components/TitleSubtitle/index.js | 25 +++++++ 8 files changed, 106 insertions(+), 71 deletions(-) create mode 100644 src/components/BreadCrumb/black-arrow-left.svg create mode 100644 src/components/BreadCrumb/gray-arrow-left.svg create mode 100644 src/components/BreadCrumb/index.js create mode 100644 src/components/FileManager/index.js create mode 100644 src/components/FileManager/index.scss create mode 100644 src/components/TitleSubtitle/index.js diff --git a/src/App.js b/src/App.js index 0875402..46af6ef 100644 --- a/src/App.js +++ b/src/App.js @@ -48,6 +48,7 @@ import Digikala from "./components/Digikala"; // import Digikala from "./components/Digikala/ImageSlider"; import Switch from "./components/Switch"; +import BreadCrumb from "./components/BreadCrumb"; function App() { return ( @@ -100,6 +101,7 @@ function App() { */} + ); diff --git a/src/components/BreadCrumb/black-arrow-left.svg b/src/components/BreadCrumb/black-arrow-left.svg new file mode 100644 index 0000000..d673f67 --- /dev/null +++ b/src/components/BreadCrumb/black-arrow-left.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/components/BreadCrumb/gray-arrow-left.svg b/src/components/BreadCrumb/gray-arrow-left.svg new file mode 100644 index 0000000..5cc20f2 --- /dev/null +++ b/src/components/BreadCrumb/gray-arrow-left.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/components/BreadCrumb/index.js b/src/components/BreadCrumb/index.js new file mode 100644 index 0000000..c2f4c79 --- /dev/null +++ b/src/components/BreadCrumb/index.js @@ -0,0 +1,61 @@ +import React from "react"; + +import grayLeftArrow from "./gray-arrow-left.svg"; +import blackLeftArrow from "./black-arrow-left.svg"; + +const BreadCrumb = ({ breadCrumbs }) => { + return ( +
+
+ {breadCrumbs.map((breadCrumb, index) => ( +
+ + {breadCrumb.name} + + {Number(index) !== breadCrumbs.length - 1 && ( +
+ {/* {breadCrumb.active === true ? ( + + ) : ( + + )} */} + +
+ )} +
+ ))} +
+
+ ); +}; + +export default BreadCrumb; + +BreadCrumb.defaultProps = { + breadCrumbs: [ + { + name: "صفحه اصلی", + active: false, + }, + { + name: "آمار و گزارشات", + active: false, + }, + { + name: "فروش محصولات", + active: false, + }, + { + name: "سال 1400", + active: true, + }, + ], +}; diff --git a/src/components/FileManager/index.js b/src/components/FileManager/index.js new file mode 100644 index 0000000..ffab46a --- /dev/null +++ b/src/components/FileManager/index.js @@ -0,0 +1,7 @@ +import React from "react"; + +const index = () => { + return
index
; +}; + +export default index; diff --git a/src/components/FileManager/index.scss b/src/components/FileManager/index.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/components/ReactTable4/index.js b/src/components/ReactTable4/index.js index 18e709c..f8cf4bb 100644 --- a/src/components/ReactTable4/index.js +++ b/src/components/ReactTable4/index.js @@ -1,10 +1,11 @@ import React, { useRef, useState } from "react"; import BasicTable from "./BasicTable"; +import TitleSubtitle from "../TitleSubtitle"; + import MultiRangeInput from "./MultiRangeInput"; import grayLeftArrow from "./gray-arrow-left.svg"; -import blackLeftArrow from "./black-arrow-left.svg"; const ReactTable4 = ({ breadCrumbs, subTitle, title }) => { const [tabs, setTabs] = useState([ @@ -56,16 +57,7 @@ const ReactTable4 = ({ breadCrumbs, subTitle, title }) => { ))}
- {/* page Title */} -
-
-

{title}

-
- {/* page subTitle */} -
-
-

{subTitle}

-
+
{ export default ReactTable4; -// export function Tabbar({ tabs, delTab, setActivateTab, activeTab }) { -// // const { onMouseDown } = useDraggableScroll(ref); - -// return ( -//
    { -// const slider = window.document.querySelector(".tabbar"); -// window.isDown = true; -// window.startX = e.pageX - slider.offsetLeft; -// window.scrollLeft = slider.scrollLeft; -// }} -// onMouseLeave={(e) => { -// window.isDown = false; -// }} -// onMouseUp={(e) => { -// window.isDown = false; -// }} -// onMouseMove={(e) => { -// const slider = window.document.querySelector(".tabbar"); -// if (!window.isDown) return; -// e.preventDefault(); -// const x = e.pageX - slider.offsetLeft; -// const walk = (x - window.startX) * 1; -// slider.scrollLeft = window.scrollLeft - walk; -// }} -// > -// {tabs.map((el, index) => ( -//
  • { -// if (window.isDown) return e.preventDefault(); -// }} -// aria-current="page" -// className="flex flex-row items-center text-sm text-center active rounded-sm px-4" -// style={{ -// backgroundColor: activeTab === el.id ? "#92c1fc" : "#F1F6FF", -// color: activeTab === el.id ? "#fff" : "#000", -// }} -// > -//
    setActivateTab(el.id)}> -// {el.name} -//
    -// {el.id ? ( -// { -// e.preventDefault(); -// delTab(el.id); -// }} -// /> -// ) : null} -//
  • -// ))} -//
-// ); -// } - ReactTable4.defaultProps = { breadCrumbs: [ { diff --git a/src/components/TitleSubtitle/index.js b/src/components/TitleSubtitle/index.js new file mode 100644 index 0000000..b05a3be --- /dev/null +++ b/src/components/TitleSubtitle/index.js @@ -0,0 +1,25 @@ +import React from "react"; + +const TitleSubtitle = ({ title, subTitle }) => { + return ( +
+ {/* page Title */} +
+
+

{title}

+
+ {/* page subTitle */} +
+
+

{subTitle}

+
+
+ ); +}; + +export default TitleSubtitle; + +TitleSubtitle.defaultProps = { + title: "میزان فروش محصولات", + subTitle: "اطلاعات جداول مشخصاتی کارکنان مجموعه ایران تایر", +};