aboutsummaryrefslogtreecommitdiff
path: root/src/screens
diff options
context:
space:
mode:
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/profile/SettingsCell.tsx41
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;