router: "background" page
Hello everyone,
I am trying to recreate this effect. My main issue at the moment is that I need the back button to function as a back button, so I'm not sure how I could do this. specifically, I need to be able to open the route that's in the drawer while keeping the old one in the background, if that makes any sense. I hope the video explains.
thanks!
18 Replies
i don't think solid router has the features to do this nicely, but a more hacky way might be implementing the whole chat route in a layout and making the page essentially just be empty, then implementing the modal in another route within that layout
hmmmm
not sure if I like that; that won't really work with the drawer then no?
oh i meant drawer sorry
so you'd have
okay well actually wait, I should clarify
I more or less want the drawer to be present at all times (apple shortcuts style). once you actually interact with it (so that it becomes modal and you cant interact with the background) it should use the other route. so its more like that I want to share the component with the route, but have different state I guess?

hmmm that's kinda getting into parallel routes territory which solid router doesn't support yet, i think i'd just bail out of routing and manage the route state myself for that drawer
yeah, it kinda is parallel routes :)
unless that persistent bit was also part of the layout and the content below was the children, idk
I mean
okay this is quite a hack I guess
but could I have the entire ui, including drawer, be in a layout, and then the drawer state is inferred by the actual route?
yeah i think that's what i meant
if you don't have other stuff you'd need as children it could work
not sure I understand?
what do you mean
by 'inferred by the actual route' i assume that the
props.children
of the layout would be the drawer contentsoh like that
wait actually thats smart i think
it could work but if you needed any non-drawer routes i don't think it's an option
I mean thats a stretch, but my idea was kinda that (aside from the root ui) everything would be either outside or inside that drawer; but the drawer would also have navigation inside it
so for example settings pages would be in that drawer, going back goes back a settings page, or you could dismiss it entirely by swiping down
i guess you could just do it and pray you don't need any other routes until parallel routes get implemented haha
https://github.com/solidjs/solid-router/pull/426 oh lmao did you pr parallel routes
GitHub
Parallel Routes by Brendonovich · Pull Request #426 · solidjs/solid...
This PR adds basic support for Parallel Routes, a feature I've only seen in Next.js.
The following is my reasoning for why Solid Router should support them, but I think Next and this Remix ...
yea they're not ready to ship tho
worked great for us implementing breadcrumbs haha