cu-mkp / editioncrafter

Software for the development of EditionCrafter, digital critical edition publication tool
https://cu-mkp.github.io/editioncrafter/
MIT License
8 stars 3 forks source link

Making height more dynamic #81

Closed ajolipa closed 6 months ago

ajolipa commented 6 months ago

In this PR

Changes how the height of the component is computed so that it fits seamlessly into whatever page layout it's inserted into. The viewer will now fill its containing div both in width and height, with a scroll behavior on height overflow.

This PR also very slightly modifies how the OpenSeaDragon viewer loading state is tracked within the SeaDragonComponent component, to avoid React errors that come from async useEffect callback functions.

Notes

With the new height behavior, if the immediate container of the viewer does not have a set height, the height will adjust on a page-by-page basis to fit the content. If that behavior is undesirable, we could do something like passing a fixedHeight prop or something that would tell it to fit the whole viewscreen rather than being responsive, or something, but for now that didn't really feel necessary. (But note that in Storybook the container has no fixed height by default, so in most of the stories we see that dynamic height behavior from page to page.)