From ab3455b8836d4d37752946d743c4e2a13b9a47a8 Mon Sep 17 00:00:00 2001 From: ankit-thanekar007 Date: Mon, 15 Mar 2021 11:32:21 -0700 Subject: TMA 643 Footer added --- src/screens/main/NotificationsScreen.tsx | 50 ++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/screens/main/NotificationsScreen.tsx b/src/screens/main/NotificationsScreen.tsx index c92abdbd..568c8c73 100644 --- a/src/screens/main/NotificationsScreen.tsx +++ b/src/screens/main/NotificationsScreen.tsx @@ -53,6 +53,10 @@ const NotificationsScreen: React.FC = () => { data: NotificationType[]; }[] >([]); + + const [moreFooterEnabled, setMoreFooterEnabled] = useState(false); + const [requestLimit, setrequestLimit] = useState(4); + const dispatch = useDispatch(); const refreshNotifications = () => { @@ -143,6 +147,7 @@ const NotificationsScreen: React.FC = () => { } } } + setSectionedNotifications( todays.length === 0 && yesterdays.length === 0 && @@ -169,10 +174,38 @@ const NotificationsScreen: React.FC = () => { const renderSectionHeader = ({section: {title, data}}) => data.length !== 0 && ( - {title} + + {title} + ); + const renderSectionFooter = ({section: {title, data}}) => { + if (title === 'Friend Request' && data.length < requestLimit) { + return ( + + + {title} + + + ); + } + + return null; + }; + const SPPromptNotification: ReactElement = showSPNotifyPopUp ? ( { index.toString()} + keyExtractor={(_item, index) => index.toString()} renderItem={renderNotification} renderSectionHeader={renderSectionHeader} + renderSectionFooter={renderSectionFooter} ListHeaderComponent={SPPromptNotification} refreshControl={ @@ -251,15 +285,25 @@ const styles = StyleSheet.create({ width: '100%', backgroundColor: 'white', }, - sectionHeader: { + + sectionLocation: { marginLeft: '8%', marginTop: '5%', marginBottom: '2%', + }, + + sectionFont: { fontWeight: '600', fontSize: normalize(12), lineHeight: normalize(14), + }, + + sectionHeader: { color: '#828282', }, + sectionFooter: { + color: '#698DD3', + }, emptyViewContainer: { flex: 1, justifyContent: 'center', -- cgit v1.2.3-70-g09d2