Skip to content

Commit

Permalink
revert: revert hasTVPreferredFocus for first swimlane
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterds committed Jul 5, 2023
1 parent f915096 commit 19a2553
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/components/Swimlane/TrendingToday/Item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import styles from './styles';
interface Props {
type: 'movie' | 'show' | null;
id: number | null;
hasTVPreferredFocus?: boolean;
}

const TrendingTodayItem = ({ id, type }: Props) => {
const TrendingTodayItem = ({ id, type, hasTVPreferredFocus }: Props) => {
const { navigate } = useNavigation<NavigationProp<RouteParams>>();
const show = useShow(type === 'show' ? id : null);
const movie = useMovie(type === 'movie' ? id : null);
Expand All @@ -28,6 +29,7 @@ const TrendingTodayItem = ({ id, type }: Props) => {
return (
<Touchable
style={styles.container}
hasTVPreferredFocus={hasTVPreferredFocus}
onPress={() =>
navigate(Route.TrendingToday, {
id: item.id,
Expand Down
11 changes: 9 additions & 2 deletions src/components/Swimlane/TrendingToday/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import styles from './styles';

interface Props {
hideTitle?: boolean;
hasTVPreferredFocus?: boolean;
}

const TrendingTodaySwimlane = ({ hideTitle }: Props) => {
const TrendingTodaySwimlane = ({ hideTitle, hasTVPreferredFocus }: Props) => {
const { data, isLoading, isEmpty, hasError } = useTrendingToday({
fetch: true,
});
Expand Down Expand Up @@ -39,7 +40,13 @@ const TrendingTodaySwimlane = ({ hideTitle }: Props) => {
item ? `${item?.type}:${item?.id}` : `index-${index}`
}`
}
renderItem={({ item }) => <Item id={item?.id} type={item?.type} />}
renderItem={({ item, index }) => (
<Item
id={item?.id}
type={item?.type}
hasTVPreferredFocus={hasTVPreferredFocus && index === 0}
/>
)}
/>
</TVFocusGuideView>
</View>
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Discover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const DiscoverScreen = () => {

return (
<ScreenWrapper contentStyle={styles.container}>
<Swimlane.TrendingToday />
<Swimlane.TrendingToday hasTVPreferredFocus />
<Swimlane.PopularMovies />
<Banner.UpcomingMovies />
<Swimlane.TopRatedTVShows />
Expand Down

0 comments on commit 19a2553

Please sign in to comment.