Skip to content

Commit

Permalink
fix: simplify breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Sep 11, 2024
1 parent aa2340c commit 945258f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions solara/website/components/breadcrumbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@


@solara.component
def BreadCrumbs(route_current: solara.Route):
def BreadCrumbs():
router = solara.use_router()
current_path_parts = solara.resolve_path(route_current).split("/")
print("Current path parts", current_path_parts)
routes: List[solara.Route] = _resolve_path_to_route(current_path_parts[1:], router.routes, [])
print("Found routes", [r.path for r in routes])
routes = router.path_routes

with solara.Row(style={"align-items": "center", "flex-wrap": "wrap"}) as main:
for i, route in enumerate(routes):
Expand Down
2 changes: 1 addition & 1 deletion solara/website/components/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def NoPage():
def WithCode(route_current):
component = getattr(route_current.module, "Page", None)
with solara.Column(style={"flex-grow": 1, "padding-top": "56px"}) as main:
BreadCrumbs(route_current)
BreadCrumbs()
# It renders code better
MarkdownWithMetadata(
route_current.module.__doc__ or "# no docs yet",
Expand Down

0 comments on commit 945258f

Please sign in to comment.