Skip to content

Commit caa00ba

Browse files
committed
refactor: make nav example for v3 only
1 parent 0987010 commit caa00ba

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

example/src/ExampleList.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,23 @@ const data = Object.keys(mainExamples).map(
127127
);
128128

129129
export default function ExampleList({ navigation }: Props) {
130-
const renderItem = ({ item }: { item: Item }) => (
131-
<List.Item
132-
title={item.data.title}
133-
onPress={() => navigation.navigate(item.id)}
134-
/>
135-
);
136-
137130
const keyExtractor = (item: { id: string }) => item.id;
138131

139-
const { colors } = useExampleTheme();
132+
const { colors, isV3 } = useExampleTheme();
140133
const safeArea = useSafeAreaInsets();
141134

135+
const renderItem = ({ item }: { item: Item }) => {
136+
const { data, id } = item;
137+
138+
if (!isV3 && data.title === mainExamples.themingWithReactNavigation.title) {
139+
return null;
140+
}
141+
142+
return (
143+
<List.Item title={data.title} onPress={() => navigation.navigate(id)} />
144+
);
145+
};
146+
142147
return (
143148
<FlatList
144149
contentContainerStyle={{

0 commit comments

Comments
 (0)