mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-04-21 00:32:04 +00:00
ShowRatingScreen page singular Season logic and heading chopped off fix.
logic for 1 Seasons to 1 Season modified. Heading for grid chopped off because Episodes is too long word changes to EPs for batter UI experience. Fixes #159
This commit is contained in:
parent
63a7051b86
commit
c4af2e8eea
1 changed files with 46 additions and 20 deletions
|
|
@ -165,27 +165,53 @@ const RatingSourceToggle = memo(({ ratingSource, setRatingSource, theme }: {
|
||||||
</View>
|
</View>
|
||||||
));
|
));
|
||||||
|
|
||||||
const ShowInfo = memo(({ show, theme }: { show: Show | null, theme: any }) => (
|
const ShowInfo = memo(({ show, theme }: { show: Show | null, theme: any }) => {
|
||||||
<View style={styles.showInfo}>
|
// singular / plural logic
|
||||||
<FastImage
|
const seasonLabel =
|
||||||
source={{ uri: `https://image.tmdb.org/t/p/w500${show?.poster_path}` }}
|
show?.number_of_seasons === 1
|
||||||
style={styles.poster}
|
? "Season"
|
||||||
resizeMode={FastImage.resizeMode.cover}
|
: "Seasons";
|
||||||
/>
|
|
||||||
<View style={styles.showDetails}>
|
const episodeLabel =
|
||||||
<Text style={[styles.showTitle, { color: theme.colors.white }]}>{show?.name}</Text>
|
show?.number_of_episodes === 1
|
||||||
<Text style={[styles.showYear, { color: theme.colors.lightGray }]}>
|
? "Episode"
|
||||||
{show?.first_air_date ? `${new Date(show.first_air_date).getFullYear()} - ${show.last_air_date ? new Date(show.last_air_date).getFullYear() : 'Present'}` : ''}
|
: "Episodes";
|
||||||
</Text>
|
|
||||||
<View style={styles.episodeCountContainer}>
|
return (
|
||||||
<MaterialIcons name="tv" size={16} color={theme.colors.primary} />
|
<View style={styles.showInfo}>
|
||||||
<Text style={[styles.episodeCount, { color: theme.colors.lightGray }]}>
|
<FastImage
|
||||||
{show?.number_of_seasons} Seasons • {show?.number_of_episodes} Episodes
|
source={{ uri: `https://image.tmdb.org/t/p/w500${show?.poster_path}` }}
|
||||||
|
style={styles.poster}
|
||||||
|
resizeMode={FastImage.resizeMode.cover}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<View style={styles.showDetails}>
|
||||||
|
<Text style={[styles.showTitle, { color: theme.colors.white }]}>
|
||||||
|
{show?.name}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
|
<Text style={[styles.showYear, { color: theme.colors.lightGray }]}>
|
||||||
|
{show?.first_air_date
|
||||||
|
? `${new Date(show.first_air_date).getFullYear()} - ${
|
||||||
|
show.last_air_date
|
||||||
|
? new Date(show.last_air_date).getFullYear()
|
||||||
|
: "Present"
|
||||||
|
}`
|
||||||
|
: ""}
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<View style={styles.episodeCountContainer}>
|
||||||
|
<MaterialIcons name="tv" size={16} color={theme.colors.primary} />
|
||||||
|
|
||||||
|
<Text style={[styles.episodeCount, { color: theme.colors.lightGray }]}>
|
||||||
|
{show?.number_of_seasons} {seasonLabel} •{" "}
|
||||||
|
{show?.number_of_episodes} {episodeLabel}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
);
|
||||||
));
|
});
|
||||||
|
|
||||||
const ShowRatingsScreen = ({ route }: Props) => {
|
const ShowRatingsScreen = ({ route }: Props) => {
|
||||||
const { currentTheme } = useTheme();
|
const { currentTheme } = useTheme();
|
||||||
|
|
@ -455,7 +481,7 @@ const ShowRatingsScreen = ({ route }: Props) => {
|
||||||
{/* Fixed Episode Column */}
|
{/* Fixed Episode Column */}
|
||||||
<View style={[styles.fixedColumn, { borderRightColor: colors.black + '40' }]}>
|
<View style={[styles.fixedColumn, { borderRightColor: colors.black + '40' }]}>
|
||||||
<View style={styles.episodeColumn}>
|
<View style={styles.episodeColumn}>
|
||||||
<Text style={[styles.headerText, { color: colors.white }]}>Episode</Text>
|
<Text style={[styles.headerText, { color: colors.white }]}>EPs</Text>
|
||||||
</View>
|
</View>
|
||||||
{Array.from({ length: Math.max(...seasons.map(s => s.episodes.length)) }).map((_, episodeIndex) => (
|
{Array.from({ length: Math.max(...seasons.map(s => s.episodes.length)) }).map((_, episodeIndex) => (
|
||||||
<View key={`e${episodeIndex + 1}`} style={styles.episodeCell}>
|
<View key={`e${episodeIndex + 1}`} style={styles.episodeCell}>
|
||||||
|
|
@ -799,4 +825,4 @@ const styles = StyleSheet.create({
|
||||||
|
|
||||||
export default memo(ShowRatingsScreen, (prevProps, nextProps) => {
|
export default memo(ShowRatingsScreen, (prevProps, nextProps) => {
|
||||||
return prevProps.route.params.showId === nextProps.route.params.showId;
|
return prevProps.route.params.showId === nextProps.route.params.showId;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue