Trigger library search on artist/author click (#939)
* add search func * Fix lint issues and clean up --------- Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
This commit is contained in:
@@ -128,7 +128,14 @@ export const AppRoutes = {
|
||||
},
|
||||
library: {
|
||||
match: 'library',
|
||||
path: '/library',
|
||||
path: (tab?: string, search?: string) => {
|
||||
const tabParam = tab ? `tab=${tab}` : '';
|
||||
const searchParam = search ? `query=${encodeURIComponent(search)}` : '';
|
||||
|
||||
const params = [tabParam, searchParam].filter(Boolean).join('&');
|
||||
|
||||
return `/library${params ? `?${params}` : ''}`;
|
||||
},
|
||||
},
|
||||
updates: {
|
||||
match: 'updates',
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
import Stack, { StackProps } from '@mui/material/Stack';
|
||||
import Typography, { TypographyProps } from '@mui/material/Typography';
|
||||
import { ReactNode } from 'react';
|
||||
|
||||
export const Metadata = ({
|
||||
title,
|
||||
@@ -17,7 +18,7 @@ export const Metadata = ({
|
||||
valueProps,
|
||||
}: {
|
||||
title: string;
|
||||
value: string;
|
||||
value: ReactNode;
|
||||
stackProps?: StackProps;
|
||||
titleProps?: TypographyProps;
|
||||
valueProps?: TypographyProps;
|
||||
|
||||
@@ -29,6 +29,6 @@ export const useBackButton = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
navigate(AppRoutes.library.path);
|
||||
navigate(AppRoutes.library.path());
|
||||
}, [history, location.pathname]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user