From 2510736eef1a66ff3c5b220ac42ca6cc0bce366d Mon Sep 17 00:00:00 2001 From: brian-tagg Date: Fri, 7 May 2021 15:51:35 -0700 Subject: Made TaggPrompt changes cleaner, added logoLink to NotificationPrompts type, made image in chat notification a link to the Chat screen --- src/components/common/TaggPrompt.tsx | 20 ++++++++++++++++---- src/components/notifications/NotificationPrompts.tsx | 4 ++++ 2 files changed, 20 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/components/common/TaggPrompt.tsx b/src/components/common/TaggPrompt.tsx index 20901e65..236501ff 100644 --- a/src/components/common/TaggPrompt.tsx +++ b/src/components/common/TaggPrompt.tsx @@ -3,11 +3,13 @@ import {StyleSheet, Text, TouchableOpacity} from 'react-native'; import {Image, View} from 'react-native-animatable'; import CloseIcon from '../../assets/ionicons/close-outline.svg'; import {normalize, SCREEN_HEIGHT} from '../../utils'; +import {useNavigation} from '@react-navigation/core'; type TaggPromptProps = { messageHeader: string; messageBody: string | Element; logoType: 'plus' | 'tagg' | 'invite_friends' | 'private_accounts' | 'chat'; + logoLink: string | null; hideCloseButton?: boolean; noPadding?: boolean; onClose: () => void; @@ -17,6 +19,7 @@ const TaggPrompt: React.FC = ({ messageHeader, messageBody, logoType, + logoLink, hideCloseButton, noPadding, onClose, @@ -44,9 +47,17 @@ const TaggPrompt: React.FC = ({ const topPadding = {paddingTop: noPadding ? 0 : SCREEN_HEIGHT / 10}; const bottomPadding = {paddingBottom: noPadding ? 0 : SCREEN_HEIGHT / 50}; + const navigation = useNavigation(); + return ( - + {logoLink + ? + navigation.navigate(logoLink)}> + + + : } {messageHeader} {messageBody} {!hideCloseButton && ( @@ -78,9 +89,10 @@ const styles = StyleSheet.create({ alignSelf: 'flex-end', }, icon: { - // Original, prior to chat notification - // width: normalize(40), - // height: normalize(40), + width: normalize(40), + height: normalize(40), + }, + chat: { width: normalize(350), height: normalize(70), }, diff --git a/src/components/notifications/NotificationPrompts.tsx b/src/components/notifications/NotificationPrompts.tsx index 0fb580e6..6c6da11e 100644 --- a/src/components/notifications/NotificationPrompts.tsx +++ b/src/components/notifications/NotificationPrompts.tsx @@ -10,6 +10,7 @@ export const InviteFriendsPrompt: React.FC = () => { 'A new feature that lets you invite your friends to Tagg. \nClick on your friends list to do so!' } logoType={'invite_friends'} + logoLink={null} hideCloseButton={true} noPadding={true} onClose={() => {}} @@ -25,6 +26,7 @@ export const PrivateAccountsPrompt: React.FC = () => { 'You can now choose to make your account private!\nHead over to the privacy tab in settings to check it out' } logoType={'private_accounts'} + logoLink={null} hideCloseButton={true} noPadding={true} onClose={() => {}} @@ -40,6 +42,7 @@ export const NewChatPrompt: React.FC = () => { messageHeader={'Chat!'} messageBody={message} logoType={'chat'} + logoLink={"ChatList"} hideCloseButton={true} noPadding={true} onClose={() => {}} @@ -70,6 +73,7 @@ export const SPPromptNotification: React.FC = ({ } logoType={'tagg'} + logoLink={null} hideCloseButton={true} noPadding={true} onClose={() => {}} -- cgit v1.2.3-70-g09d2