Refactor components to use StyledButton for consistent button styling

- Replaced custom button implementations with StyledButton in various components including DetailScreen, HomeScreen, SearchScreen, and SettingsModal.
- Updated button styles and behaviors to align with the new StyledButton component.
- Removed the obsolete DetailButton component to streamline the codebase.
This commit is contained in:
zimplexing
2025-07-08 17:24:55 +08:00
parent 9f721c22d5
commit 504f12067b
11 changed files with 395 additions and 366 deletions

View File

@@ -1,16 +1,14 @@
import React from "react";
import { View, StyleSheet, TouchableOpacity } from "react-native";
import { View, StyleSheet } from "react-native";
import { ThemedText } from "@/components/ThemedText";
import { StyledButton } from "./StyledButton";
interface NextEpisodeOverlayProps {
visible: boolean;
onCancel: () => void;
}
export const NextEpisodeOverlay: React.FC<NextEpisodeOverlayProps> = ({
visible,
onCancel,
}) => {
export const NextEpisodeOverlay: React.FC<NextEpisodeOverlayProps> = ({ visible, onCancel }) => {
if (!visible) {
return null;
}
@@ -18,12 +16,13 @@ export const NextEpisodeOverlay: React.FC<NextEpisodeOverlayProps> = ({
return (
<View style={styles.nextEpisodeOverlay}>
<View style={styles.nextEpisodeContent}>
<ThemedText style={styles.nextEpisodeTitle}>
...
</ThemedText>
<TouchableOpacity style={styles.nextEpisodeButton} onPress={onCancel}>
<ThemedText style={styles.nextEpisodeButtonText}></ThemedText>
</TouchableOpacity>
<ThemedText style={styles.nextEpisodeTitle}>...</ThemedText>
<StyledButton
text="取消"
onPress={onCancel}
style={styles.nextEpisodeButton}
textStyle={styles.nextEpisodeButtonText}
/>
</View>
</View>
);
@@ -48,10 +47,8 @@ const styles = StyleSheet.create({
marginBottom: 10,
},
nextEpisodeButton: {
backgroundColor: "#333",
padding: 8,
paddingHorizontal: 15,
borderRadius: 5,
},
nextEpisodeButtonText: {
fontSize: 14,