1- import { ReactElement , useMemo } from "react" ;
1+ import { Fragment , ReactElement , useMemo } from "react" ;
22import classNames from "classnames" ;
33import { CalendarContainerProps } from "../typings/CalendarProps" ;
44import { CalendarPropsBuilder } from "./helpers/CalendarPropsBuilder" ;
@@ -8,7 +8,7 @@ import "./ui/Calendar.scss";
88import { useCalendarEvents } from "./helpers/useCalendarEvents" ;
99import { useLocalizer } from "./helpers/useLocalizer" ;
1010
11- export default function MxCalendar ( props : CalendarContainerProps ) : ReactElement | null {
11+ export default function MxCalendar ( props : CalendarContainerProps ) : ReactElement {
1212 // useMemo with empty dependency array is used
1313 // because style and calendar controller needs to be created only once
1414 // and not on every re-render
@@ -27,13 +27,15 @@ export default function MxCalendar(props: CalendarContainerProps): ReactElement
2727
2828 const calendarEvents = useCalendarEvents ( props ) ;
2929
30- if ( props . startDateAttribute && props . startDateAttribute . status !== "available" ) {
31- return null ;
32- }
33-
3430 return (
35- < div className = { classNames ( "widget-calendar" , props . class ) } style = { wrapperStyle } >
36- < DnDCalendar { ...calendarProps } { ...calendarEvents } />
37- </ div >
31+ < Fragment >
32+ { props . startDateAttribute && props . startDateAttribute . status !== "available" ? (
33+ < div className = "mx-progress" > </ div >
34+ ) : (
35+ < div className = { classNames ( "widget-calendar" , props . class ) } style = { wrapperStyle } >
36+ < DnDCalendar { ...calendarProps } { ...calendarEvents } />
37+ </ div >
38+ ) }
39+ </ Fragment >
3840 ) ;
3941}
0 commit comments