From 921cf232551ea6e04bc2d845805f4b59419df085 Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Fri, 19 Feb 2021 22:04:46 -0800 Subject: white ring on profile screen fixed --- src/components/common/SocialIcon.tsx | 7 +++--- src/components/taggs/Tagg.tsx | 26 ++++++++-------------- src/components/taggs/TaggsBar.tsx | 11 +++++---- .../suggestedPeople/SuggestedPeopleScreen.tsx | 1 + 4 files changed, 20 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/components/common/SocialIcon.tsx b/src/components/common/SocialIcon.tsx index 8216b6ff..cb3b926b 100644 --- a/src/components/common/SocialIcon.tsx +++ b/src/components/common/SocialIcon.tsx @@ -1,11 +1,10 @@ import React from 'react'; import {Image} from 'react-native'; -import {ScreenType} from '../../types'; interface SocialIconProps { social: string; style: object; - screenType: ScreenType; + whiteRing: boolean | undefined; } /** * An image component that returns the of the icon for a specific social media platform. @@ -13,12 +12,12 @@ interface SocialIconProps { const SocialIcon: React.FC = ({ social: social, style: style, - screenType, + whiteRing, }) => { switch (social) { case 'Instagram': var icon = require('../../assets/socials/instagram-icon.png'); - if (screenType === ScreenType.SuggestedPeople) { + if (whiteRing) { icon = require('../../assets/socials/instagram-icon-white-bg.png'); } break; diff --git a/src/components/taggs/Tagg.tsx b/src/components/taggs/Tagg.tsx index 66694132..50651f74 100644 --- a/src/components/taggs/Tagg.tsx +++ b/src/components/taggs/Tagg.tsx @@ -1,5 +1,5 @@ import {useNavigation} from '@react-navigation/native'; -import React, {Fragment, useContext, useEffect, useState} from 'react'; +import React, {Fragment, useState} from 'react'; import {Alert, Linking, StyleSheet, TouchableOpacity, View} from 'react-native'; import PurpleRingPlus from '../../assets/icons/purple_ring+.svg'; import PurpleRing from '../../assets/icons/purple_ring.svg'; @@ -17,7 +17,7 @@ import { registerNonIntegratedSocialLink, } from '../../services'; import {SmallSocialIcon, SocialIcon, SocialLinkModal} from '../common'; -import {ScreenType, UserType} from '../../types'; +import {UserType} from '../../types'; import { ERROR_LINK, ERROR_UNABLE_TO_FIND_PROFILE, @@ -33,7 +33,7 @@ interface TaggProps { setSocialDataNeedUpdate: (social: string, username: string) => void; userXId: string | undefined; user: UserType; - screenType: ScreenType; + whiteRing: boolean | undefined; } const Tagg: React.FC = ({ @@ -44,7 +44,7 @@ const Tagg: React.FC = ({ setSocialDataNeedUpdate, userXId, user, - screenType, + whiteRing, }) => { const navigation = useNavigation(); const [modalVisible, setModalVisible] = useState(false); @@ -100,8 +100,9 @@ const Tagg: React.FC = ({ const pickTheRightRingHere = () => { if (youMayPass) { - if (screenType === ScreenType.SuggestedPeople) + if (whiteRing) { return ; + } if (social === 'Tagg') { return ; } else { @@ -141,23 +142,14 @@ const Tagg: React.FC = ({ setModalVisible={setModalVisible} completionCallback={linkNonIntegratedSocial} /> - + - + {pickTheRightRingHere()} - {screenType !== ScreenType.SuggestedPeople && ( + {!whiteRing && ( = ({ y, profileBodyHeight, userXId, screenType, + whiteRing, }) => { let [taggs, setTaggs] = useState([]); let [taggsNeedUpdate, setTaggsNeedUpdate] = useState(true); @@ -61,6 +63,7 @@ const TaggsBar: React.FC = ({ ); let new_taggs = []; let i = 0; + console.log('whiteRing in taggsbar: ', whiteRing); for (let social of linkedSocials) { new_taggs.push( = ({ isIntegrated={INTEGRATED_SOCIAL_LIST.indexOf(social) !== -1} setTaggsNeedUpdate={setTaggsNeedUpdate} setSocialDataNeedUpdate={handleSocialUpdate} - screenType={screenType} + whiteRing={whiteRing ? whiteRing : undefined} />, ); i++; } - if (!userXId && screenType !== ScreenType.SuggestedPeople) { + if (!userXId && !whiteRing) { for (let social of unlinkedSocials) { new_taggs.push( = ({ setSocialDataNeedUpdate={handleSocialUpdate} userXId={userXId} user={user} - screenType={screenType} + whiteRing ={whiteRing ? whiteRing : undefined} />, ); i++; @@ -126,7 +129,7 @@ const TaggsBar: React.FC = ({ return taggs.length > 0 ? ( diff --git a/src/screens/suggestedPeople/SuggestedPeopleScreen.tsx b/src/screens/suggestedPeople/SuggestedPeopleScreen.tsx index 3437cd85..c81c4f8c 100644 --- a/src/screens/suggestedPeople/SuggestedPeopleScreen.tsx +++ b/src/screens/suggestedPeople/SuggestedPeopleScreen.tsx @@ -77,6 +77,7 @@ const SuggestedPeopleScreen: React.FC = () => { userXId={undefined} profileBodyHeight={0} screenType={ScreenType.SuggestedPeople} + whiteRing={true} /> -- cgit v1.2.3-70-g09d2 From a2cd0be38858241b00956a5aa5715b3213084db0 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Sat, 20 Feb 2021 10:44:24 -0500 Subject: linting and removed logging --- src/components/taggs/TaggsBar.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/components/taggs/TaggsBar.tsx b/src/components/taggs/TaggsBar.tsx index aaf9a531..05ee18bb 100644 --- a/src/components/taggs/TaggsBar.tsx +++ b/src/components/taggs/TaggsBar.tsx @@ -63,7 +63,6 @@ const TaggsBar: React.FC = ({ ); let new_taggs = []; let i = 0; - console.log('whiteRing in taggsbar: ', whiteRing); for (let social of linkedSocials) { new_taggs.push( = ({ setSocialDataNeedUpdate={handleSocialUpdate} userXId={userXId} user={user} - whiteRing ={whiteRing ? whiteRing : undefined} + whiteRing={whiteRing ? whiteRing : undefined} />, ); i++; -- cgit v1.2.3-70-g09d2