Skip to content

Commit

Permalink
Merge pull request #3128 from metabrainz/back-button-playlist-page
Browse files Browse the repository at this point in the history
Add back button and secondary navbar to playlist pages
  • Loading branch information
anshg1214 authored Jan 16, 2025
2 parents 5d5289a + 46a036e commit f95b376
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { Outlet, ScrollRestoration, useNavigate } from "react-router-dom";

export default function EntityPageLayout() {
export default function LayoutWithBackButton() {
const navigate = useNavigate();

const goBack = () => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/js/src/routes/EntityPages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const getEntityPages = (): RouteObject[] => {
{
path: "/",
lazy: async () => {
const EntityPageLayout = await import("../layout/EntityPages");
const EntityPageLayout = await import("../layout/LayoutWithBackButton");
return { Component: EntityPageLayout.default };
},
children: [
Expand Down
19 changes: 15 additions & 4 deletions frontend/js/src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,23 @@ const getIndexRoutes = (): RouteObject[] => {
},
},
{
path: "playlist/:playlistID/",
path: "playlist/",
lazy: async () => {
const PlaylistPage = await import("../playlists/Playlist");
return { Component: PlaylistPage.default };
const LayoutWithBackButton = await import(
"../layout/LayoutWithBackButton"
);
return { Component: LayoutWithBackButton.default };
},
loader: RouteLoader,
children: [
{
path: ":playlistID/",
lazy: async () => {
const PlaylistPage = await import("../playlists/Playlist");
return { Component: PlaylistPage.default };
},
loader: RouteLoader,
},
],
},
{
path: "/statistics/",
Expand Down

0 comments on commit f95b376

Please sign in to comment.