mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
apply suggestion
Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>
This commit is contained in:
parent
69afc01d44
commit
f8cb8721d1
2 changed files with 7 additions and 8 deletions
|
@ -3,6 +3,7 @@ import {
|
|||
Link,
|
||||
URLSearchParamsInit,
|
||||
createSearchParams,
|
||||
useLocation,
|
||||
useSearchParams
|
||||
} from 'react-router-dom';
|
||||
import SearchIcon from '@mui/icons-material/Search';
|
||||
|
@ -11,7 +12,8 @@ import Tooltip from '@mui/material/Tooltip';
|
|||
import globalize from 'scripts/globalize';
|
||||
|
||||
const getUrlParams = (searchParams: URLSearchParams) => {
|
||||
const parentId = searchParams.get('parentId') || searchParams.get('topParentId');
|
||||
const parentId =
|
||||
searchParams.get('parentId') || searchParams.get('topParentId');
|
||||
const collectionType = searchParams.get('collectionType');
|
||||
const params: URLSearchParamsInit = {};
|
||||
|
||||
|
@ -27,15 +29,13 @@ const getUrlParams = (searchParams: URLSearchParams) => {
|
|||
|
||||
interface SearchButtonProps {
|
||||
isTabsAvailable: boolean;
|
||||
isSearchPath: boolean;
|
||||
}
|
||||
|
||||
const SearchButton: FC<SearchButtonProps> = ({
|
||||
isTabsAvailable,
|
||||
isSearchPath
|
||||
}) => {
|
||||
const SearchButton: FC<SearchButtonProps> = ({ isTabsAvailable }) => {
|
||||
const location = useLocation();
|
||||
const [searchParams] = useSearchParams();
|
||||
|
||||
const isSearchPath = location.pathname === '/search.html';
|
||||
const createSearchLink = isTabsAvailable ?
|
||||
{
|
||||
pathname: '/search.html',
|
||||
|
|
|
@ -33,7 +33,6 @@ const ExperimentalAppToolbar: FC<AppToolbarProps> = ({
|
|||
|
||||
const isTabsAvailable = isTabPath(location.pathname);
|
||||
const isPublicPath = PUBLIC_PATHS.includes(location.pathname);
|
||||
const isSearchPath = location.pathname === '/search.html';
|
||||
|
||||
return (
|
||||
<AppToolbar
|
||||
|
@ -41,7 +40,7 @@ const ExperimentalAppToolbar: FC<AppToolbarProps> = ({
|
|||
<>
|
||||
<SyncPlayButton />
|
||||
<RemotePlayButton />
|
||||
<SearchButton isTabsAvailable={isTabsAvailable} isSearchPath={isSearchPath} />
|
||||
<SearchButton isTabsAvailable={isTabsAvailable} />
|
||||
</>
|
||||
)}
|
||||
isDrawerAvailable={isDrawerAvailable}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue