aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrian-tagg <brian@tagg.id>2021-05-07 15:51:35 -0700
committerbrian-tagg <brian@tagg.id>2021-05-07 15:51:35 -0700
commit2510736eef1a66ff3c5b220ac42ca6cc0bce366d (patch)
tree6e259716afcee811e9a700c4485e260b7f86f1c6 /src
parent9a890f1d9795f4ff071d50ea5863b80811f840ec (diff)
Made TaggPrompt changes cleaner, added logoLink to NotificationPrompts type, made image in chat notification a link to the Chat screen
Diffstat (limited to 'src')
-rw-r--r--src/components/common/TaggPrompt.tsx20
-rw-r--r--src/components/notifications/NotificationPrompts.tsx4
2 files changed, 20 insertions, 4 deletions
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<TaggPromptProps> = ({
messageHeader,
messageBody,
logoType,
+ logoLink,
hideCloseButton,
noPadding,
onClose,
@@ -44,9 +47,17 @@ const TaggPrompt: React.FC<TaggPromptProps> = ({
const topPadding = {paddingTop: noPadding ? 0 : SCREEN_HEIGHT / 10};
const bottomPadding = {paddingBottom: noPadding ? 0 : SCREEN_HEIGHT / 50};
+ const navigation = useNavigation();
+
return (
<View style={[styles.container, topPadding, bottomPadding]}>
- <Image style={styles.icon} source={logo()} />
+ {logoLink
+ ?
+ <TouchableOpacity
+ onPress={() => navigation.navigate(logoLink)}>
+ <Image style={styles.chat} source={logo()} />
+ </TouchableOpacity>
+ : <Image style={styles.icon} source={logo()} />}
<Text style={styles.header}>{messageHeader}</Text>
<Text style={styles.subtext}>{messageBody}</Text>
{!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<SPPromptNotificationProps> = ({
</>
}
logoType={'tagg'}
+ logoLink={null}
hideCloseButton={true}
noPadding={true}
onClose={() => {}}