pSpitzner / beets-flask

An opinionated docker container for a web-interface around the music organizer beets
MIT License
30 stars 2 forks source link

Allow to add components to toolbar #25

Closed semohr closed 1 week ago

semohr commented 4 months ago

At the moment, the toolbar (or bottom bar) only shows the terminal icon. We should make it easy to extend this with local tools bound to specific routes or currently active components.

The optimal solution from the usage perspective would be to have a wrapper component which automatically renders children into the toolbar.

<SomePageContent/>
<ToolbarWrapper>
    <ToolbarIcon/>
</ToolbarWrapper>

I think this could be done using portals and the current toolbar component as reference. We will most likely need a context provider for the toolbar but there might be an easier way to implement this as we only need to share the reference to the toolbar div.

function ToolbarWrapper(children){
  return {createPortal(
    children,
    refToToolbar
  )}
}