mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add type interface LibraryViewProps
This commit is contained in:
parent
92f4a42eec
commit
1c6b1fc478
7 changed files with 17 additions and 32 deletions
|
@ -1,12 +1,9 @@
|
|||
import React, { FC, useCallback } from 'react';
|
||||
|
||||
import ViewItemsContainer from '../../components/common/ViewItemsContainer';
|
||||
import { LibraryViewProps } from '../../types/interface';
|
||||
|
||||
interface CollectionsViewI {
|
||||
topParentId: string | null;
|
||||
}
|
||||
|
||||
const CollectionsView: FC<CollectionsViewI> = ({ topParentId }) => {
|
||||
const CollectionsView: FC<LibraryViewProps> = ({ topParentId }) => {
|
||||
const getBasekey = useCallback(() => {
|
||||
return 'collections';
|
||||
}, []);
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
import React, { FC, useCallback } from 'react';
|
||||
|
||||
import ViewItemsContainer from '../../components/common/ViewItemsContainer';
|
||||
import { LibraryViewProps } from '../../types/interface';
|
||||
|
||||
interface FavoritesViewI {
|
||||
topParentId: string | null;
|
||||
}
|
||||
|
||||
const FavoritesView: FC<FavoritesViewI> = ({ topParentId }) => {
|
||||
const FavoritesView: FC<LibraryViewProps> = ({ topParentId }) => {
|
||||
const getBasekey = useCallback(() => {
|
||||
return 'favorites';
|
||||
}, []);
|
||||
|
|
|
@ -4,13 +4,9 @@ import React, { FC, useCallback, useEffect, useMemo, useRef, useState } from 're
|
|||
import loading from '../../components/loading/loading';
|
||||
import * as userSettings from '../../scripts/settings/userSettings';
|
||||
import GenresItemsContainer from '../../components/common/GenresItemsContainer';
|
||||
import { Query } from '../../types/interface';
|
||||
import { LibraryViewProps, Query } from '../../types/interface';
|
||||
|
||||
interface GenresViewI {
|
||||
topParentId: string | null;
|
||||
}
|
||||
|
||||
const GenresView: FC<GenresViewI> = ({ topParentId }) => {
|
||||
const GenresView: FC<LibraryViewProps> = ({ topParentId }) => {
|
||||
const [ itemsResult, setItemsResult ] = useState<BaseItemDtoQueryResult>({});
|
||||
const element = useRef<HTMLDivElement>(null);
|
||||
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
import React, { FC, useCallback } from 'react';
|
||||
|
||||
import ViewItemsContainer from '../../components/common/ViewItemsContainer';
|
||||
import { LibraryViewProps } from '../../types/interface';
|
||||
|
||||
interface MoviesViewI {
|
||||
topParentId: string | null;
|
||||
}
|
||||
|
||||
const MoviesView: FC<MoviesViewI> = ({ topParentId }) => {
|
||||
const MoviesView: FC<LibraryViewProps> = ({ topParentId }) => {
|
||||
const getBasekey = useCallback(() => {
|
||||
return 'movies';
|
||||
}, []);
|
||||
|
|
|
@ -7,12 +7,9 @@ import dom from '../../scripts/dom';
|
|||
import globalize from '../../scripts/globalize';
|
||||
import RecommendationContainer from '../../components/common/RecommendationContainer';
|
||||
import SectionContainer from '../../components/common/SectionContainer';
|
||||
import { LibraryViewProps } from '../../types/interface';
|
||||
|
||||
interface SuggestionsViewI {
|
||||
topParentId: string | null;
|
||||
}
|
||||
|
||||
const SuggestionsView: FC<SuggestionsViewI> = ({topParentId}) => {
|
||||
const SuggestionsView: FC<LibraryViewProps> = ({topParentId}) => {
|
||||
const [ latestItems, setLatestItems ] = useState<BaseItemDto[]>([]);
|
||||
const [ resumeResult, setResumeResult ] = useState<BaseItemDtoQueryResult>({});
|
||||
const [ recommendations, setRecommendations ] = useState<RecommendationDto[]>([]);
|
||||
|
@ -86,7 +83,7 @@ const SuggestionsView: FC<SuggestionsViewI> = ({topParentId}) => {
|
|||
} else if (screenWidth >= 1200) {
|
||||
itemLimit = 6;
|
||||
}
|
||||
const url = window.window.ApiClient.getUrl('Movies/Recommendations', {
|
||||
const url = window.ApiClient.getUrl('Movies/Recommendations', {
|
||||
userId: userId,
|
||||
categoryLimit: 6,
|
||||
ItemLimit: itemLimit,
|
||||
|
|
|
@ -2,12 +2,9 @@
|
|||
import React, { FC, useCallback } from 'react';
|
||||
|
||||
import ViewItemsContainer from '../../components/common/ViewItemsContainer';
|
||||
import { LibraryViewProps } from '../../types/interface';
|
||||
|
||||
interface TrailersViewI {
|
||||
topParentId: string | null;
|
||||
}
|
||||
|
||||
const TrailersView: FC<TrailersViewI> = ({ topParentId }) => {
|
||||
const TrailersView: FC<LibraryViewProps> = ({ topParentId }) => {
|
||||
const getBasekey = useCallback(() => {
|
||||
return 'trailers';
|
||||
}, []);
|
||||
|
|
|
@ -116,3 +116,7 @@ export interface CardOptions {
|
|||
containerClass?: string;
|
||||
noItemsMessage?: string;
|
||||
}
|
||||
|
||||
export interface LibraryViewProps {
|
||||
topParentId: string | null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue