|
|
|
@ -38,6 +38,7 @@ import { Header, MonthSelector, YearSelector, DaysList } from './components'; |
|
|
|
|
customDaysClassName, |
|
|
|
|
events, |
|
|
|
|
renderEvents, |
|
|
|
|
type |
|
|
|
|
}) => { |
|
|
|
|
const calendarElement = useRef(null); |
|
|
|
|
const [mainState, setMainState] = useState({ |
|
|
|
@ -84,8 +85,8 @@ import { Header, MonthSelector, YearSelector, DaysList } from './components'; |
|
|
|
|
: getComputedActiveDate(); |
|
|
|
|
|
|
|
|
|
const weekdays = weekDaysList.map((weekDay) => ( |
|
|
|
|
<abbr key={weekDay.name} title={weekDay.name} className="Calendar__weekDay"> |
|
|
|
|
{weekDay.short} |
|
|
|
|
<abbr key={weekDay.name} title={weekDay.name} className={`Calendar__weekDay ${type}`}> |
|
|
|
|
{ type == 'dashboard' ? weekDay.name : weekDay.short} |
|
|
|
|
</abbr> |
|
|
|
|
)); |
|
|
|
|
|
|
|
|
@ -125,7 +126,7 @@ import { Header, MonthSelector, YearSelector, DaysList } from './components'; |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div |
|
|
|
|
className={`Calendar -noFocusOutline ${calendarClassName} -${isRtl ? 'rtl' : 'ltr' |
|
|
|
|
className={`Calendar ${type} -noFocusOutline ${calendarClassName} -${isRtl ? 'rtl' : 'ltr' |
|
|
|
|
}`}
|
|
|
|
|
role="grid" |
|
|
|
|
style={{ |
|
|
|
@ -146,6 +147,7 @@ import { Header, MonthSelector, YearSelector, DaysList } from './components'; |
|
|
|
|
isMonthSelectorOpen={mainState.isMonthSelectorOpen} |
|
|
|
|
isYearSelectorOpen={mainState.isYearSelectorOpen} |
|
|
|
|
locale={locale} |
|
|
|
|
type={type} |
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
<MonthSelector |
|
|
|
@ -168,7 +170,7 @@ import { Header, MonthSelector, YearSelector, DaysList } from './components'; |
|
|
|
|
locale={locale} |
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
<div className="Calendar__weekDays">{weekdays}</div> |
|
|
|
|
<div className={`Calendar__weekDays ${type}`}>{weekdays}</div> |
|
|
|
|
|
|
|
|
|
<DaysList |
|
|
|
|
activeDate={activeDate} |
|
|
|
@ -195,9 +197,16 @@ import { Header, MonthSelector, YearSelector, DaysList } from './components'; |
|
|
|
|
mainState.isYearSelectorOpen || mainState.isMonthSelectorOpen |
|
|
|
|
} |
|
|
|
|
showEvent={event => setEventInFooter(event)} |
|
|
|
|
type={type} |
|
|
|
|
/> |
|
|
|
|
<div className="Calendar__footer"> |
|
|
|
|
<p className='footer__Events'>{eventInFooter}</p> |
|
|
|
|
<div className={`footer__Events ${type}`}> |
|
|
|
|
{ |
|
|
|
|
type == 'dashboard' ? <><div className='text-xl font-black text-blue-400'>رویداد ها: </div><p className='text-blue-300 font-bold'>{eventInFooter ? eventInFooter : 'رویدادی در این روز وجود ندارد!'}</p></> : eventInFooter |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
{renderFooter()}</div> |
|
|
|
|
</div> |
|
|
|
|
); |
|
|
|
|