1
0
Fork 0
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:
Bill Thornton 2021-06-01 15:19:02 -04:00
parent bd4626c682
commit 1c0c25d655
2 changed files with 7 additions and 9 deletions

View file

@ -1,18 +1,16 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React, { useState } from 'react'; import React, { useState } from 'react';
import SearchFieldsComponent from '../search/SearchFieldsComponent'; import SearchFields from '../search/SearchFields';
import SearchResultsComponent from '../search/SearchResultsComponent'; import SearchResults from '../search/SearchResultsComponent';
const SearchPage = ({ serverId, parentId, collectionType }) => { const SearchPage = ({ serverId, parentId, collectionType }) => {
const [ query, setQuery ] = useState(null); const [ query, setQuery ] = useState(null);
return ( return (
<> <>
<SearchFieldsComponent <SearchFields onSearch={setQuery} />
onSearch={setQuery} <SearchResults
/>
<SearchResultsComponent
serverId={serverId || ApiClient.serverId()} serverId={serverId || ApiClient.serverId()}
parentId={parentId} parentId={parentId}
collectionType={collectionType} collectionType={collectionType}

View file

@ -31,7 +31,7 @@ const createInputElement = () => ({
const normalizeInput = (value = '') => value.trim(); const normalizeInput = (value = '') => value.trim();
const SearchFieldsComponent = ({ onSearch = () => {} }) => { const SearchFields = ({ onSearch = () => {} }) => {
const element = useRef(null); const element = useRef(null);
const getSearchInput = () => element?.current?.querySelector('.searchfields-txtSearch'); const getSearchInput = () => element?.current?.querySelector('.searchfields-txtSearch');
@ -83,8 +83,8 @@ const SearchFieldsComponent = ({ onSearch = () => {} }) => {
); );
}; };
SearchFieldsComponent.propTypes = { SearchFields.propTypes = {
onSearch: PropTypes.func onSearch: PropTypes.func
}; };
export default SearchFieldsComponent; export default SearchFields;