aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorIvan Chen <ivan@thetaggid.com>2021-02-11 16:53:24 -0500
committerGitHub <noreply@github.com>2021-02-11 16:53:24 -0500
commit2561d20e17a697726d6b77accf79c9da2d1f6ef6 (patch)
tree9e2fdacee1040a9e9f975a329846dfa60cf5f3a4 /src/components
parent3bc52c4e021199c5b546d51cd238aad9a96852a7 (diff)
parent97e73f47622df32859964df4c94a4d419590bee2 (diff)
Merge pull request #237 from shravyaramesh/tma255-taggs-bar
[TMA255] Suggested People: Taggs bar
Diffstat (limited to 'src/components')
-rw-r--r--src/components/common/SocialIcon.tsx6
-rw-r--r--src/components/common/SocialLinkModal.tsx12
-rw-r--r--src/components/moments/Moment.tsx2
-rw-r--r--src/components/moments/MomentTile.tsx2
-rw-r--r--src/components/onboarding/LinkSocialMedia.tsx8
-rw-r--r--src/components/onboarding/SocialMediaLinker.tsx8
-rw-r--r--src/components/profile/Content.tsx6
-rw-r--r--src/components/search/RecentSearches.tsx2
-rw-r--r--src/components/taggs/SocialMediaInfo.tsx7
-rw-r--r--src/components/taggs/Tagg.tsx41
-rw-r--r--src/components/taggs/TaggsBar.tsx19
11 files changed, 83 insertions, 30 deletions
diff --git a/src/components/common/SocialIcon.tsx b/src/components/common/SocialIcon.tsx
index 3c9deb6d..8216b6ff 100644
--- a/src/components/common/SocialIcon.tsx
+++ b/src/components/common/SocialIcon.tsx
@@ -1,9 +1,11 @@
import React from 'react';
import {Image} from 'react-native';
+import {ScreenType} from '../../types';
interface SocialIconProps {
social: string;
style: object;
+ screenType: ScreenType;
}
/**
* An image component that returns the <Image> of the icon for a specific social media platform.
@@ -11,10 +13,14 @@ interface SocialIconProps {
const SocialIcon: React.FC<SocialIconProps> = ({
social: social,
style: style,
+ screenType,
}) => {
switch (social) {
case 'Instagram':
var icon = require('../../assets/socials/instagram-icon.png');
+ if (screenType === ScreenType.SuggestedPeople) {
+ icon = require('../../assets/socials/instagram-icon-white-bg.png');
+ }
break;
case 'Facebook':
var icon = require('../../assets/socials/facebook-icon.png');
diff --git a/src/components/common/SocialLinkModal.tsx b/src/components/common/SocialLinkModal.tsx
index 67a3f074..20061cd0 100644
--- a/src/components/common/SocialLinkModal.tsx
+++ b/src/components/common/SocialLinkModal.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import {Modal, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import {TextInput} from 'react-native-gesture-handler';
+import {ScreenType} from '../../types';
import {SocialIcon} from '.';
import CloseIcon from '../../assets/ionicons/close-outline.svg';
import {normalize, SCREEN_WIDTH} from '../../utils';
@@ -46,7 +47,11 @@ const SocialLinkModal: React.FC<SocialLinkModalProps> = ({
<TouchableOpacity style={styles.closeButton} onPress={onClosePress}>
<CloseIcon height={'100%'} width={'100%'} color={'grey'} />
</TouchableOpacity>
- <SocialIcon style={styles.icon} social={social} />
+ <SocialIcon
+ style={styles.icon}
+ social={social}
+ screenType={ScreenType.Profile}
+ />
<Text style={styles.titleLabel}>{social}</Text>
<Text style={styles.descriptionLabel}>
Insert your {social.toLowerCase()} username to link your{' '}
@@ -64,8 +69,9 @@ const SocialLinkModal: React.FC<SocialLinkModalProps> = ({
<TaggSquareButton
title={'Submit'}
onPress={onSubmit}
- mode={'gradient'}
- color={'white'}
+ buttonStyle={'gradient'}
+ buttonColor={'white'}
+ labelColor={'white'}
/>
</View>
</CenteredView>
diff --git a/src/components/moments/Moment.tsx b/src/components/moments/Moment.tsx
index a6b553b1..10cf6070 100644
--- a/src/components/moments/Moment.tsx
+++ b/src/components/moments/Moment.tsx
@@ -5,7 +5,7 @@ import {Text} from 'react-native-animatable';
import {ScrollView, TouchableOpacity} from 'react-native-gesture-handler';
import ImagePicker from 'react-native-image-crop-picker';
import LinearGradient from 'react-native-linear-gradient';
-import {MomentType, ScreenType} from 'src/types';
+import {MomentType, ScreenType} from '../../types';
import DeleteIcon from '../../assets/icons/delete-logo.svg';
import DownIcon from '../../assets/icons/down_icon.svg';
import PlusIcon from '../../assets/icons/plus_icon-01.svg';
diff --git a/src/components/moments/MomentTile.tsx b/src/components/moments/MomentTile.tsx
index 69701192..96eb35b6 100644
--- a/src/components/moments/MomentTile.tsx
+++ b/src/components/moments/MomentTile.tsx
@@ -1,7 +1,7 @@
import {useNavigation} from '@react-navigation/native';
import React from 'react';
import {StyleSheet, View, Image, TouchableOpacity} from 'react-native';
-import {MomentType, ScreenType} from 'src/types';
+import {MomentType, ScreenType} from '../../types';
interface MomentTileProps {
moment: MomentType;
diff --git a/src/components/onboarding/LinkSocialMedia.tsx b/src/components/onboarding/LinkSocialMedia.tsx
index 8938b9a0..f3915752 100644
--- a/src/components/onboarding/LinkSocialMedia.tsx
+++ b/src/components/onboarding/LinkSocialMedia.tsx
@@ -18,7 +18,7 @@ import {
handlePressForAuthBrowser,
registerNonIntegratedSocialLink,
} from '../../services';
-import {LinkerType} from '../../types';
+import {LinkerType, ScreenType} from '../../types';
import SocialIcon from '../common/SocialIcon';
interface SocialMediaLinkerProps extends TouchableOpacityProps {
@@ -91,7 +91,11 @@ const SocialMediaLinker: React.FC<SocialMediaLinkerProps> = ({
activeOpacity={0.7}
onPress={modelOrAuthBrowser}
style={styles.container}>
- <SocialIcon social={label} style={styles.icon} />
+ <SocialIcon
+ social={label}
+ style={styles.icon}
+ screenType={ScreenType.Profile}
+ />
<Text style={[styles.label, {color: font_color}]}>{label}</Text>
{authenticated && (
<Image
diff --git a/src/components/onboarding/SocialMediaLinker.tsx b/src/components/onboarding/SocialMediaLinker.tsx
index da637f99..559a2990 100644
--- a/src/components/onboarding/SocialMediaLinker.tsx
+++ b/src/components/onboarding/SocialMediaLinker.tsx
@@ -6,7 +6,7 @@ import {
TouchableOpacity,
TouchableOpacityProps,
} from 'react-native';
-import {LinkerType} from 'src/types';
+import {LinkerType, ScreenType} from '../../types';
import {SOCIAL_FONT_COLORS} from '../../constants/constants';
import {handlePressForAuthBrowser} from '../../services';
import SocialIcon from '../common/SocialIcon';
@@ -66,7 +66,11 @@ const SocialMediaLinker: React.FC<SocialMediaLinkerProps> = ({
activeOpacity={0.7}
onPress={handlePress}
style={styles.container}>
- <SocialIcon social={label} style={styles.icon} />
+ <SocialIcon
+ social={label}
+ style={styles.icon}
+ screenType={ScreenType.Profile}
+ />
<Text style={[styles.label, {color: font_color}]}>{label}</Text>
{state.socialLinked && (
<Image
diff --git a/src/components/profile/Content.tsx b/src/components/profile/Content.tsx
index 28000dd7..86d40f1b 100644
--- a/src/components/profile/Content.tsx
+++ b/src/components/profile/Content.tsx
@@ -309,7 +309,9 @@ const Content: React.FC<ContentProps> = ({y, userXId, screenType}) => {
isBlocked,
}}
/>
- <TaggsBar {...{y, profileBodyHeight, userXId, screenType}} />
+ <View style={styles.taggsbarContainer}>
+ <TaggsBar {...{y, profileBodyHeight, userXId, screenType}} />
+ </View>
<View style={styles.momentsContainer}>
{userXId && moments.length === 0 && (
<View style={styles.plusIconContainer}>
@@ -382,6 +384,7 @@ const Content: React.FC<ContentProps> = ({y, userXId, screenType}) => {
const styles = StyleSheet.create({
container: {
flex: 1,
+ backgroundColor: '#fff',
},
momentsContainer: {
backgroundColor: '#f2f2f2',
@@ -415,6 +418,7 @@ const styles = StyleSheet.create({
color: 'gray',
marginVertical: '8%',
},
+ taggsbarContainer: {paddingHorizontal: 15},
});
export default Content;
diff --git a/src/components/search/RecentSearches.tsx b/src/components/search/RecentSearches.tsx
index bdbd5773..bebf6bcf 100644
--- a/src/components/search/RecentSearches.tsx
+++ b/src/components/search/RecentSearches.tsx
@@ -6,7 +6,7 @@ import {
StyleSheet,
TouchableOpacityProps,
} from 'react-native';
-import {PreviewType, ProfilePreviewType, ScreenType} from 'src/types';
+import {PreviewType, ProfilePreviewType, ScreenType} from '../../types';
import {TAGG_LIGHT_BLUE} from '../../constants';
import SearchResults from './SearchResults';
diff --git a/src/components/taggs/SocialMediaInfo.tsx b/src/components/taggs/SocialMediaInfo.tsx
index c25d0297..46e651f9 100644
--- a/src/components/taggs/SocialMediaInfo.tsx
+++ b/src/components/taggs/SocialMediaInfo.tsx
@@ -1,5 +1,6 @@
import React from 'react';
import {StyleSheet, Text, View} from 'react-native';
+import { ScreenType } from '../../types';
import {SocialIcon} from '..';
import {handleOpenSocialUrlOnBrowser} from '../../utils';
@@ -30,7 +31,11 @@ const SocialMediaInfo: React.FC<SocialMediaInfoProps> = ({
)}
<View style={styles.row}>
<View />
- <SocialIcon style={styles.icon} social={type} />
+ <SocialIcon
+ style={styles.icon}
+ social={type}
+ screenType={ScreenType.Profile}
+ />
<Text
style={styles.name}
onPress={() => {
diff --git a/src/components/taggs/Tagg.tsx b/src/components/taggs/Tagg.tsx
index cba7777a..bb450b64 100644
--- a/src/components/taggs/Tagg.tsx
+++ b/src/components/taggs/Tagg.tsx
@@ -5,6 +5,7 @@ import PurpleRingPlus from '../../assets/icons/purple_ring+.svg';
import PurpleRing from '../../assets/icons/purple_ring.svg';
import RingPlus from '../../assets/icons/ring+.svg';
import Ring from '../../assets/icons/ring.svg';
+import WhiteRing from '../../assets/icons/ring-white.svg';
import {
INTEGRATED_SOCIAL_LIST,
SOCIAL_ICON_SIZE_ADJUSTMENT,
@@ -16,7 +17,7 @@ import {
registerNonIntegratedSocialLink,
} from '../../services';
import {SmallSocialIcon, SocialIcon, SocialLinkModal} from '../common';
-import {UserType} from '../../types';
+import {ScreenType, UserType} from '../../types';
import {
ERROR_LINK,
ERROR_UNABLE_TO_FIND_PROFILE,
@@ -32,6 +33,7 @@ interface TaggProps {
setSocialDataNeedUpdate: (social: string, username: string) => void;
userXId: string | undefined;
user: UserType;
+ screenType: ScreenType;
}
const Tagg: React.FC<TaggProps> = ({
@@ -42,6 +44,7 @@ const Tagg: React.FC<TaggProps> = ({
setSocialDataNeedUpdate,
userXId,
user,
+ screenType,
}) => {
const navigation = useNavigation();
const [modalVisible, setModalVisible] = useState(false);
@@ -97,6 +100,8 @@ const Tagg: React.FC<TaggProps> = ({
const pickTheRightRingHere = () => {
if (youMayPass) {
+ if (screenType === ScreenType.SuggestedPeople)
+ return <WhiteRing width={TAGG_RING_DIM} height={TAGG_RING_DIM} />;
if (social === 'Tagg') {
return <Ring width={TAGG_RING_DIM} height={TAGG_RING_DIM} />;
} else {
@@ -140,21 +145,27 @@ const Tagg: React.FC<TaggProps> = ({
<TouchableOpacity
style={styles.iconTap}
onPress={modalOrAuthBrowserOrPass}>
- <SocialIcon style={styles.icon} social={social} />
- {pickTheRightRingHere()}
- </TouchableOpacity>
- <View style={styles.smallIconContainer}>
- <SmallSocialIcon
- style={[
- styles.smallIcon,
- {
- height: SOCIAL_ICON_SIZE_ADJUSTMENT[social],
- width: SOCIAL_ICON_SIZE_ADJUSTMENT[social],
- },
- ]}
+ <SocialIcon
+ style={styles.icon}
social={social}
+ screenType={screenType}
/>
- </View>
+ {pickTheRightRingHere()}
+ </TouchableOpacity>
+ {screenType !== ScreenType.SuggestedPeople && (
+ <View style={styles.smallIconContainer}>
+ <SmallSocialIcon
+ style={[
+ styles.smallIcon,
+ {
+ height: SOCIAL_ICON_SIZE_ADJUSTMENT[social],
+ width: SOCIAL_ICON_SIZE_ADJUSTMENT[social],
+ },
+ ]}
+ social={social}
+ />
+ </View>
+ )}
</View>
</>
)}
@@ -166,7 +177,7 @@ const styles = StyleSheet.create({
container: {
justifyContent: 'space-between',
alignItems: 'center',
- marginHorizontal: 15,
+ marginRight: 34,
height: normalize(90),
},
iconTap: {
diff --git a/src/components/taggs/TaggsBar.tsx b/src/components/taggs/TaggsBar.tsx
index 76833d65..e7bdb0f2 100644
--- a/src/components/taggs/TaggsBar.tsx
+++ b/src/components/taggs/TaggsBar.tsx
@@ -72,11 +72,12 @@ const TaggsBar: React.FC<TaggsBarProps> = ({
isIntegrated={INTEGRATED_SOCIAL_LIST.indexOf(social) !== -1}
setTaggsNeedUpdate={setTaggsNeedUpdate}
setSocialDataNeedUpdate={handleSocialUpdate}
+ screenType={screenType}
/>,
);
i++;
}
- if (!userXId) {
+ if (!userXId && screenType !== ScreenType.SuggestedPeople) {
for (let social of unlinkedSocials) {
new_taggs.push(
<Tagg
@@ -88,6 +89,7 @@ const TaggsBar: React.FC<TaggsBarProps> = ({
setSocialDataNeedUpdate={handleSocialUpdate}
userXId={userXId}
user={user}
+ screenType={screenType}
/>,
);
i++;
@@ -122,7 +124,12 @@ const TaggsBar: React.FC<TaggsBarProps> = ({
});
return taggs.length > 0 ? (
- <View style={[styles.container, {shadowOpacity, paddingTop}]}>
+ <View
+ style={
+ screenType === ScreenType.SuggestedPeople
+ ? [styles.spContainer]
+ : [styles.container, {shadowOpacity, paddingTop}]
+ }>
<ScrollView
horizontal
showsHorizontalScrollIndicator={false}
@@ -136,6 +143,13 @@ const TaggsBar: React.FC<TaggsBarProps> = ({
};
const styles = StyleSheet.create({
+ spContainer: {
+ shadowColor: '#000',
+ shadowRadius: 10,
+ shadowOffset: {width: 0, height: 2},
+ zIndex: 1,
+ paddingBottom: 5,
+ },
container: {
backgroundColor: 'white',
shadowColor: '#000',
@@ -146,7 +160,6 @@ const styles = StyleSheet.create({
},
contentContainer: {
alignItems: 'center',
- paddingHorizontal: 5,
paddingBottom: 5,
},
});