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 /> */}
{/* <ProductSuggestion /> */}
{/* <ProductImage /> */}
{/* <ProductTab /> */}
<ProductTab />
{/* <ProductStatusCard /> */}
{/* <AdvertisementDesign1 /> */}
{/* <AdvertisementDesign2 /> */}

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

Loading…
Cancel
Save