diff options
Diffstat (limited to 'src/screens')
| -rw-r--r-- | src/screens/profile/CategorySelection.tsx | 1 | ||||
| -rw-r--r-- | src/screens/profile/ChoosingCategoryScreen.tsx | 4 | ||||
| -rw-r--r-- | src/screens/profile/CreateCustomCategory.tsx | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/screens/profile/CategorySelection.tsx b/src/screens/profile/CategorySelection.tsx index ea443fce..9b8672ea 100644 --- a/src/screens/profile/CategorySelection.tsx +++ b/src/screens/profile/CategorySelection.tsx @@ -170,6 +170,7 @@ const CategorySelection: React.FC<CategorySelectionProps> = ({ onPress={() => { navigation.push('CreateCustomCategory', { existingCategories: momentCategories.concat(selectedCategories), + fromScreen: 'CategorySelection', }); }}> <PlusIcon width={30} height={30} color="white" /> diff --git a/src/screens/profile/ChoosingCategoryScreen.tsx b/src/screens/profile/ChoosingCategoryScreen.tsx index daf7642d..24db015e 100644 --- a/src/screens/profile/ChoosingCategoryScreen.tsx +++ b/src/screens/profile/ChoosingCategoryScreen.tsx @@ -43,7 +43,7 @@ const ChoosingCategoryScreen: React.FC<ChoosingCategoryScreenProps> = ({ const tabBarHeight = useBottomTabBarHeight(); const insetTop = useSafeAreaInsets().top; - const MomentItem: FC<{ + const ListItem: FC<{ title: string; onPress: () => void; }> = ({title, onPress}) => { @@ -80,7 +80,7 @@ const ChoosingCategoryScreen: React.FC<ChoosingCategoryScreenProps> = ({ style={{height: SCREEN_HEIGHT * 0.9}} contentContainerStyle={{paddingBottom: tabBarHeight}}> {momentCategories.map((title) => ( - <MomentItem + <ListItem key={title} title={title} onPress={() => diff --git a/src/screens/profile/CreateCustomCategory.tsx b/src/screens/profile/CreateCustomCategory.tsx index c4b17b1e..91083c7c 100644 --- a/src/screens/profile/CreateCustomCategory.tsx +++ b/src/screens/profile/CreateCustomCategory.tsx @@ -37,14 +37,14 @@ const CreateCustomCategory: React.FC<CreateCustomCategoryProps> = ({ /** * Same component to be used for category selection while onboarding and while on profile */ - const {existingCategories} = route.params; + const {existingCategories, fromScreen} = route.params; const [newCategory, setNewCategory] = useState(''); const handleButtonPress = () => { if (existingCategories.includes(newCategory)) { Alert.alert('Looks like you already have that one created!'); } else { - navigation.navigate('CategorySelection', { + navigation.navigate(fromScreen, { newCustomCategory: newCategory, }); } |
