From 839eaa66cc9a61548968f1ac03f9475925487ad7 Mon Sep 17 00:00:00 2001 From: mahdi andalib Date: Mon, 4 Apr 2022 12:46:41 +0430 Subject: [PATCH] update --- src/App.js | 2 +- src/components/SelectYear/Month.js | 60 ++++++++++++++++++++++++------ src/components/SelectYear/index.js | 19 ++-------- 3 files changed, 52 insertions(+), 29 deletions(-) diff --git a/src/App.js b/src/App.js index 7e7f800..6f57166 100644 --- a/src/App.js +++ b/src/App.js @@ -142,7 +142,7 @@ function App() { {/* */} {/* */} {/* */} - {/* */} + {/* */} {/* */} {/* */} diff --git a/src/components/SelectYear/Month.js b/src/components/SelectYear/Month.js index 395deb5..ffb1f1e 100644 --- a/src/components/SelectYear/Month.js +++ b/src/components/SelectYear/Month.js @@ -1,20 +1,56 @@ import React from "react"; -const Month = () => { - return
Month
; +const Month = ({ items }) => { + return ( +
+ {items.map((item, index) => ( + + {item.month} + + ))} +
+ ); }; export default Month; Month.defaultProps = { - items: { - weight: "1 کیلوگرم", - pageNumber: "400 صفحه", - pageType: "گلاسه", - bookNumber: "124900985340561870112312499", - publisher: "رزمندگان", - author: "یک نویسنده گمنام", - bookType: "خشتی", - publishedYear: "1399", - }, + items: [ + { + month: "فروردین", + }, + { + month: "اردیبهشت", + }, + { + month: "خرداد", + }, + { + month: "تیر", + }, + { + month: "مرداد", + }, + { + month: "شهریور", + }, + { + month: "مهر", + }, + { + month: "آبان", + }, + { + month: "آذر", + }, + { + month: "دی", + }, + { + month: "بهمن", + }, + { + month: "اسفند", + }, + ], }; diff --git a/src/components/SelectYear/index.js b/src/components/SelectYear/index.js index 097a4f5..cee05d8 100644 --- a/src/components/SelectYear/index.js +++ b/src/components/SelectYear/index.js @@ -30,6 +30,7 @@ const SelectYear = ({ items }) => {
{items.map((item, index) => (

setSelectedYear(item)} className={`text-base my-2 cursor-pointer text-center ${ selectedYear === item @@ -45,23 +46,9 @@ const SelectYear = ({ items }) => {

-
- فروردین - اردیبهشت - خرداد - تیر - مرداد - شهریور - مهر - آبان - آذر - دی - بهمن - اسفند -
- {/*
+
{selectedYear?.components} -
*/} +
); };