aboutsummaryrefslogtreecommitdiff
path: root/src/screens/profile/PrivacyScreen.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-03-29 17:36:21 -0400
committerGitHub <noreply@github.com>2021-03-29 17:36:21 -0400
commite7865305f77f801dd5f1c06c506c626192877fd8 (patch)
tree3ed42fb2a394eb3a8dd5fa1dadd5881ea87eb7cd /src/screens/profile/PrivacyScreen.tsx
parentad2ad5d232473d38426c2f0f8283ba015dadfd4c (diff)
parente8d862e5e6dd8a6a517a93c65e30795813af936d (diff)
Merge pull request #304 from TaggiD-Inc/tma-700-private-account-toggle
[TMA 700] : Private Account toggle + Settings Screen
Diffstat (limited to 'src/screens/profile/PrivacyScreen.tsx')
-rw-r--r--src/screens/profile/PrivacyScreen.tsx49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/screens/profile/PrivacyScreen.tsx b/src/screens/profile/PrivacyScreen.tsx
new file mode 100644
index 00000000..17872e24
--- /dev/null
+++ b/src/screens/profile/PrivacyScreen.tsx
@@ -0,0 +1,49 @@
+import React from 'react';
+import {
+ SectionList,
+ StatusBar,
+ StyleSheet,
+ View,
+ SafeAreaView,
+} from 'react-native';
+import {useSelector} from 'react-redux';
+import {RootState} from 'src/store/rootReducer';
+import {Background} from '../../components';
+import {NO_PROFILE} from '../../store/initialStates';
+import {BackgroundGradientType} from '../../types';
+import {SCREEN_HEIGHT} from '../../utils/layouts';
+import SettingsCell from './SettingsCell';
+import {SETTINGS_DATA} from '../../constants/constants';
+
+const PrivacyScreen: React.FC = () => {
+ const {profile: {is_private} = NO_PROFILE} = useSelector(
+ (state: RootState) => state.user,
+ );
+
+ return (
+ <>
+ <StatusBar barStyle="light-content" />
+ <Background gradientType={BackgroundGradientType.Light}>
+ <SafeAreaView>
+ <View style={styles.container}>
+ <SectionList
+ sections={SETTINGS_DATA.PrivacyScreen}
+ keyExtractor={(item, index) => item.title + index}
+ renderItem={({item: {title, preimage, postimage}}) => (
+ <SettingsCell
+ {...{title, preimage, postimage, isPrivate: is_private}}
+ />
+ )}
+ />
+ </View>
+ </SafeAreaView>
+ </Background>
+ </>
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {height: SCREEN_HEIGHT, marginHorizontal: '8%', marginTop: '8%'},
+});
+
+export default PrivacyScreen;