add booking_calendar.loaded class when calendar has loaded

This commit is contained in:
Thomas Ruoff
2022-04-22 19:04:10 +02:00
parent 60b2560472
commit 13d25b3dcd
2 changed files with 5 additions and 2 deletions

View File

@@ -94,7 +94,7 @@ export default function MyCalendar({
return ( return (
<div className={className}> <div className={className}>
<h2 className="text-xl">Belegungsplan</h2> <h2 className="text-xl">Belegungsplan</h2>
<Loading loading={daysBookedLoading}> <Loading className="booking_calendar" loading={daysBookedLoading}>
<Calendar <Calendar
defaultActiveStartDate={startDate} defaultActiveStartDate={startDate}
minDate={new Date()} minDate={new Date()}

View File

@@ -3,12 +3,15 @@ import Spinner from './spinner'
export default function Loading({ export default function Loading({
loading, loading,
className,
children, children,
}: { }: {
loading: boolean loading: boolean
className: string
children: any children: any
}) { }) {
const classNames = classnames({ const classNames = classnames(className, {
loaded: !loading,
'opacity-50': loading, 'opacity-50': loading,
}) })
return ( return (