master
mahdi andalib 3 years ago
parent e0302c3e24
commit 7bce25ae94
  1. 2
      src/App.js
  2. 98
      src/components/FolderTree/index.js

@ -88,7 +88,7 @@ function App() {
{/* <Toast /> */} {/* <Toast /> */}
{/* <ProductSuggestion /> */} {/* <ProductSuggestion /> */}
{/* <ProductImage /> */} {/* <ProductImage /> */}
{/* <ProductTab /> */} <ProductTab />
{/* <ProductStatusCard /> */} {/* <ProductStatusCard /> */}
{/* <AdvertisementDesign1 /> */} {/* <AdvertisementDesign1 /> */}
{/* <AdvertisementDesign2 /> */} {/* <AdvertisementDesign2 /> */}

@ -47,50 +47,34 @@ const FolderTree = ({ items }) => {
</div> </div>
{activeDropdown === item && {activeDropdown === item &&
item.menuItems.map((menuItem, i) => ( item.menuItems.map((menuItem, i) => (
<div> <div
<button key={i}
onClick={() => className="flex flex-row items-center mb-2 cursor-pointer mr-5"
setActiveDropdown( // onClick={() =>
activeDropdown === menuItem ? null : menuItem // setActiveDropdown(
) // activeDropdown === menuItem ? null : menuItem
} // )
className="transform translate-x-10" // }
> >
mahdi {activeDropdown === menuItem ? (
</button> <img
<div src={selectedArrow}
key={i} className="-rotate-90 transition-all duration-700"
className="flex flex-row items-center mb-2 cursor-pointer mr-5" />
// onClick={() => ) : (
// setActiveDropdown( <img src={arrow} className=" transition-all duration-700" />
// activeDropdown === menuItem ? null : menuItem )}
// ) {activeDropdown === menuItem ? (
// } <img
> src={selectedFolder}
{activeDropdown === menuItem ? ( className=" transition-all duration-700"
<img />
src={selectedArrow} ) : (
className="-rotate-90 transition-all duration-700" <img src={folder} className=" transition-all duration-700" />
/> )}
) : ( <span className="text-sm mr-2" style={{ color: "#00253A" }}>
<img src={arrow} className=" transition-all duration-700" /> {menuItem.title}
)} </span>
{activeDropdown === menuItem ? (
<img
src={selectedFolder}
className=" transition-all duration-700"
/>
) : (
<img
src={folder}
className=" transition-all duration-700"
/>
)}
<span className="text-sm mr-2" style={{ color: "#00253A" }}>
{menuItem.title}
</span>
</div>
</div> </div>
))} ))}
</div> </div>
@ -99,18 +83,20 @@ const FolderTree = ({ items }) => {
); );
}; };
// {item.menuItem.menuSubItems.map((menuSubItem, j) => ( // {
// <div // item.menuItem.menuSubItems.map((menuSubItem, j) => (
// key={j} // <div
// className="flex flex-row items-center mb-2 cursor-pointer mr-5" // key={j}
// > // className="flex flex-row items-center mb-2 cursor-pointer mr-5"
// <img src={arrow} /> // >
// <img src={folder} /> // <img src={arrow} />
// <span className="text-sm mr-2" style={{ color: "#00253A" }}> // <img src={folder} />
// {menuSubItem.subTitle} // <span className="text-sm mr-2" style={{ color: "#00253A" }}>
// </span> // {menuSubItem.subTitle}
// </div> // </span>
// ))} // </div>
// ));
// }
export default FolderTree; export default FolderTree;

Loading…
Cancel
Save