Make sized container have default height so graph doesn't jump

This commit is contained in:
James Grugett 2022-10-05 18:44:28 -05:00
parent 5d7721e041
commit 935bdd12a7

View File

@ -29,7 +29,14 @@ export const SizedContainer = (props: {
}, [threshold, fullHeight, mobileHeight]) }, [threshold, fullHeight, mobileHeight])
return ( return (
<div ref={containerRef}> <div ref={containerRef}>
{width != null && height != null && children(width, height)} {width != null && height != null ? (
children(width, height)
) : (
<>
<div className="sm:hidden" style={{ height: mobileHeight }} />
<div className="hidden sm:flex" style={{ height: fullHeight }} />
</>
)}
</div> </div>
) )
} }