mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Remove unused variable and fix no results alignment
This commit is contained in:
parent
eaab0364d7
commit
ac29b9b338
3 changed files with 5 additions and 15 deletions
|
@ -1,5 +1,5 @@
|
|||
import React, { type FC, useEffect, useState } from 'react';
|
||||
import { useNavigate, useSearchParams } from 'react-router-dom';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
|
||||
import Page from 'components/Page';
|
||||
import SearchFields from 'components/search/SearchFields';
|
||||
|
@ -15,7 +15,6 @@ const QUERY_PARAM = 'query';
|
|||
const SERVER_ID_PARAM = 'serverId';
|
||||
|
||||
const Search: FC = () => {
|
||||
const navigate = useNavigate();
|
||||
const [ searchParams, setSearchParams ] = useSearchParams();
|
||||
const urlQuery = searchParams.get(QUERY_PARAM) || '';
|
||||
const [ query, setQuery ] = useState(urlQuery);
|
||||
|
@ -41,7 +40,7 @@ const Search: FC = () => {
|
|||
|
||||
setQuery(urlQuery);
|
||||
}
|
||||
}, [query, prevQuery, navigate, searchParams, setSearchParams, urlQuery]);
|
||||
}, [query, prevQuery, searchParams, setSearchParams, urlQuery]);
|
||||
|
||||
return (
|
||||
<Page
|
||||
|
|
|
@ -340,7 +340,9 @@ const SearchResults: FC<SearchResultsProps> = ({ serverId = window.ApiClient.ser
|
|||
/>
|
||||
|
||||
{allEmpty && debouncedQuery && !isLoading && (
|
||||
<div className='sorry-text'>{globalize.translate('SearchResultsEmpty', debouncedQuery)}</div>
|
||||
<div className='noItemsMessage centerMessage'>
|
||||
{globalize.translate('SearchResultsEmpty', debouncedQuery)}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
|
|
@ -9,14 +9,3 @@
|
|||
font-size: 2em;
|
||||
align-self: flex-end;
|
||||
}
|
||||
|
||||
.sorry-text {
|
||||
font-size: 2em;
|
||||
text-align: center;
|
||||
font-family: inherit;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue