aboutsummaryrefslogtreecommitdiff
path: root/src/screens
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-07-07 15:24:41 -0400
committerIvan Chen <ivan@tagg.id>2021-07-09 15:56:35 -0400
commit933b27e8d1f03b9d07f99b9662503e68f6a6ac91 (patch)
treee5d9a8400ea22031de898ac63b18f0b40c3a7bd2 /src/screens
parentf39a320fd9e07750c8fcf7cc1882f21324a0ce58 (diff)
Add logic to display current selected category
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/profile/CaptionScreen.tsx54
-rw-r--r--src/screens/profile/ChoosingCategoryScreen.tsx9
2 files changed, 41 insertions, 22 deletions
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<CaptionScreenProps> = ({route, navigation}) => {
};
const SelectableItem: FC<{
- text: string;
+ text: 'Tag Friends' | 'Category';
imageUri: ImageSourcePropType;
onPress: () => void;
- }> = ({text, imageUri, onPress}) => (
- <TouchableOpacity onPress={onPress} style={styles.tagFriendsContainer}>
- <View style={styles.row}>
- <Image style={styles.tagIcon} source={imageUri} />
- <Text style={styles.tagFriendsTitle}>{text}</Text>
- </View>
- <View style={styles.row}>
- <Text style={styles.taggedUsersText}>{taggedUsersText}</Text>
- <FrontArrow
- width={normalize(13)}
- height={normalize(13)}
- color={'white'}
- />
- </View>
- </TouchableOpacity>
- );
+ }> = ({text, imageUri, onPress}) => {
+ return (
+ <TouchableOpacity onPress={onPress} style={styles.tagFriendsContainer}>
+ <View style={styles.row}>
+ {text === 'Category' && !momentCategory && (
+ <Text style={styles.asteriskText}>* </Text>
+ )}
+ <Image style={styles.tagIcon} source={imageUri} />
+ <Text style={styles.tagFriendsTitle}>{text}</Text>
+ </View>
+ <View style={styles.row}>
+ {text === 'Tag Friends' && (
+ <Text style={styles.itemInfoText}>{taggedUsersText}</Text>
+ )}
+ {text === 'Category' && (
+ <Text style={styles.itemInfoText}>{momentCategory}</Text>
+ )}
+ <FrontArrow
+ width={normalize(13)}
+ height={normalize(13)}
+ color={'white'}
+ />
+ </View>
+ </TouchableOpacity>
+ );
+ };
return (
<SearchBackground>
@@ -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<ChoosingCategoryScreenProps> = ({
title: string;
}> = ({title}) => (
<TouchableOpacity
- onPress={async () => {
- await AsyncStorage.setItem('selectedMomentCategory', title);
- navigation.goBack();
- }}>
+ onPress={async () =>
+ navigation.navigate('CaptionScreen', {
+ selectedCategory: 'Food',
+ })
+ }>
<Text style={{height: 100, backgroundColor: 'green'}}>foo</Text>
</TouchableOpacity>
);