diff options
author | brian-tagg <brian@tagg.id> | 2021-05-07 15:51:35 -0700 |
---|---|---|
committer | brian-tagg <brian@tagg.id> | 2021-05-07 15:51:35 -0700 |
commit | 2510736eef1a66ff3c5b220ac42ca6cc0bce366d (patch) | |
tree | 6e259716afcee811e9a700c4485e260b7f86f1c6 /src/components/common | |
parent | 9a890f1d9795f4ff071d50ea5863b80811f840ec (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/components/common')
-rw-r--r-- | src/components/common/TaggPrompt.tsx | 20 |
1 files changed, 16 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), }, |