aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorankit-thanekar007 <ankit.thanekar007@gmail.com>2021-03-15 13:41:33 -0700
committerankit-thanekar007 <ankit.thanekar007@gmail.com>2021-03-15 13:41:33 -0700
commit6962e44c64d96ccb3bd47a659bfb38c14c765132 (patch)
treebb0ee38f8e02ecb9e2c087608d86f23b99728db5 /src
parentc8c6a803491dfe697d3af6d753be4c321209fed0 (diff)
TMA 643 Added Hide Image
Diffstat (limited to 'src')
-rw-r--r--src/assets/images/hide-caret.pngbin0 -> 285 bytes
-rw-r--r--src/assets/images/hide-caret@2x.pngbin0 -> 441 bytes
-rw-r--r--src/assets/images/hide-caret@3x.pngbin0 -> 603 bytes
-rw-r--r--src/screens/main/NotificationsScreen.tsx47
4 files changed, 27 insertions, 20 deletions
diff --git a/src/assets/images/hide-caret.png b/src/assets/images/hide-caret.png
new file mode 100644
index 00000000..bb05b53a
--- /dev/null
+++ b/src/assets/images/hide-caret.png
Binary files differ
diff --git a/src/assets/images/hide-caret@2x.png b/src/assets/images/hide-caret@2x.png
new file mode 100644
index 00000000..3f4689d3
--- /dev/null
+++ b/src/assets/images/hide-caret@2x.png
Binary files differ
diff --git a/src/assets/images/hide-caret@3x.png b/src/assets/images/hide-caret@3x.png
new file mode 100644
index 00000000..a44c36fe
--- /dev/null
+++ b/src/assets/images/hide-caret@3x.png
Binary files differ
diff --git a/src/screens/main/NotificationsScreen.tsx b/src/screens/main/NotificationsScreen.tsx
index 24be7123..675d415d 100644
--- a/src/screens/main/NotificationsScreen.tsx
+++ b/src/screens/main/NotificationsScreen.tsx
@@ -192,7 +192,6 @@ const NotificationsScreen: React.FC = () => {
styles.sectionFont,
styles.sectionHeader,
styles.sectionLocation,
- styles.sectionHeader,
]}>
{title}
</Text>
@@ -213,34 +212,39 @@ const NotificationsScreen: React.FC = () => {
setrequestLimit(DEFAULT_NOTIFICATIONS_SIZE);
setMoreFooterEnabled(false);
}}>
+ <View
+ style={[styles.sectionLocation, styles.hiddenSectionContainer]}>
+ <Image
+ style={styles.hideImageStyles}
+ source={require('../../assets/images/hide-caret.png')}
+ />
+ <Text style={[styles.sectionFont, styles.sectionFooter]}>
+ {'Hide'}
+ </Text>
+ </View>
+ </TouchableOpacity>
+ );
+ }
+
+ if (allFriendRequests.length > DEFAULT_NOTIFICATIONS_SIZE) {
+ return (
+ <TouchableOpacity
+ style={styles.sectionHeaderContainer}
+ onPress={() => {
+ setrequestLimit(allFriendRequests.length);
+ setMoreFooterEnabled(true);
+ }}>
<Text
style={[
styles.sectionFont,
styles.sectionFooter,
styles.sectionLocation,
]}>
- {'Hide'}
+ {`+ ${allFriendRequests.length - requestLimit} More`}
</Text>
</TouchableOpacity>
);
}
- return (
- <TouchableOpacity
- style={styles.sectionHeaderContainer}
- onPress={() => {
- setrequestLimit(allFriendRequests.length);
- setMoreFooterEnabled(true);
- }}>
- <Text
- style={[
- styles.sectionFont,
- styles.sectionFooter,
- styles.sectionLocation,
- ]}>
- {`+ ${allFriendRequests.length - requestLimit} More`}
- </Text>
- </TouchableOpacity>
- );
}
return null;
@@ -338,7 +342,10 @@ const styles = StyleSheet.create({
fontSize: normalize(12),
lineHeight: normalize(14),
},
-
+ hiddenSectionContainer: {
+ flexDirection: 'row',
+ },
+ hideImageStyles: {alignSelf: 'center', marginRight: 8},
sectionHeader: {
color: '#828282',
},