From 2711b579ba6982cf7dee9805bc80506703bc943f Mon Sep 17 00:00:00 2001 From: Roland Osborne Date: Fri, 15 Sep 2023 14:28:01 -0700 Subject: [PATCH] added remaining options to profile settings screen --- app/mobile/src/session/profile/Profile.jsx | 17 ++-- .../src/session/profile/Profile.styled.js | 9 ++ app/mobile/src/session/settings/Settings.jsx | 90 ++++++++++++++++++- .../src/session/settings/Settings.styled.js | 13 +++ .../src/session/settings/useSettings.hook.js | 1 + app/mobile/src/utils/Prompt.jsx | 2 +- app/mobile/src/utils/Prompt.styled.js | 10 +++ 7 files changed, 134 insertions(+), 8 deletions(-) diff --git a/app/mobile/src/session/profile/Profile.jsx b/app/mobile/src/session/profile/Profile.jsx index 9e711dbc..c562b9fe 100644 --- a/app/mobile/src/session/profile/Profile.jsx +++ b/app/mobile/src/session/profile/Profile.jsx @@ -77,10 +77,10 @@ export function Profile({ drawer }) { { state.username } - + { state.strings.edit } - + @@ -98,7 +98,7 @@ export function Profile({ drawer }) { )} - + { state.location && ( { state.location } )} @@ -107,7 +107,7 @@ export function Profile({ drawer }) { )} - + { state.description && ( { state.description } )} @@ -115,7 +115,14 @@ export function Profile({ drawer }) { Description )} - + + + setVisible(!state.searchable)}> + { state.strings.visibleRegistry } + + + )} { !drawer && ( diff --git a/app/mobile/src/session/profile/Profile.styled.js b/app/mobile/src/session/profile/Profile.styled.js index a80ececc..b0465068 100644 --- a/app/mobile/src/session/profile/Profile.styled.js +++ b/app/mobile/src/session/profile/Profile.styled.js @@ -209,10 +209,19 @@ export const styles = StyleSheet.create({ paddingLeft: 8, paddingRight: 16, }, + drawerDescriptionIcon: { + alignSelf: 'flex-start', + paddingLeft: 8, + paddingRight: 8, + }, icon: { paddingLeft: 8, paddingRight: 16, }, + drawerIcon: { + paddingLeft: 8, + paddingRight: 8, + }, locationSet: { fontSize: 16, color: Colors.text, diff --git a/app/mobile/src/session/settings/Settings.jsx b/app/mobile/src/session/settings/Settings.jsx index 4e24603a..b8063d06 100644 --- a/app/mobile/src/session/settings/Settings.jsx +++ b/app/mobile/src/session/settings/Settings.jsx @@ -163,7 +163,93 @@ export function Settings({ drawer }) { return ( <> { drawer && ( - SETTINGS DRAWER + <> + + + + + + + setNotifications(!state.pushEnabled)}> + { state.strings.enableNotifications } + + + + + + + + + + { state.sealEnabled && ( + { state.strings.manageTopics } + )} + { !state.sealEnabled && ( + { state.strings.enableTopics } + )} + + + + + + + + + { state.strings.logout } + + + + + + + + { state.strings.changeLogin } + + + + + + + + { state.strings.deleteAccount } + + + + + + + + + { state.strings.blockedContacts } + + + + + + + + { state.strings.blockedTopics } + + + + + + + + { state.strings.blockedMessages } + + + + Linking.openURL('https://github.com/balzack/databag/discussions')}> + + + + + { state.strings.support } + + + )} { !drawer && ( @@ -254,7 +340,7 @@ export function Settings({ drawer }) { - + { state.strings.account } diff --git a/app/mobile/src/session/settings/Settings.styled.js b/app/mobile/src/session/settings/Settings.styled.js index 6423d027..e6351546 100644 --- a/app/mobile/src/session/settings/Settings.styled.js +++ b/app/mobile/src/session/settings/Settings.styled.js @@ -2,6 +2,19 @@ import { StyleSheet } from 'react-native'; import { Colors } from 'constants/Colors'; export const styles = StyleSheet.create({ + drawerDivider: { + width: '80%', + borderWidth: 1, + borderColor: Colors.areaBase, + marginTop: 16, + }, + drawerEntry: { + width: '80%', + display: 'flex', + alignItems: 'center', + flexDirection: 'row', + padding: 8, + }, content: { width: '100%', height: '100%', diff --git a/app/mobile/src/session/settings/useSettings.hook.js b/app/mobile/src/session/settings/useSettings.hook.js index 4e6293d9..c701ebda 100644 --- a/app/mobile/src/session/settings/useSettings.hook.js +++ b/app/mobile/src/session/settings/useSettings.hook.js @@ -289,6 +289,7 @@ export function useSettings() { promptLogout: () => { display.actions.showPrompt({ title: state.strings.loggingOut, + centerButtons: true, ok: { label: state.strings.confirmLogout, action: app.actions.logout, failed: () => { Alert.alert( state.strings.error, diff --git a/app/mobile/src/utils/Prompt.jsx b/app/mobile/src/utils/Prompt.jsx index 6ad74bb8..69a54ed7 100644 --- a/app/mobile/src/utils/Prompt.jsx +++ b/app/mobile/src/utils/Prompt.jsx @@ -45,7 +45,7 @@ export function Prompt() { { display.state.prompt?.title } - + { display.state.prompt?.cancel && ( { display.state.prompt?.cancel?.label } diff --git a/app/mobile/src/utils/Prompt.styled.js b/app/mobile/src/utils/Prompt.styled.js index 85921a8a..b0588a9a 100644 --- a/app/mobile/src/utils/Prompt.styled.js +++ b/app/mobile/src/utils/Prompt.styled.js @@ -98,5 +98,15 @@ export const styles = StyleSheet.create({ justifyContent: 'flex-end', flexDirection: 'row', }, + centerModalButtons: { + width: '100%', + paddingLeft: 16, + paddingRight: 16, + paddingTop: 16, + display: 'flex', + alignItems: 'flex-end', + justifyContent: 'center', + flexDirection: 'row', + }, });