diff options
-rw-r--r-- | src/components/common/TaggPrompt.tsx | 31 | ||||
-rw-r--r-- | src/components/notifications/NotificationPrompts.tsx | 16 |
2 files changed, 28 insertions, 19 deletions
diff --git a/src/components/common/TaggPrompt.tsx b/src/components/common/TaggPrompt.tsx index 236501ff..0bf25c3c 100644 --- a/src/components/common/TaggPrompt.tsx +++ b/src/components/common/TaggPrompt.tsx @@ -1,5 +1,11 @@ import React from 'react'; -import {StyleSheet, Text, TouchableOpacity} from 'react-native'; +import { + ImageStyle, + StyleProp, + 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'; @@ -9,7 +15,8 @@ type TaggPromptProps = { messageHeader: string; messageBody: string | Element; logoType: 'plus' | 'tagg' | 'invite_friends' | 'private_accounts' | 'chat'; - logoLink: string | null; + logoLink?: string; + externalStyles?: Record<string, StyleProp<ImageStyle>>; hideCloseButton?: boolean; noPadding?: boolean; onClose: () => void; @@ -20,6 +27,7 @@ const TaggPrompt: React.FC<TaggPromptProps> = ({ messageBody, logoType, logoLink, + externalStyles, hideCloseButton, noPadding, onClose, @@ -51,13 +59,14 @@ const TaggPrompt: React.FC<TaggPromptProps> = ({ return ( <View style={[styles.container, topPadding, bottomPadding]}> - {logoLink - ? - <TouchableOpacity - onPress={() => navigation.navigate(logoLink)}> - <Image style={styles.chat} source={logo()} /> - </TouchableOpacity> - : <Image style={styles.icon} source={logo()} />} + <TouchableOpacity + disabled={logoLink ? false : true} + onPress={() => logoLink && navigation.navigate(logoLink)}> + <Image + style={externalStyles?.icon ? externalStyles.icon : styles.icon} + source={logo()} + /> + </TouchableOpacity> <Text style={styles.header}>{messageHeader}</Text> <Text style={styles.subtext}>{messageBody}</Text> {!hideCloseButton && ( @@ -92,10 +101,6 @@ const styles = StyleSheet.create({ width: normalize(40), height: normalize(40), }, - chat: { - width: normalize(350), - height: normalize(70), - }, header: { color: 'black', fontSize: normalize(16), diff --git a/src/components/notifications/NotificationPrompts.tsx b/src/components/notifications/NotificationPrompts.tsx index 6c6da11e..06f6ecc6 100644 --- a/src/components/notifications/NotificationPrompts.tsx +++ b/src/components/notifications/NotificationPrompts.tsx @@ -1,5 +1,6 @@ import React, {Fragment} from 'react'; import {Image, StyleSheet, Text} from 'react-native'; +import {normalize, SCREEN_WIDTH} from '../../utils'; import {TaggPrompt} from '../common'; export const InviteFriendsPrompt: React.FC = () => { @@ -10,7 +11,6 @@ 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={() => {}} @@ -26,7 +26,6 @@ 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={() => {}} @@ -35,14 +34,20 @@ export const PrivateAccountsPrompt: React.FC = () => { }; export const NewChatPrompt: React.FC = () => { - const handWaveRegex = `\u{1F44B}` - const message = `Introducing messaging, another way to engage with\nfriends on campus! Send a ${handWaveRegex} to a friend now!` + const handWaveRegex = '\u{1F44B}'; + const message = `Introducing messaging, another way to engage with\nfriends on campus! Send a ${handWaveRegex} to a friend now!`; return ( <TaggPrompt messageHeader={'Chat!'} messageBody={message} logoType={'chat'} - logoLink={"ChatList"} + logoLink={'ChatList'} + externalStyles={{ + icon: { + width: SCREEN_WIDTH * 0.9, + height: normalize(70), + }, + }} hideCloseButton={true} noPadding={true} onClose={() => {}} @@ -73,7 +78,6 @@ export const SPPromptNotification: React.FC<SPPromptNotificationProps> = ({ </> } logoType={'tagg'} - logoLink={null} hideCloseButton={true} noPadding={true} onClose={() => {}} |