|
|
|
import React, { useState } from "react";
|
|
|
|
import ScrollContainer from "react-indiana-drag-scroll";
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<section className="flex flex-row items-center mx-auto w-8/12 my-20">
|
|
|
|
<div className="flex flex-col items-center">
|
|
|
|
<img src={arrowUp} />
|
|
|
|
{console.log(window.scrollY)}
|
|
|
|
<ScrollContainer ignoreElements={"#not-work-drag"} className="">
|
|
|
|
<div
|
|
|
|
className="transition ease-in-out delay-500" id="not-work-drag"
|
|
|
|
style={{
|
|
|
|
height: "100%",
|
|
|
|
position: "absolute",
|
|
|
|
display: "flex",
|
|
|
|
flexDirection: "column",
|
|
|
|
justifyContent: "space-between",
|
|
|
|
left: "12%",
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
<div className="flex flex-col h-28 " style={{}}>
|
|
|
|
{items.map((item, index) => (
|
|
|
|
<p
|
|
|
|
onClick={() => {
|
|
|
|
setSelectedYear(item);
|
|
|
|
}}
|
|
|
|
key={index}
|
|
|
|
className={`text-base my-2 cursor-pointer text-center transition ease-in-out delay-150 ${
|
|
|
|
selectedYear === item
|
|
|
|
? "text-[#06BACE] font-bold text-2xl"
|
|
|
|
: "text-gray-500"
|
|
|
|
}`}
|
|
|
|
>
|
|
|
|
{item.year}
|
|
|
|
</p>
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
</ScrollContainer>
|
|
|
|
<img src={arrowDown} />
|
|
|
|
</div>
|
|
|
|
<div className="bg-[#06BACE] w-1.5 h-96 mx-4 rounded"></div>
|
|
|
|
<div className={`flex flex-col items-center`}>
|
|
|
|
<Month />
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default SelectYear;
|
|
|
|
|
|
|
|
SelectYear.defaultProps = {
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
year: "1400"},
|
|
|
|
{
|
|
|
|
year: "1399"},
|
|
|
|
{
|
|
|
|
year: "1398"},
|
|
|
|
{
|
|
|
|
year: "1397"},
|
|
|
|
{
|
|
|
|
year: "1396"},
|
|
|
|
{
|
|
|
|
year: "1400"},
|
|
|
|
{
|
|
|
|
year: "1399"},
|
|
|
|
{
|
|
|
|
year: "1398"},
|
|
|
|
{
|
|
|
|
year: "1397"},
|
|
|
|
{
|
|
|
|
year: "1396"},
|
|
|
|
],
|
|
|
|
};
|