mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-04 04:58:30 +01:00
fix: remove scrollbar + improve component props
This commit is contained in:
@@ -1,7 +1,13 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { ScrollView, View, ViewStyle, ActivityIndicator } from "react-native";
|
import {
|
||||||
|
ScrollView,
|
||||||
|
View,
|
||||||
|
ViewStyle,
|
||||||
|
ActivityIndicator,
|
||||||
|
ScrollViewProps,
|
||||||
|
} from "react-native";
|
||||||
|
|
||||||
interface HorizontalScrollProps<T> {
|
interface HorizontalScrollProps<T> extends ScrollViewProps {
|
||||||
data?: T[] | null;
|
data?: T[] | null;
|
||||||
renderItem: (item: T, index: number) => React.ReactNode;
|
renderItem: (item: T, index: number) => React.ReactNode;
|
||||||
containerStyle?: ViewStyle;
|
containerStyle?: ViewStyle;
|
||||||
@@ -15,6 +21,7 @@ export function HorizontalScroll<T>({
|
|||||||
containerStyle,
|
containerStyle,
|
||||||
contentContainerStyle,
|
contentContainerStyle,
|
||||||
loadingContainerStyle,
|
loadingContainerStyle,
|
||||||
|
...props
|
||||||
}: HorizontalScrollProps<T>): React.ReactElement {
|
}: HorizontalScrollProps<T>): React.ReactElement {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return (
|
return (
|
||||||
@@ -34,6 +41,8 @@ export function HorizontalScroll<T>({
|
|||||||
horizontal
|
horizontal
|
||||||
style={containerStyle}
|
style={containerStyle}
|
||||||
contentContainerStyle={contentContainerStyle}
|
contentContainerStyle={contentContainerStyle}
|
||||||
|
showsHorizontalScrollIndicator={false}
|
||||||
|
{...props}
|
||||||
>
|
>
|
||||||
<View className="flex flex-row px-4">
|
<View className="flex flex-row px-4">
|
||||||
{data.map((item, index) => (
|
{data.map((item, index) => (
|
||||||
|
|||||||
Reference in New Issue
Block a user