mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 10:58:20 -07:00
Make parameters optional for components ported to TSX
This commit is contained in:
parent
d770581c52
commit
69c4aee2b0
@ -3,7 +3,7 @@ import React, { FunctionComponent, useEffect, useRef, useState } from 'react';
|
||||
import AlphaPicker from './alphaPicker';
|
||||
|
||||
type AlphaPickerProps = {
|
||||
onAlphaPicked: () => void
|
||||
onAlphaPicked?: () => void
|
||||
};
|
||||
|
||||
// React compatibility wrapper component for alphaPicker.js
|
||||
|
@ -6,9 +6,9 @@ import SearchSuggestions from '../search/SearchSuggestions';
|
||||
import LiveTVSearchResults from '../search/LiveTVSearchResults';
|
||||
|
||||
type SearchProps = {
|
||||
serverId: string,
|
||||
parentId: string,
|
||||
collectionType: string
|
||||
serverId?: string,
|
||||
parentId?: string,
|
||||
collectionType?: string
|
||||
};
|
||||
|
||||
const SearchPage: FunctionComponent<SearchProps> = ({ serverId, parentId, collectionType }: SearchProps) => {
|
||||
|
@ -18,10 +18,10 @@ const CARD_OPTIONS = {
|
||||
};
|
||||
|
||||
type LiveTVSearchResultsProps = {
|
||||
serverId: string;
|
||||
parentId: string;
|
||||
collectionType: string;
|
||||
query: string;
|
||||
serverId?: string;
|
||||
parentId?: string;
|
||||
collectionType?: string;
|
||||
query?: string;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -31,7 +31,7 @@ const createInputElement = () => ({
|
||||
const normalizeInput = (value = '') => value.trim();
|
||||
|
||||
type SearchFieldsProps = {
|
||||
onSearch: () => void
|
||||
onSearch?: () => void
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
|
@ -6,10 +6,10 @@ import ServerConnections from '../ServerConnections';
|
||||
import SearchResultsRow from './SearchResultsRow';
|
||||
|
||||
type SearchResultsProps = {
|
||||
serverId: string;
|
||||
parentId: string;
|
||||
collectionType: string;
|
||||
query: string;
|
||||
serverId?: string;
|
||||
parentId?: string;
|
||||
collectionType?: string;
|
||||
query?: string;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -16,9 +16,9 @@ const createScroller = ({ title = '' }) => ({
|
||||
});
|
||||
|
||||
type SearchResultsRowProps = {
|
||||
title: string;
|
||||
items: Array<any>; // TODO: Should be Array<BaseItemDto> once we have a typed API client
|
||||
cardOptions: Record<string, any>;
|
||||
title?: string;
|
||||
items?: Array<any>; // TODO: Should be Array<BaseItemDto> once we have a typed API client
|
||||
cardOptions?: Record<string, any>;
|
||||
}
|
||||
|
||||
const SearchResultsRow: FunctionComponent<SearchResultsRowProps> = ({ title, items = [], cardOptions = {} }: SearchResultsRowProps) => {
|
||||
|
@ -19,8 +19,8 @@ const createSuggestionLink = ({name, href}) => ({
|
||||
});
|
||||
|
||||
type SearchSuggestionsProps = {
|
||||
serverId: string;
|
||||
parentId: string;
|
||||
serverId?: string;
|
||||
parentId?: string;
|
||||
}
|
||||
|
||||
const SearchSuggestions: FunctionComponent<SearchSuggestionsProps> = ({ serverId, parentId }: SearchSuggestionsProps) => {
|
||||
|
Loading…
Reference in New Issue
Block a user