From ad70d44fd106c475ff3ecd680ebb41946e4dc363 Mon Sep 17 00:00:00 2001 From: ankit-thanekar007 Date: Wed, 17 Mar 2021 15:59:53 -0700 Subject: Tma 701 - New screens added, refactoring pending --- src/components/profile/ProfileMoreInfoDrawer.tsx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/components') diff --git a/src/components/profile/ProfileMoreInfoDrawer.tsx b/src/components/profile/ProfileMoreInfoDrawer.tsx index a77a2e84..d62063a7 100644 --- a/src/components/profile/ProfileMoreInfoDrawer.tsx +++ b/src/components/profile/ProfileMoreInfoDrawer.tsx @@ -3,7 +3,6 @@ import React from 'react'; import {Alert, Image, StyleSheet, TouchableOpacity} from 'react-native'; import {useSelector} from 'react-redux'; import MoreIcon from '../../assets/icons/more_horiz-24px.svg'; -import PersonOutline from '../../assets/ionicons/person-outline.svg'; import {TAGG_DARK_BLUE, TAGG_LIGHT_BLUE} from '../../constants'; import {ERROR_ATTEMPT_EDIT_SP} from '../../constants/strings'; import {RootState} from '../../store/rootreducer'; @@ -29,7 +28,7 @@ const ProfileMoreInfoDrawer: React.FC = (props) => { const isOwnProfile = !userXId || userXName === username; const goToEditProfile = () => { - navigation.push('EditProfile', { + navigation.navigate('EditProfile', { userId: userId, username: username, }); @@ -41,9 +40,7 @@ const ProfileMoreInfoDrawer: React.FC = (props) => { Alert.alert(ERROR_ATTEMPT_EDIT_SP); } else { // Sending undefined for updatedSelectedBadges to mark that there was no update yet - navigation.push('UpdateSPPicture', { - editing: true, - }); + navigation.navigate('SettingsScreen'); setIsOpen(false); } }; @@ -81,14 +78,21 @@ const ProfileMoreInfoDrawer: React.FC = (props) => { textColor={'black'} buttons={[ [ - 'Edit Suggested', - goToUpdateSPProfile, + 'Settings', + goToSettingsPage, , + ], + [ + 'Edit Profile', + goToEditProfile, + , ], - ['Edit Profile', goToEditProfile, ], ]} /> )} -- cgit v1.2.3-70-g09d2 From 3802fbd5d7f7c9ca70060f53af993356d946483d Mon Sep 17 00:00:00 2001 From: ankit-thanekar007 Date: Mon, 29 Mar 2021 12:45:36 -0700 Subject: TOU and PP updates --- src/components/profile/ProfileMoreInfoDrawer.tsx | 2 +- src/constants/api.ts | 4 +++ src/constants/constants.ts | 12 +++---- src/screens/profile/SettingsCell.tsx | 41 +++++++++++++++++++++--- 4 files changed, 48 insertions(+), 11 deletions(-) (limited to 'src/components') diff --git a/src/components/profile/ProfileMoreInfoDrawer.tsx b/src/components/profile/ProfileMoreInfoDrawer.tsx index d62063a7..f70f90d0 100644 --- a/src/components/profile/ProfileMoreInfoDrawer.tsx +++ b/src/components/profile/ProfileMoreInfoDrawer.tsx @@ -35,7 +35,7 @@ const ProfileMoreInfoDrawer: React.FC = (props) => { setIsOpen(false); }; - const goToUpdateSPProfile = () => { + const goToSettingsPage = () => { if (profile.suggested_people_linked === 0) { Alert.alert(ERROR_ATTEMPT_EDIT_SP); } else { diff --git a/src/constants/api.ts b/src/constants/api.ts index 6afdf384..22890c33 100644 --- a/src/constants/api.ts +++ b/src/constants/api.ts @@ -64,3 +64,7 @@ export const DEEPLINK: string = 'https://tinyurl.com/y3o4aec5'; export const LINK_IG_OAUTH: string = `https://www.instagram.com/oauth/authorize/?client_id=205466150510738&redirect_uri=${DEEPLINK}&scope=user_profile,user_media&response_type=code`; export const LINK_FB_OAUTH: string = `https://www.facebook.com/v8.0/dialog/oauth?client_id=1308555659343609&redirect_uri=${DEEPLINK}&scope=user_posts,public_profile&response_type=code`; export const LINK_TWITTER_OAUTH: string = API_URL + 'link-twitter-request/'; + +// Profile Links +export const COMMUNITY_GUIDELINES: string = 'https://www.tagg.id/community-guidelines'; +export const PRIVACY_POLICY: string = 'https://www.tagg.id/privacy-policy'; diff --git a/src/constants/constants.ts b/src/constants/constants.ts index 91029b3a..f533563d 100644 --- a/src/constants/constants.ts +++ b/src/constants/constants.ts @@ -208,7 +208,7 @@ export const SETTINGS_DATA = { title: 'GENERAL', data: [ { - title: 'Terms of use', + title: 'Community Guidelines', preimage: require('../assets/images/settings/termsofuse.png'), postimage: require('../assets/images/settings/white-arrow.png'), }, @@ -229,11 +229,11 @@ export const SETTINGS_DATA = { preimage: require('../assets/images/settings/lock-white.png'), postimage: require('../assets/images/settings/white-arrow.png'), }, - { - title: 'Blocked Accounts', - preimage: require('../assets/images/settings/blocked-white.png'), - postimage: require('../assets/images/settings/white-arrow.png'), - }, + // { + // title: 'Blocked Accounts', + // preimage: require('../assets/images/settings/blocked-white.png'), + // postimage: require('../assets/images/settings/white-arrow.png'), + // }, ], }, ], diff --git a/src/screens/profile/SettingsCell.tsx b/src/screens/profile/SettingsCell.tsx index 29dcc691..f5360242 100644 --- a/src/screens/profile/SettingsCell.tsx +++ b/src/screens/profile/SettingsCell.tsx @@ -3,11 +3,15 @@ import React from 'react'; import { Alert, Image, + Linking, StyleSheet, Text, TouchableOpacity, View, } from 'react-native'; +import InAppBrowser from 'react-native-inappbrowser-reborn'; +import {TAGG_PURPLE} from '../../constants'; +import {COMMUNITY_GUIDELINES, PRIVACY_POLICY} from '../../constants/api'; import {ERROR_ATTEMPT_EDIT_SP} from '../../constants/strings'; import {normalize, SCREEN_WIDTH} from '../../utils/layouts'; @@ -43,7 +47,7 @@ const SettingsCell: React.FC = ({ navigateTo('AccountTypeScreen', {}); break; case 'Blocked Accounts': - navigateTo('Blocked Accounts', {}); + //TODO: break; case 'Suggested People Profile': goToUpdateSPProfile(); @@ -51,17 +55,42 @@ const SettingsCell: React.FC = ({ case 'Privacy': navigateTo('PrivacyScreen', {}); break; - case 'Terms of use': - //TODO: + case 'Community Guidelines': + openTaggLink(COMMUNITY_GUIDELINES); break; case 'Privacy Policy': - //TODO: + openTaggLink(PRIVACY_POLICY); break; default: break; } }; + const openTaggLink = async (url: string) => { + try { + if (await InAppBrowser.isAvailable()) { + await InAppBrowser.open(url, { + dismissButtonStyle: 'cancel', + preferredBarTintColor: TAGG_PURPLE, + preferredControlTintColor: 'white', + animated: true, + modalPresentationStyle: 'fullScreen', + modalTransitionStyle: 'coverVertical', + modalEnabled: true, + enableBarCollapsing: false, + animations: { + startEnter: 'slide_in_right', + startExit: 'slide_out_left', + endEnter: 'slide_in_left', + endExit: 'slide_out_right', + }, + }); + } else Linking.openURL(url); + } catch (error) { + Alert.alert(error.message); + } + }; + const navigateTo = (screen: string, options: object) => { navigation.navigate(screen, options); }; @@ -108,6 +137,10 @@ const styles = StyleSheet.create({ color: 'white', }, subtitleStyles: {color: '#C4C4C4', marginRight: 13}, + tc: { + marginVertical: '5%', + top: '8%', + }, }); export default SettingsCell; -- cgit v1.2.3-70-g09d2