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 (
<div className={className}>
<h2 className="text-xl">Belegungsplan</h2>
<Loading loading={daysBookedLoading}>
<Loading className="booking_calendar" loading={daysBookedLoading}>
<Calendar
defaultActiveStartDate={startDate}
minDate={new Date()}

View File

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