From fd954187504ddab241d222fbd1e345bca3f3f7ba Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Sat, 16 Nov 2019 11:13:14 +0100 Subject: [PATCH] Remove code duplication (#277) --- src/Calendar/Navigation.jsx | 2 +- src/MonthView/WeekNumber.jsx | 27 +++++++++++++++------------ src/MonthView/Weekdays.jsx | 6 ++++-- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/Calendar/Navigation.jsx b/src/Calendar/Navigation.jsx index 15de4c54..55c1cb26 100644 --- a/src/Calendar/Navigation.jsx +++ b/src/Calendar/Navigation.jsx @@ -143,7 +143,7 @@ export default function Navigation({ ) : ( -
- - {weekNumber} - +
+ {children}
) ); diff --git a/src/MonthView/Weekdays.jsx b/src/MonthView/Weekdays.jsx index 0499db82..a52dab39 100644 --- a/src/MonthView/Weekdays.jsx +++ b/src/MonthView/Weekdays.jsx @@ -12,6 +12,8 @@ import { getDayOfWeek } from '../shared/dates'; import { formatWeekday, formatShortWeekday as defaultFormatShortWeekday } from '../shared/dateFormatter'; import { isCalendarType } from '../shared/propTypes'; +const className = 'react-calendar__month-view__weekdays'; + export default function Weekdays(props) { const { calendarType, @@ -37,7 +39,7 @@ export default function Weekdays(props) { weekdays.push(
{formatShortWeekday(locale, weekdayDate).replace('.', '')} @@ -48,7 +50,7 @@ export default function Weekdays(props) { return (