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 /src/screens/profile/SettingsCell.tsx | |
parent | 57a06ec668a24118dd2bbfef149be71d79acf94c (diff) |
TOU and PP updates
Diffstat (limited to 'src/screens/profile/SettingsCell.tsx')
-rw-r--r-- | src/screens/profile/SettingsCell.tsx | 41 |
1 files changed, 37 insertions, 4 deletions
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; |