mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
Merge pull request #3471 from thornbill/fix-more-type-warnings
Fix remaining any type warnings
This commit is contained in:
commit
8c07a626fd
2
src/apiclient.d.ts
vendored
2
src/apiclient.d.ts
vendored
@ -1,4 +1,5 @@
|
|||||||
// TODO: Move to jellyfin-apiclient
|
// TODO: Move to jellyfin-apiclient
|
||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
declare module 'jellyfin-apiclient' {
|
declare module 'jellyfin-apiclient' {
|
||||||
import {
|
import {
|
||||||
AllThemeMediaResult,
|
AllThemeMediaResult,
|
||||||
@ -348,3 +349,4 @@ declare module 'jellyfin-apiclient' {
|
|||||||
trigger(obj: any, eventName: string, ...args: any[]): void;
|
trigger(obj: any, eventName: string, ...args: any[]): void;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
/* eslint-enable @typescript-eslint/no-explicit-any */
|
||||||
|
@ -26,10 +26,10 @@ const createButtonElement = () => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
user?: Record<string, any>;
|
user?: UserDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getLastSeenText = (lastActivityDate?: string) => {
|
const getLastSeenText = (lastActivityDate?: string | null) => {
|
||||||
if (lastActivityDate) {
|
if (lastActivityDate) {
|
||||||
return globalize.translate('LastSeen', formatDistanceToNow(Date.parse(lastActivityDate), localeWithSuffix));
|
return globalize.translate('LastSeen', formatDistanceToNow(Date.parse(lastActivityDate), localeWithSuffix));
|
||||||
}
|
}
|
||||||
@ -37,16 +37,16 @@ const getLastSeenText = (lastActivityDate?: string) => {
|
|||||||
return '';
|
return '';
|
||||||
};
|
};
|
||||||
|
|
||||||
const UserCardBox: FunctionComponent<IProps> = ({ user = [] }: IProps) => {
|
const UserCardBox: FunctionComponent<IProps> = ({ user = {} }: IProps) => {
|
||||||
let cssClass = 'card squareCard scalableCard squareCard-scalable';
|
let cssClass = 'card squareCard scalableCard squareCard-scalable';
|
||||||
|
|
||||||
if (user.Policy.IsDisabled) {
|
if (user.Policy?.IsDisabled) {
|
||||||
cssClass += ' grayscale';
|
cssClass += ' grayscale';
|
||||||
}
|
}
|
||||||
|
|
||||||
let imgUrl;
|
let imgUrl;
|
||||||
|
|
||||||
if (user.PrimaryImageTag) {
|
if (user.PrimaryImageTag && user.Id) {
|
||||||
imgUrl = window.ApiClient.getUserImageUrl(user.Id, {
|
imgUrl = window.ApiClient.getUserImageUrl(user.Id, {
|
||||||
width: 300,
|
width: 300,
|
||||||
tag: user.PrimaryImageTag,
|
tag: user.PrimaryImageTag,
|
||||||
@ -56,7 +56,7 @@ const UserCardBox: FunctionComponent<IProps> = ({ user = [] }: IProps) => {
|
|||||||
|
|
||||||
let imageClass = 'cardImage';
|
let imageClass = 'cardImage';
|
||||||
|
|
||||||
if (user.Policy.IsDisabled) {
|
if (user.Policy?.IsDisabled) {
|
||||||
imageClass += ' disabledUser';
|
imageClass += ' disabledUser';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,10 +16,31 @@ const createScroller = ({ title = '' }) => ({
|
|||||||
</div>`
|
</div>`
|
||||||
});
|
});
|
||||||
|
|
||||||
|
type CardOptions = {
|
||||||
|
itemsContainer?: HTMLElement,
|
||||||
|
parentContainer?: HTMLElement,
|
||||||
|
allowBottomPadding?: boolean,
|
||||||
|
centerText?: boolean,
|
||||||
|
coverImage?: boolean,
|
||||||
|
inheritThumb?: boolean,
|
||||||
|
overlayMoreButton?: boolean,
|
||||||
|
overlayText?: boolean,
|
||||||
|
preferThumb?: boolean,
|
||||||
|
scalable?: boolean,
|
||||||
|
shape?: string,
|
||||||
|
showParentTitle?: boolean,
|
||||||
|
showParentTitleOrTitle?: boolean,
|
||||||
|
showAirTime?: boolean,
|
||||||
|
showAirDateTime?: boolean,
|
||||||
|
showChannelName?: boolean,
|
||||||
|
showTitle?: boolean,
|
||||||
|
showYear?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
type SearchResultsRowProps = {
|
type SearchResultsRowProps = {
|
||||||
title?: string;
|
title?: string;
|
||||||
items?: BaseItemDto[];
|
items?: BaseItemDto[];
|
||||||
cardOptions?: Record<string, any>;
|
cardOptions?: CardOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SearchResultsRow: FunctionComponent<SearchResultsRowProps> = ({ title, items = [], cardOptions = {} }: SearchResultsRowProps) => {
|
const SearchResultsRow: FunctionComponent<SearchResultsRowProps> = ({ title, items = [], cardOptions = {} }: SearchResultsRowProps) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user