napred/designsystem

Create mechanism to track overlay rendering, so we always have only one overlay

Opened this issue · 0 comments

If we allow to render multiple overlays, we get darker overlay screen with each overlayed component. We should prevent this by tracking rendered overlays and always only render one.

Maybe a context hook which registers an overlay count? We can increment/decrement the count and when it drops below 1, we stop rendering them? It could also support overlay container names (like now) so we can force multiple overlays when we really want them for some reason.