mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-07-19 02:34:17 +01:00
Refactored code, so that way the skip intro button is not using absolute positioning
This commit is contained in:
39
components/video-player/controls/SkipButton.tsx
Normal file
39
components/video-player/controls/SkipButton.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
import React from "react";
|
||||
import { View, TouchableOpacity, Text, StyleSheet } from "react-native";
|
||||
|
||||
interface SkipButtonProps {
|
||||
onPress: () => void;
|
||||
showButton: boolean;
|
||||
buttonText: string;
|
||||
}
|
||||
|
||||
const SkipButton: React.FC<SkipButtonProps> = ({
|
||||
onPress,
|
||||
showButton,
|
||||
buttonText,
|
||||
}) => {
|
||||
return (
|
||||
<View style={{ display: showButton ? "flex" : "none" }}>
|
||||
<TouchableOpacity onPress={onPress} style={styles.button}>
|
||||
<Text style={styles.text}>{buttonText}</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
button: {
|
||||
backgroundColor: "rgba(0, 0, 0, 0.75)",
|
||||
borderRadius: 5,
|
||||
paddingHorizontal: 10,
|
||||
paddingVertical: 15,
|
||||
borderWidth: 2,
|
||||
borderColor: "#5A5454",
|
||||
},
|
||||
text: {
|
||||
color: "white",
|
||||
fontWeight: "bold",
|
||||
},
|
||||
});
|
||||
|
||||
export default SkipButton;
|
||||
Reference in New Issue
Block a user