mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Rename search fields component
This commit is contained in:
parent
bd4626c682
commit
1c0c25d655
2 changed files with 7 additions and 9 deletions
|
@ -1,18 +1,16 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import SearchFieldsComponent from '../search/SearchFieldsComponent';
|
||||
import SearchResultsComponent from '../search/SearchResultsComponent';
|
||||
import SearchFields from '../search/SearchFields';
|
||||
import SearchResults from '../search/SearchResultsComponent';
|
||||
|
||||
const SearchPage = ({ serverId, parentId, collectionType }) => {
|
||||
const [ query, setQuery ] = useState(null);
|
||||
|
||||
return (
|
||||
<>
|
||||
<SearchFieldsComponent
|
||||
onSearch={setQuery}
|
||||
/>
|
||||
<SearchResultsComponent
|
||||
<SearchFields onSearch={setQuery} />
|
||||
<SearchResults
|
||||
serverId={serverId || ApiClient.serverId()}
|
||||
parentId={parentId}
|
||||
collectionType={collectionType}
|
||||
|
|
|
@ -31,7 +31,7 @@ const createInputElement = () => ({
|
|||
|
||||
const normalizeInput = (value = '') => value.trim();
|
||||
|
||||
const SearchFieldsComponent = ({ onSearch = () => {} }) => {
|
||||
const SearchFields = ({ onSearch = () => {} }) => {
|
||||
const element = useRef(null);
|
||||
|
||||
const getSearchInput = () => element?.current?.querySelector('.searchfields-txtSearch');
|
||||
|
@ -83,8 +83,8 @@ const SearchFieldsComponent = ({ onSearch = () => {} }) => {
|
|||
);
|
||||
};
|
||||
|
||||
SearchFieldsComponent.propTypes = {
|
||||
SearchFields.propTypes = {
|
||||
onSearch: PropTypes.func
|
||||
};
|
||||
|
||||
export default SearchFieldsComponent;
|
||||
export default SearchFields;
|
Loading…
Add table
Add a link
Reference in a new issue