From 933b27e8d1f03b9d07f99b9662503e68f6a6ac91 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Wed, 7 Jul 2021 15:24:41 -0400 Subject: Add logic to display current selected category --- src/screens/profile/CaptionScreen.tsx | 54 +++++++++++++++++--------- src/screens/profile/ChoosingCategoryScreen.tsx | 9 +++-- 2 files changed, 41 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx index ad301ded..a8664d85 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -219,25 +219,35 @@ const CaptionScreen: React.FC = ({route, navigation}) => { }; const SelectableItem: FC<{ - text: string; + text: 'Tag Friends' | 'Category'; imageUri: ImageSourcePropType; onPress: () => void; - }> = ({text, imageUri, onPress}) => ( - - - - {text} - - - {taggedUsersText} - - - - ); + }> = ({text, imageUri, onPress}) => { + return ( + + + {text === 'Category' && !momentCategory && ( + * + )} + + {text} + + + {text === 'Tag Friends' && ( + {taggedUsersText} + )} + {text === 'Category' && ( + {momentCategory} + )} + + + + ); + }; return ( @@ -363,13 +373,21 @@ const styles = StyleSheet.create({ alignItems: 'center', marginBottom: normalize(20), }, - taggedUsersText: { + asteriskText: { + color: TAGG_LIGHT_BLUE_2, + fontWeight: 'bold', + fontSize: normalize(15), + height: 15, + alignSelf: 'center', + }, + itemInfoText: { color: 'white', width: 150, fontSize: normalize(10), lineHeight: normalize(11), letterSpacing: normalize(0.3), textAlign: 'right', + marginRight: 5, }, tagIcon: { diff --git a/src/screens/profile/ChoosingCategoryScreen.tsx b/src/screens/profile/ChoosingCategoryScreen.tsx index 285732e7..dd3bc1bb 100644 --- a/src/screens/profile/ChoosingCategoryScreen.tsx +++ b/src/screens/profile/ChoosingCategoryScreen.tsx @@ -33,10 +33,11 @@ const ChoosingCategoryScreen: React.FC = ({ title: string; }> = ({title}) => ( { - await AsyncStorage.setItem('selectedMomentCategory', title); - navigation.goBack(); - }}> + onPress={async () => + navigation.navigate('CaptionScreen', { + selectedCategory: 'Food', + }) + }> foo ); -- cgit v1.2.3-70-g09d2