From 38b9c5eae6304ed6c647054ae328d52094dd6688 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 11 Apr 2022 12:13:56 +0430 Subject: [PATCH] update src/components/SelectYear/index.js --- src/components/SelectYear/index.js | 51 ++++++++++++++++-------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/src/components/SelectYear/index.js b/src/components/SelectYear/index.js index cee05d8..207fd5b 100644 --- a/src/components/SelectYear/index.js +++ b/src/components/SelectYear/index.js @@ -14,10 +14,10 @@ const SelectYear = ({ items }) => {
- + {console.log(window.scrollY)} +
{ justifyContent: "space-between", left: "12%", }} - >
-
+ > +
+
{items.map((item, index) => (

{ + setSelectedYear(item); + }} key={index} - onClick={() => setSelectedYear(item)} - className={`text-base my-2 cursor-pointer text-center ${ + 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-300" + : "text-gray-500" }`} > {item.year} @@ -47,7 +50,7 @@ const SelectYear = ({ items }) => {

- {selectedYear?.components} +
); @@ -58,24 +61,24 @@ export default SelectYear; SelectYear.defaultProps = { items: [ { - year: "1400", - components: , - }, + year: "1400"}, + { + year: "1399"}, + { + year: "1398"}, + { + year: "1397"}, + { + year: "1396"}, + { + year: "1400"}, { - year: "1399", - components: , - }, + year: "1399"}, { - year: "1398", - components: , - }, + year: "1398"}, { - year: "1397", - components: , - }, + year: "1397"}, { - year: "1396", - components: , - }, + year: "1396"}, ], };