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

Make parameters optional for components ported to TSX

This commit is contained in:
MrTimscampi 2021-06-18 16:59:54 +02:00
parent d770581c52
commit 69c4aee2b0
7 changed files with 18 additions and 18 deletions

View file

@ -3,7 +3,7 @@ import React, { FunctionComponent, useEffect, useRef, useState } from 'react';
import AlphaPicker from './alphaPicker'; import AlphaPicker from './alphaPicker';
type AlphaPickerProps = { type AlphaPickerProps = {
onAlphaPicked: () => void onAlphaPicked?: () => void
}; };
// React compatibility wrapper component for alphaPicker.js // React compatibility wrapper component for alphaPicker.js

View file

@ -6,9 +6,9 @@ import SearchSuggestions from '../search/SearchSuggestions';
import LiveTVSearchResults from '../search/LiveTVSearchResults'; import LiveTVSearchResults from '../search/LiveTVSearchResults';
type SearchProps = { type SearchProps = {
serverId: string, serverId?: string,
parentId: string, parentId?: string,
collectionType: string collectionType?: string
}; };
const SearchPage: FunctionComponent<SearchProps> = ({ serverId, parentId, collectionType }: SearchProps) => { const SearchPage: FunctionComponent<SearchProps> = ({ serverId, parentId, collectionType }: SearchProps) => {

View file

@ -18,10 +18,10 @@ const CARD_OPTIONS = {
}; };
type LiveTVSearchResultsProps = { type LiveTVSearchResultsProps = {
serverId: string; serverId?: string;
parentId: string; parentId?: string;
collectionType: string; collectionType?: string;
query: string; query?: string;
} }
/* /*

View file

@ -31,7 +31,7 @@ const createInputElement = () => ({
const normalizeInput = (value = '') => value.trim(); const normalizeInput = (value = '') => value.trim();
type SearchFieldsProps = { type SearchFieldsProps = {
onSearch: () => void onSearch?: () => void
}; };
// eslint-disable-next-line @typescript-eslint/no-empty-function // eslint-disable-next-line @typescript-eslint/no-empty-function

View file

@ -6,10 +6,10 @@ import ServerConnections from '../ServerConnections';
import SearchResultsRow from './SearchResultsRow'; import SearchResultsRow from './SearchResultsRow';
type SearchResultsProps = { type SearchResultsProps = {
serverId: string; serverId?: string;
parentId: string; parentId?: string;
collectionType: string; collectionType?: string;
query: string; query?: string;
} }
/* /*

View file

@ -16,9 +16,9 @@ const createScroller = ({ title = '' }) => ({
}); });
type SearchResultsRowProps = { type SearchResultsRowProps = {
title: string; title?: string;
items: Array<any>; // TODO: Should be Array<BaseItemDto> once we have a typed API client items?: Array<any>; // TODO: Should be Array<BaseItemDto> once we have a typed API client
cardOptions: Record<string, any>; cardOptions?: Record<string, any>;
} }
const SearchResultsRow: FunctionComponent<SearchResultsRowProps> = ({ title, items = [], cardOptions = {} }: SearchResultsRowProps) => { const SearchResultsRow: FunctionComponent<SearchResultsRowProps> = ({ title, items = [], cardOptions = {} }: SearchResultsRowProps) => {

View file

@ -19,8 +19,8 @@ const createSuggestionLink = ({name, href}) => ({
}); });
type SearchSuggestionsProps = { type SearchSuggestionsProps = {
serverId: string; serverId?: string;
parentId: string; parentId?: string;
} }
const SearchSuggestions: FunctionComponent<SearchSuggestionsProps> = ({ serverId, parentId }: SearchSuggestionsProps) => { const SearchSuggestions: FunctionComponent<SearchSuggestionsProps> = ({ serverId, parentId }: SearchSuggestionsProps) => {