parent
a97f1eff50
commit
05373ba7da
6 changed files with 104 additions and 32 deletions
After Width: | Height: | Size: 573 B |
After Width: | Height: | Size: 573 B |
@ -1,41 +1,81 @@ |
|||||||
import React from "react"; |
import React, { useState } from "react"; |
||||||
|
|
||||||
|
import "./index.scss"; |
||||||
|
|
||||||
|
import arrowDown from "./arrow-down.svg"; |
||||||
|
import arrowUp from "./arrow-up.svg"; |
||||||
|
import Month from "./Month.js"; |
||||||
|
|
||||||
|
const SelectYear = ({ items }) => { |
||||||
|
const [selectedYear, setSelectedYear] = useState(null); |
||||||
|
|
||||||
const SelectYear = () => { |
|
||||||
return ( |
return ( |
||||||
<section className="flex flex-row items-center bg-pink-200 mx-auto"> |
<section className="flex flex-row items-center mx-auto w-8/12 my-20"> |
||||||
<div> |
<div className="flex flex-col items-center"> |
||||||
<span>1400</span> |
<img src={arrowUp} /> |
||||||
|
<div className="h-32 overflow-auto overflow-x-hidden overflow-y-hidden"> |
||||||
|
{items.map((item, index) => ( |
||||||
|
<div className="flex flex-col" key={index}> |
||||||
|
<p |
||||||
|
onClick={() => setSelectedYear(item)} |
||||||
|
className={`text-base my-2 cursor-pointer text-center ${ |
||||||
|
selectedYear === item |
||||||
|
? "text-[#06BACE] font-bold text-2xl" |
||||||
|
: "text-gray-300" |
||||||
|
}`}
|
||||||
|
> |
||||||
|
{item.year} |
||||||
|
</p> |
||||||
|
</div> |
||||||
|
))} |
||||||
|
</div> |
||||||
|
<img src={arrowDown} /> |
||||||
</div> |
</div> |
||||||
<div className="bg-[#06BACE] w-2 h-full rounded"></div> |
<div className="bg-[#06BACE] w-1.5 h-96 mx-4 rounded"></div> |
||||||
<div className="flex flex-col items-center"> |
<div className="flex flex-col items-center"> |
||||||
<span>فروردین</span> |
<span className="text-xs my-2">فروردین</span> |
||||||
<span>فروردین</span> |
<span className="text-xs my-2">اردیبهشت</span> |
||||||
<span>فروردین</span> |
<span className="text-xs my-2">خرداد</span> |
||||||
<span>فروردین</span> |
<span className="text-xs my-2">تیر</span> |
||||||
<span>فروردین</span> |
<span className="text-xs my-2">مرداد</span> |
||||||
<span>فروردین</span> |
<span className="text-xs my-2 text-[#06BACE]">شهریور</span> |
||||||
<span>فروردین</span> |
<span className="text-xs my-2">مهر</span> |
||||||
<span>فروردین</span> |
<span className="text-xs my-2">آبان</span> |
||||||
<span>فروردین</span> |
<span className="text-xs my-2">آذر</span> |
||||||
<span>فروردین</span> |
<span className="text-xs my-2">دی</span> |
||||||
<span>فروردین</span> |
<span className="text-xs my-2">بهمن</span> |
||||||
<span>فروردین</span> |
<span className="text-xs my-2">اسفند</span> |
||||||
</div> |
</div> |
||||||
|
{/* <div className={`flex flex-col items-center`}> |
||||||
|
{selectedYear?.components} |
||||||
|
</div> */} |
||||||
</section> |
</section> |
||||||
); |
); |
||||||
}; |
}; |
||||||
|
|
||||||
export default SelectYear; |
export default SelectYear; |
||||||
|
|
||||||
// SelectYear.defaultProps = {
|
SelectYear.defaultProps = { |
||||||
// date: [
|
items: [ |
||||||
// {
|
{ |
||||||
// year: "1400",
|
year: "1400", |
||||||
// months: [
|
components: <Month />, |
||||||
// {
|
}, |
||||||
|
{ |
||||||
// }
|
year: "1399", |
||||||
// ]
|
components: <Month />, |
||||||
// }
|
}, |
||||||
// ]
|
{ |
||||||
// }
|
year: "1398", |
||||||
|
components: <Month />, |
||||||
|
}, |
||||||
|
{ |
||||||
|
year: "1397", |
||||||
|
components: <Month />, |
||||||
|
}, |
||||||
|
{ |
||||||
|
year: "1396", |
||||||
|
components: <Month />, |
||||||
|
}, |
||||||
|
], |
||||||
|
}; |
||||||
|
@ -0,0 +1,11 @@ |
|||||||
|
.no-scrollbar { |
||||||
|
-ms-overflow-style: none; /* IE and Edge */ |
||||||
|
scrollbar-width: none; /* Firefox */ |
||||||
|
} |
||||||
|
.tabbar { |
||||||
|
cursor: pointer; |
||||||
|
} |
||||||
|
.active2, |
||||||
|
.active2 li a { |
||||||
|
cursor: move !important; |
||||||
|
} |
Loading…
Reference in new issue