diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/assets/icons/invite-friends-prompt-icon.png | bin | 0 -> 153479 bytes | |||
-rw-r--r-- | src/components/common/TaggPrompt.tsx | 4 | ||||
-rw-r--r-- | src/components/notifications/NotificationPrompts.tsx | 58 | ||||
-rw-r--r-- | src/components/notifications/index.ts | 1 | ||||
-rw-r--r-- | src/screens/main/NotificationsScreen.tsx | 36 |
5 files changed, 67 insertions, 32 deletions
diff --git a/src/assets/icons/invite-friends-prompt-icon.png b/src/assets/icons/invite-friends-prompt-icon.png Binary files differnew file mode 100644 index 00000000..b9422b9f --- /dev/null +++ b/src/assets/icons/invite-friends-prompt-icon.png diff --git a/src/components/common/TaggPrompt.tsx b/src/components/common/TaggPrompt.tsx index 75f3009b..d65e30c6 100644 --- a/src/components/common/TaggPrompt.tsx +++ b/src/components/common/TaggPrompt.tsx @@ -7,7 +7,7 @@ import {normalize, SCREEN_HEIGHT} from '../../utils'; type TaggPromptProps = { messageHeader: string; messageBody: string | Element; - logoType: 'plus' | 'tagg'; + logoType: 'plus' | 'tagg' | 'invite_friends'; hideCloseButton?: boolean; noPadding?: boolean; onClose: () => void; @@ -29,6 +29,8 @@ const TaggPrompt: React.FC<TaggPromptProps> = ({ switch (logoType) { case 'plus': return require('../../assets/icons/plus-logo.png'); + case 'invite_friends': + return require('../../assets/icons/invite-friends-prompt-icon.png'); case 'tagg': default: return require('../../assets/images/logo-purple.png'); diff --git a/src/components/notifications/NotificationPrompts.tsx b/src/components/notifications/NotificationPrompts.tsx new file mode 100644 index 00000000..35e69496 --- /dev/null +++ b/src/components/notifications/NotificationPrompts.tsx @@ -0,0 +1,58 @@ +import React, {Fragment} from 'react'; +import {Image, StyleSheet, Text} from 'react-native'; +import {TaggPrompt} from '..'; + +export const InviteFriendsPrompt: React.FC = () => { + return ( + <TaggPrompt + messageHeader={'Invite Friends To Tagg!'} + messageBody={ + 'A new feature that lets you invite your friends to Tagg. \nClick on yourfriends list to do so!' + } + logoType={'invite_friends'} + hideCloseButton={true} + noPadding={true} + onClose={() => {}} + /> + ); +}; + +interface SPPromptNotificationProps { + showSPNotifyPopUp: boolean; +} + +export const SPPromptNotification: React.FC<SPPromptNotificationProps> = ({ + showSPNotifyPopUp, +}) => { + return showSPNotifyPopUp ? ( + <TaggPrompt + messageHeader={'New Suggested People Page!'} + messageBody={ + <> + <Text> + A new page where you can discover new profiles. Just press the new{' '} + </Text> + <Image + style={styles.icon} + source={require('../../assets/navigationIcons/home.png')} + /> + <Text> button on the tab bar to check it out!</Text> + </> + } + logoType={'tagg'} + hideCloseButton={true} + noPadding={true} + onClose={() => {}} + /> + ) : ( + <Fragment /> + ); +}; + +const styles = StyleSheet.create({ + icon: { + width: 20, + height: 20, + tintColor: 'grey', + }, +}); diff --git a/src/components/notifications/index.ts b/src/components/notifications/index.ts index 0260ce24..733b56f1 100644 --- a/src/components/notifications/index.ts +++ b/src/components/notifications/index.ts @@ -1 +1,2 @@ export {default as Notification} from './Notification'; +export {InviteFriendsPrompt} from './NotificationPrompts'; diff --git a/src/screens/main/NotificationsScreen.tsx b/src/screens/main/NotificationsScreen.tsx index 57dea6f5..68437f2b 100644 --- a/src/screens/main/NotificationsScreen.tsx +++ b/src/screens/main/NotificationsScreen.tsx @@ -21,7 +21,10 @@ import {TouchableOpacity} from 'react-native-gesture-handler'; import {SafeAreaView} from 'react-native-safe-area-context'; import {useDispatch, useSelector} from 'react-redux'; import {TabsGradient, TaggPrompt} from '../../components'; -import {Notification} from '../../components/notifications'; +import { + InviteFriendsPrompt, + Notification, +} from '../../components/notifications'; import { loadUserNotifications, updateNewNotificationReceived, @@ -252,30 +255,6 @@ const NotificationsScreen: React.FC = () => { return null; }; - const SPPromptNotification: ReactElement = showSPNotifyPopUp ? ( - <TaggPrompt - messageHeader={'New Suggested People Page!'} - messageBody={ - <> - <Text> - A new page where you can discover new profiles. Just press the new{' '} - </Text> - <Image - style={styles.icon} - source={require('../../assets/navigationIcons/home.png')} - /> - <Text> button on the tab bar to check it out!</Text> - </> - } - logoType={'tagg'} - hideCloseButton={true} - noPadding={true} - onClose={() => {}} - /> - ) : ( - <Fragment /> - ); - return ( <View style={styles.background}> <SafeAreaView> @@ -291,7 +270,7 @@ const NotificationsScreen: React.FC = () => { renderItem={renderNotification} renderSectionHeader={renderSectionHeader} renderSectionFooter={renderSectionFooter} - ListHeaderComponent={SPPromptNotification} + ListHeaderComponent={<InviteFriendsPrompt />} refreshControl={ <RefreshControl refreshing={refreshing} onRefresh={onRefresh} /> } @@ -359,11 +338,6 @@ const styles = StyleSheet.create({ flex: 1, justifyContent: 'center', }, - icon: { - width: 20, - height: 20, - tintColor: 'grey', - }, }); export default NotificationsScreen; |