mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-05-31 11:08:26 +01:00
feat: KSPlayer as an option for iOS + other improvements (#1266)
This commit is contained in:
committed by
GitHub
parent
d1795c9df8
commit
74d86b5d12
42
components/common/SectionHeader.tsx
Normal file
42
components/common/SectionHeader.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
import { TouchableOpacity, View } from "react-native";
|
||||
import { Colors } from "@/constants/Colors";
|
||||
import { Text } from "./Text";
|
||||
|
||||
type Props = {
|
||||
title: string;
|
||||
actionLabel?: string;
|
||||
actionDisabled?: boolean;
|
||||
onPressAction?: () => void;
|
||||
};
|
||||
|
||||
export const SectionHeader: React.FC<Props> = ({
|
||||
title,
|
||||
actionLabel,
|
||||
actionDisabled = false,
|
||||
onPressAction,
|
||||
}) => {
|
||||
const shouldShowAction = Boolean(actionLabel) && Boolean(onPressAction);
|
||||
|
||||
return (
|
||||
<View className='px-4 flex flex-row items-center justify-between mb-2'>
|
||||
<Text className='text-lg font-bold text-neutral-100'>{title}</Text>
|
||||
{shouldShowAction && (
|
||||
<TouchableOpacity
|
||||
onPress={onPressAction}
|
||||
disabled={actionDisabled}
|
||||
accessibilityRole='button'
|
||||
accessibilityLabel={actionLabel}
|
||||
className='py-1 pl-3'
|
||||
>
|
||||
<Text
|
||||
style={{
|
||||
color: actionDisabled ? "rgba(255,255,255,0.4)" : Colors.primary,
|
||||
}}
|
||||
>
|
||||
{actionLabel}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user