update App.js and src/components/BreadCrumb/index.js

master
mahdi 2 years ago
parent f2219fa8bd
commit a73908986a
  1. 8
      src/App.js
  2. 19
      src/components/BreadCrumb/index.js

@ -164,8 +164,8 @@ function App() {
{/* <Design1 /> */} {/* <Design1 /> */}
{/* <Design2 /> */} {/* <Design2 /> */}
<SidebarMenu /> {/* <SidebarMenu /> */}
<SidebarDesign2 /> {/* <SidebarDesign2 /> */}
{/* <SidebarDesign2 className="w-1/5" /> */} {/* <SidebarDesign2 className="w-1/5" /> */}
{/* <TableDesign1 /> */} {/* <TableDesign1 /> */}
@ -181,7 +181,7 @@ function App() {
{/* <ReactTable3 /> */} {/* <ReactTable3 /> */}
{/* ----------------------------$$$ start---------------------------- */} {/* ----------------------------$$$ start---------------------------- */}
{/* <BreadCrumb /> */} <BreadCrumb />
{/* <SearchBox /> */} {/* <SearchBox /> */}
{/* <TitleSubtitle /> */} {/* <TitleSubtitle /> */}
{/* <FolderTree /> */} {/* <FolderTree /> */}
@ -265,7 +265,7 @@ function App() {
{/* <DateRangePicker /> */} {/* <DateRangePicker /> */}
{/* ----------------------------$$$ end---------------------------- */} {/* ----------------------------$$$ end---------------------------- */}
<FormInput /> {/* <FormInput /> */}
{/* <LeafletMap /> */} {/* <LeafletMap /> */}

@ -9,16 +9,23 @@ const BreadCrumb = ({ breadCrumbs }) => {
{breadCrumbs.map((breadCrumb, index) => ( {breadCrumbs.map((breadCrumb, index) => (
<div className="flex flex-row items-center" key={index}> <div className="flex flex-row items-center" key={index}>
<span <span
className={`cursor-pointer text-xs hover:text-blue-900 ${ className={`cursor-pointer text-xs hover:text-blue-900 ${
breadCrumb.active ? "text-blue-900" : "text-blue-400" Number(index) === breadCrumbs.length - 1
? "text-blue-900"
: "text-blue-400"
}`} }`}
> >
{breadCrumb.name} {breadCrumb.name}
{console.log(breadCrumb.active)} {/* {console.log(breadCrumb.active)} */}
</span> </span>
{Number(index) !== breadCrumbs.length - 1 && ( {Number(index) !== breadCrumbs.length - 1 && (
<div> <div>
{console.log(breadCrumbs.length - 1)} {/* {console.log(breadCrumbs)}
{console.log(breadCrumbs[breadCrumbs.length - 1])}
{console.log(
breadCrumb.length ? "text-red-900" : "text-blue-400"
)} */}
{/* {breadCrumb.active === true ? ( {/* {breadCrumb.active === true ? (
<img src={grayLeftArrow} className="w-10" /> <img src={grayLeftArrow} className="w-10" />
) : ( ) : (
@ -43,19 +50,15 @@ BreadCrumb.defaultProps = {
breadCrumbs: [ breadCrumbs: [
{ {
name: "صفحه اصلی", name: "صفحه اصلی",
active: false,
}, },
{ {
name: "آمار و گزارشات", name: "آمار و گزارشات",
active: false,
}, },
{ {
name: "فروش محصولات", name: "فروش محصولات",
active: false,
}, },
{ {
name: "سال 1400", name: "سال 1400",
active: true,
}, },
], ],
}; };

Loading…
Cancel
Save