mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Set minimum height of horizontal items
This commit is contained in:
parent
dab297413f
commit
cdccc9bc8b
@ -21,7 +21,16 @@
|
||||
import { Page, QueryIdentifier, useInfiniteFetch } from "@kyoo/models";
|
||||
import { useBreakpointMap, HR } from "@kyoo/primitives";
|
||||
import { ContentStyle, FlashList } from "@shopify/flash-list";
|
||||
import { ComponentProps, ComponentType, isValidElement, ReactElement, useRef } from "react";
|
||||
import {
|
||||
ComponentProps,
|
||||
ComponentType,
|
||||
isValidElement,
|
||||
ReactElement,
|
||||
useCallback,
|
||||
useReducer,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import { EmptyView, ErrorView, Layout, WithLoading, addHeader } from "./fetch";
|
||||
import { FlatList, View, ViewStyle } from "react-native";
|
||||
|
||||
@ -122,6 +131,7 @@ export const InfiniteFetchList = <Data, Props, _, Kind>({
|
||||
layout.layout === "horizontal" && {
|
||||
width:
|
||||
size * (getItemType && getItemSize ? getItemSize(getItemType(item, index)) : 1),
|
||||
height: size * 2,
|
||||
},
|
||||
]}
|
||||
>
|
||||
|
@ -150,6 +150,7 @@ export const InfiniteFetchList = <Data, _, HeaderProps, Kind>({
|
||||
Header,
|
||||
headerProps,
|
||||
getItemType,
|
||||
nested,
|
||||
...props
|
||||
}: {
|
||||
query: ReturnType<typeof useInfiniteFetch<_, Data>>;
|
||||
@ -165,9 +166,10 @@ export const InfiniteFetchList = <Data, _, HeaderProps, Kind>({
|
||||
Header?: ComponentType<{ children: JSX.Element } & HeaderProps> | ReactElement;
|
||||
headerProps: HeaderProps;
|
||||
getItemType?: (item: WithLoading<Data>, index: number) => Kind;
|
||||
getItemSize?: (kind: Kind) => number
|
||||
getItemSize?: (kind: Kind) => number;
|
||||
fetchMore?: boolean;
|
||||
contentContainerStyle?: ContentStyle;
|
||||
nested?: boolean;
|
||||
}): JSX.Element | null => {
|
||||
const oldItems = useRef<Data[] | undefined>();
|
||||
const { items, error, fetchNextPage, hasNextPage, isFetching } = query;
|
||||
|
Loading…
x
Reference in New Issue
Block a user