diff --git a/src/App.js b/src/App.js index 6f57166..0e80dd9 100644 --- a/src/App.js +++ b/src/App.js @@ -115,7 +115,7 @@ function App() { {/* */} {/* */} {/* */} - {/* */} + {/* */} {/* */} diff --git a/src/components/SelectYear/Month.js b/src/components/SelectYear/Month.js index ffb1f1e..1ca42ab 100644 --- a/src/components/SelectYear/Month.js +++ b/src/components/SelectYear/Month.js @@ -1,10 +1,18 @@ -import React from "react"; +import React, { useState } from "react"; const Month = ({ items }) => { + const [selectedYear, setSelectedYear] = useState(null); + return (
{items.map((item, index) => ( - + setSelectedYear(selectedYear === item ? null : item)} + className={`text-xs my-2 cursor-pointer ${ + selectedYear === item ? "text-[#06BACE] font-bold " : "" + }`} + key={index} + > {item.month} ))} diff --git a/src/components/SelectYear/index.js b/src/components/SelectYear/index.js index cee05d8..b35f651 100644 --- a/src/components/SelectYear/index.js +++ b/src/components/SelectYear/index.js @@ -78,4 +78,42 @@ SelectYear.defaultProps = { components: , }, ], + months: [ + { + month: "فروردین", + }, + { + month: "اردیبهشت", + }, + { + month: "خرداد", + }, + { + month: "تیر", + }, + { + month: "مرداد", + }, + { + month: "شهریور", + }, + { + month: "مهر", + }, + { + month: "آبان", + }, + { + month: "آذر", + }, + { + month: "دی", + }, + { + month: "بهمن", + }, + { + month: "اسفند", + }, + ], };