diff options
author | ankit-thanekar007 <ankit.thanekar007@gmail.com> | 2021-03-29 12:45:36 -0700 |
---|---|---|
committer | ankit-thanekar007 <ankit.thanekar007@gmail.com> | 2021-03-29 12:45:36 -0700 |
commit | 3802fbd5d7f7c9ca70060f53af993356d946483d (patch) | |
tree | 9f5034456be529bd3323348dffdbf709ba847e1d | |
parent | 57a06ec668a24118dd2bbfef149be71d79acf94c (diff) |
TOU and PP updates
-rw-r--r-- | src/components/profile/ProfileMoreInfoDrawer.tsx | 2 | ||||
-rw-r--r-- | src/constants/api.ts | 4 | ||||
-rw-r--r-- | src/constants/constants.ts | 12 | ||||
-rw-r--r-- | src/screens/profile/SettingsCell.tsx | 41 |
4 files changed, 48 insertions, 11 deletions
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<ProfileMoreInfoDrawerProps> = (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<SettingsCellProps> = ({ navigateTo('AccountTypeScreen', {}); break; case 'Blocked Accounts': - navigateTo('Blocked Accounts', {}); + //TODO: break; case 'Suggested People Profile': goToUpdateSPProfile(); @@ -51,17 +55,42 @@ const SettingsCell: React.FC<SettingsCellProps> = ({ 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; |