Add toast notifications for intro and outro time settings, update player store and media button for new time tracking

This commit is contained in:
zimplexing
2025-07-08 22:07:14 +08:00
parent 5043b33222
commit 30724a1e19
10 changed files with 135 additions and 32 deletions

View File

@@ -1,11 +1,16 @@
import React, { ComponentProps } from "react";
import { StyledButton } from "./StyledButton";
import { StyleSheet } from "react-native";
import { StyleSheet, View, Text } from "react-native";
type StyledButtonProps = ComponentProps<typeof StyledButton>;
type StyledButtonProps = ComponentProps<typeof StyledButton> & {
timeLabel?: string;
};
export const MediaButton = (props: StyledButtonProps) => (
<StyledButton {...props} style={[styles.mediaControlButton, props.style]} variant="ghost" />
export const MediaButton = ({ timeLabel, ...props }: StyledButtonProps) => (
<View>
<StyledButton {...props} style={[styles.mediaControlButton, props.style]} variant="ghost" />
{timeLabel && <Text style={styles.timeLabel}>{timeLabel}</Text>}
</View>
);
const styles = StyleSheet.create({
@@ -13,4 +18,15 @@ const styles = StyleSheet.create({
padding: 12,
minWidth: 80,
},
timeLabel: {
position: "absolute",
top: 14,
right: 12,
color: "white",
fontSize: 10,
fontWeight: "bold",
backgroundColor: "rgba(0,0,0,0.6)",
paddingHorizontal: 4,
borderRadius: 3,
},
});