-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
creating a multi-page app without forcing an appbar #584
Comments
Hi Brian! I think I found the issue - you manually define routes = [
solara.Route(path="/", component=Home, label="Home", layout=Layout),
...
] I also see that we used to warn about this before ce4a3a0. I'll reintroduce the warning for the next person to stumble into this! |
@iisakkirotko Thanks, that almost does the trick! The remaining issue is the dashboard sub page I have has its own layout, with its own AppBar and SidePanel, that I'd like to preserve. I tried the following, which mostly works. It brings back its layout but also adds the tabs back to the "Home" and "Embed" pages, which I'd like to remove. I'd like the dashboard's original layout. Is that possible?
|
The dashboard
If I leave out the layout in the base route definition |
Hey again! Indeed the tabs are added for sibling routes. You can avoid this happening by doing something like: routes = [
solara.Route(path="/", component=Home, label="Home", layout=Layout),
solara.Route(path="dashboard", layout=DashLayout, children=[
solara.Route(path="/", component=Dashboard, label="Dashboard")
]),
...
] |
Hmm, that didn't seem to work. Both the home and embed pages render correctly, but the dashboard page still displays the sibling tabs. |
Ah, I see what I missed. I think solara/solara/components/applayout.py Lines 282 to 286 in fbd9192
I think for now you'd need to make a custom implementation of the solara/solara/components/applayout.py Line 260 in fbd9192
isn't the most optimal, and could be changed to allow for an |
Hey again @havok2063! I think you could achieve what you're after for the dashboard page by calling |
@iisakkirotko Just getting back to this. Has there been any updates on turning off the tabbed navigation elements in an appbar? |
@havok2063 I haven't gotten around to it yet, but it is on my todo-list for this week and I hope to have the time to look at it tomorrow. |
@iisakkirotko Great! I think having more flexibility and control over the AppBar would be great. And as an FYI, your suggestion of adding
|
Is it possible to create a multi-page app without forcing the creation of an app bar with tabbed pages? I effectively have two "single-page" apps, each with their own top-level
Page
component, that I need to combine into a multi-page app, with each behind a route. I tried something like the following:but this forces an AppBar, which covers up components on the "embed" page. Additionally, navigating to the home page first correctly displays the "Solara Home" text, but then toggling to the embed page and back to home, the "Solara Home" content is missing.
In this case I don't need the page navigation, I just need to point to "site/solara/embed" and "site/solara/dashboard" separately and have them render as expected.
Also for reference, I am not running this with the solara server, the combined app will be sub-mounted into an existing FastAPI app. I think that just means that the
SOLARA_APP
env variable should point to the top-level solara application module.I tried disabling the layout by adding the following in the above top-level module but that didn't seem to change anything.
The text was updated successfully, but these errors were encountered: