1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Remove PropTypes

This commit is contained in:
MrTimscampi 2021-06-15 12:05:33 +02:00
parent 4d23e79f65
commit d770581c52
9 changed files with 9 additions and 54 deletions

View file

@ -1,5 +1,4 @@
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React, { FunctionComponent, useEffect, useState } from 'react';
import globalize from '../../scripts/globalize';
@ -28,7 +27,7 @@ type LiveTVSearchResultsProps = {
/*
* React component to display search result rows for live tv library search
*/
const LiveTVSearchResults: FunctionComponent<LiveTVSearchResultsProps> = ({ serverId, parentId, collectionType, query }) => {
const LiveTVSearchResults: FunctionComponent<LiveTVSearchResultsProps> = ({ serverId, parentId, collectionType, query }: LiveTVSearchResultsProps) => {
const [ movies, setMovies ] = useState([]);
const [ episodes, setEpisodes ] = useState([]);
const [ sports, setSports ] = useState([]);
@ -187,11 +186,4 @@ const LiveTVSearchResults: FunctionComponent<LiveTVSearchResultsProps> = ({ serv
);
};
LiveTVSearchResults.propTypes = {
serverId: PropTypes.string,
parentId: PropTypes.string,
collectionType: PropTypes.string,
query: PropTypes.string
};
export default LiveTVSearchResults;

View file

@ -1,5 +1,4 @@
import debounce from 'lodash-es/debounce';
import PropTypes from 'prop-types';
import React, { FunctionComponent, useEffect, useMemo, useRef } from 'react';
import AlphaPicker from '../alphaPicker/AlphaPickerComponent';
@ -36,7 +35,7 @@ type SearchFieldsProps = {
};
// eslint-disable-next-line @typescript-eslint/no-empty-function
const SearchFields: FunctionComponent<SearchFieldsProps> = ({ onSearch = () => {} }) => {
const SearchFields: FunctionComponent<SearchFieldsProps> = ({ onSearch = () => {} }: SearchFieldsProps) => {
const element = useRef(null);
const getSearchInput = () => element?.current?.querySelector('.searchfields-txtSearch');
@ -88,8 +87,4 @@ const SearchFields: FunctionComponent<SearchFieldsProps> = ({ onSearch = () => {
);
};
SearchFields.propTypes = {
onSearch: PropTypes.func
};
export default SearchFields;

View file

@ -1,5 +1,4 @@
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React, { FunctionComponent, useEffect, useState } from 'react';
import globalize from '../../scripts/globalize';
@ -16,7 +15,7 @@ type SearchResultsProps = {
/*
* React component to display search result rows for global search and non-live tv library search
*/
const SearchResults: FunctionComponent<SearchResultsProps> = ({ serverId, parentId, collectionType, query }) => {
const SearchResults: FunctionComponent<SearchResultsProps> = ({ serverId, parentId, collectionType, query }: SearchResultsProps) => {
const [ movies, setMovies ] = useState([]);
const [ shows, setShows ] = useState([]);
const [ episodes, setEpisodes ] = useState([]);
@ -266,11 +265,4 @@ const SearchResults: FunctionComponent<SearchResultsProps> = ({ serverId, parent
);
};
SearchResults.propTypes = {
serverId: PropTypes.string,
parentId: PropTypes.string,
collectionType: PropTypes.string,
query: PropTypes.string
};
export default SearchResults;

View file

@ -1,4 +1,3 @@
import PropTypes from 'prop-types';
import React, { FunctionComponent, useEffect, useRef } from 'react';
import cardBuilder from '../cardbuilder/cardBuilder';
@ -22,7 +21,7 @@ type SearchResultsRowProps = {
cardOptions: Record<string, any>;
}
const SearchResultsRow: FunctionComponent<SearchResultsRowProps> = ({ title, items = [], cardOptions = {} }) => {
const SearchResultsRow: FunctionComponent<SearchResultsRowProps> = ({ title, items = [], cardOptions = {} }: SearchResultsRowProps) => {
const element = useRef(null);
useEffect(() => {
@ -48,10 +47,4 @@ const SearchResultsRow: FunctionComponent<SearchResultsRowProps> = ({ title, ite
);
};
SearchResultsRow.propTypes = {
title: PropTypes.string,
items: PropTypes.array,
cardOptions: PropTypes.object
};
export default SearchResultsRow;

View file

@ -1,4 +1,3 @@
import PropTypes from 'prop-types';
import React, { FunctionComponent, useEffect, useState } from 'react';
import { appRouter } from '../appRouter';
@ -24,7 +23,7 @@ type SearchSuggestionsProps = {
parentId: string;
}
const SearchSuggestions: FunctionComponent<SearchSuggestionsProps> = ({ serverId, parentId }) => {
const SearchSuggestions: FunctionComponent<SearchSuggestionsProps> = ({ serverId, parentId }: SearchSuggestionsProps) => {
const [ suggestions, setSuggestions ] = useState([]);
useEffect(() => {
@ -69,9 +68,4 @@ const SearchSuggestions: FunctionComponent<SearchSuggestionsProps> = ({ serverId
);
};
SearchSuggestions.propTypes = {
parentId: PropTypes.string,
serverId: PropTypes.string
};
export default SearchSuggestions;