diff --git a/src/screens/ExercisesScreens.tsx b/src/screens/ExercisesScreens.tsx index e6bbd4928..8fb14da34 100644 --- a/src/screens/ExercisesScreens.tsx +++ b/src/screens/ExercisesScreens.tsx @@ -2,7 +2,7 @@ import React, { useState } from 'react' import { View, Text, LogBox, TouchableOpacity, FlatList, Pressable, StyleSheet } from 'react-native' import { Home, Arrow, BackButton, BackArrowPressed, HomeButtonPressed } from '../../assets/images' import Title from '../components/Title' -import { EXERCISES, ExerciseType } from '../constants/data' +import { ExerciseKeys, EXERCISES, ExerciseType } from '../constants/data' import { RouteProp, useFocusEffect } from '@react-navigation/native' import { COLORS } from '../constants/colors' import { widthPercentageToDP as wp } from 'react-native-responsive-screen' @@ -162,7 +162,10 @@ const ExercisesScreen = ({ route, navigation }: ExercisesScreenPropsType): JSX.E ) - const Item = ({ item }: { item: ExerciseType }): JSX.Element => { + const Item = ({ item }: { item: ExerciseType }): JSX.Element | null => { + if (item.key === ExerciseKeys.learnArticles || item.key === ExerciseKeys.singleChoice) { + return null + } const selected = item.key.toString() === selectedKey const itemStyle = selected ? styles.clickedContainer : styles.container const itemTitleStyle = selected ? styles.clickedItemTitle : styles.title2 diff --git a/src/screens/ProfessionScreen.tsx b/src/screens/ProfessionScreen.tsx index 83365df9d..c3e3c277d 100644 --- a/src/screens/ProfessionScreen.tsx +++ b/src/screens/ProfessionScreen.tsx @@ -83,9 +83,13 @@ const ProfessionScreen = ({ navigation }: ProfessionScreenPropsType): JSX.Elemen ) - const Item = ({ item }: { item: ProfessionType }): JSX.Element => { + const Item = ({ item }: { item: ProfessionType }): JSX.Element | null => { const itemTextStyle = item.id === selectedId ? styles.clickedItemDescription : styles.description + if (item.total_training_sets === 0) { + return null + } + return ( ) - const Item = ({ item }: { item: ProfessionSubcategoryType }): JSX.Element => { + const Item = ({ item }: { item: ProfessionSubcategoryType }): JSX.Element | null => { + if (item.total_documents === 0) { + return null + } const selected = item.id === selectedId const descriptionStyle = selected ? styles.clickedItemDescription : styles.description