|
|
|
@ -1,5 +1,7 @@ |
|
|
|
|
import React from "react"; |
|
|
|
|
|
|
|
|
|
import "./index.scss"; |
|
|
|
|
|
|
|
|
|
// ? images
|
|
|
|
|
import folder from "./images/folder-open.svg"; |
|
|
|
|
import more from "./images/more.svg"; |
|
|
|
@ -9,11 +11,42 @@ import pic3 from "./images/profile-pic3.svg"; |
|
|
|
|
|
|
|
|
|
const Folderlists = ({ items }) => { |
|
|
|
|
return ( |
|
|
|
|
<section className="flex flex-row items-center justify-around mt-5"> |
|
|
|
|
<section |
|
|
|
|
className="flex flex-row gap-4 items-center mt-5 no-scrollbar tabbar overflow-x-scroll scrolling-touch" |
|
|
|
|
onMouseDown={(e) => { |
|
|
|
|
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; |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
{items.map((item, index) => ( |
|
|
|
|
<div |
|
|
|
|
className="flex flex-col bg-white border-2 rounded-lg p-4" |
|
|
|
|
style={{ borderColor: "#EEEEEE", minWidth: "330px" }} |
|
|
|
|
className="flex flex-col border-2 rounded-lg p-4" |
|
|
|
|
style={{ |
|
|
|
|
borderColor: "#EEEEEE", |
|
|
|
|
minWidth: "330px", |
|
|
|
|
backgroundColor: "#FBFBFB", |
|
|
|
|
}} |
|
|
|
|
onClick={(e) => { |
|
|
|
|
if (window.isDown) return e.preventDefault(); |
|
|
|
|
///do here
|
|
|
|
|
}} |
|
|
|
|
aria-current="page" |
|
|
|
|
key={index} |
|
|
|
|
> |
|
|
|
|
<div className="flex flex-row justify-between items-center"> |
|
|
|
@ -23,7 +56,7 @@ const Folderlists = ({ items }) => { |
|
|
|
|
src={item.dropDownIcon} |
|
|
|
|
className="rotate-90 w-5 cursor-pointer mr-3" |
|
|
|
|
/> |
|
|
|
|
{item.users.slice(0, 3).map((user, i) => ( |
|
|
|
|
{item.users.slice(0, 8).map((user, i) => ( |
|
|
|
|
<img |
|
|
|
|
key={i} |
|
|
|
|
src={user.picture} |
|
|
|
@ -141,5 +174,94 @@ Folderlists.defaultProps = { |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
icon: folder, |
|
|
|
|
title: "پوشه فایلهای متفرقه آزمون 1400", |
|
|
|
|
memory: 44, |
|
|
|
|
fileNum: 344, |
|
|
|
|
dropDownIcon: more, |
|
|
|
|
users: [], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
icon: folder, |
|
|
|
|
title: "پوشه فایلهای متفرقه آزمون 1400", |
|
|
|
|
memory: 44, |
|
|
|
|
fileNum: 344, |
|
|
|
|
dropDownIcon: more, |
|
|
|
|
users: [ |
|
|
|
|
{ |
|
|
|
|
picture: pic1, |
|
|
|
|
name: "مهدی", |
|
|
|
|
fname: "عندلیب", |
|
|
|
|
product: "کتاب ریاضی کلاس اول", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
icon: folder, |
|
|
|
|
title: "پوشه فایلهای متفرقه آزمون 1400", |
|
|
|
|
memory: 44, |
|
|
|
|
fileNum: 344, |
|
|
|
|
dropDownIcon: more, |
|
|
|
|
users: [ |
|
|
|
|
{ |
|
|
|
|
picture: pic1, |
|
|
|
|
name: "مهدی", |
|
|
|
|
fname: "عندلیب", |
|
|
|
|
product: "کتاب ریاضی کلاس اول", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
picture: pic2, |
|
|
|
|
name: "سعید", |
|
|
|
|
fname: "سعیدی", |
|
|
|
|
product: "کتاب ریاضی کلاس دوم", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
icon: folder, |
|
|
|
|
title: "پوشه فایلهای متفرقه آزمون 1400", |
|
|
|
|
memory: 44, |
|
|
|
|
fileNum: 344, |
|
|
|
|
dropDownIcon: more, |
|
|
|
|
users: [ |
|
|
|
|
{ |
|
|
|
|
picture: pic1, |
|
|
|
|
name: "مهدی", |
|
|
|
|
fname: "عندلیب", |
|
|
|
|
product: "کتاب ریاضی کلاس اول", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
picture: pic2, |
|
|
|
|
name: "سعید", |
|
|
|
|
fname: "سعیدی", |
|
|
|
|
product: "کتاب ریاضی کلاس دوم", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
picture: pic3, |
|
|
|
|
name: "محمد", |
|
|
|
|
fname: "محمدی", |
|
|
|
|
product: "کتاب فیزیک کلاس سول", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
picture: pic1, |
|
|
|
|
name: "مهدی", |
|
|
|
|
fname: "عندلیب", |
|
|
|
|
product: "کتاب ریاضی کلاس اول", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
picture: pic2, |
|
|
|
|
name: "سعید", |
|
|
|
|
fname: "سعیدی", |
|
|
|
|
product: "کتاب ریاضی کلاس دوم", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
picture: pic3, |
|
|
|
|
name: "محمد", |
|
|
|
|
fname: "محمدی", |
|
|
|
|
product: "کتاب فیزیک کلاس سول", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}; |
|
|
|
|