diff --git a/app/mobile/src/constants/Colors.js b/app/mobile/src/constants/Colors.js index c19185f7..ca846ce3 100644 --- a/app/mobile/src/constants/Colors.js +++ b/app/mobile/src/constants/Colors.js @@ -17,6 +17,7 @@ const LightColors = { descriptionText: '#888888', text: '#444444', screenBase: '#dddddd', + drawerBase: '#eeeeee', areaBase: '#ffffff', modalBase: '#ffffff', modalOverlay: 'rgba(52,52,52,0.8)', @@ -69,6 +70,7 @@ const DarkColors = { descriptionText: '#bbbbbb', text: '#ffffff', screenBase: '#222222', + drawerBase: '#333333', areaBase: '#444444', modalBase: '#111111', modalOverlay: 'rgba(88,88,88,0.8)', @@ -124,6 +126,7 @@ export const Colors = { descriptionText: getColor('descriptionText'), text: getColor('text'), screenBase: getColor('screenBase'), + drawerBase: getColor('drawerBase'), areaBase: getColor('areaBase'), modalOverlay: getColor('modalOverlay'), modalBase: getColor('modalBase'), diff --git a/app/mobile/src/session/Session.jsx b/app/mobile/src/session/Session.jsx index 1a4a3170..034fd836 100644 --- a/app/mobile/src/session/Session.jsx +++ b/app/mobile/src/session/Session.jsx @@ -11,6 +11,7 @@ import { useSession } from './useSession.hook'; import { styles } from './Session.styled'; import Colors from 'constants/Colors'; import { Profile } from './profile/Profile'; +import { ProfileSettings } from './profileSettings/ProfileSettings'; import { CardsHeader, CardsBody, Cards } from './cards/Cards'; import { RegistryHeader, RegistryBody, Registry } from './registry/Registry'; import { ContactHeader, ContactBody, Contact } from './contact/Contact'; @@ -433,7 +434,7 @@ export function Session({ sharing, clearSharing }) { { state.tabbed === false && ( ( - + )}> {(props) => } diff --git a/app/mobile/src/session/Session.styled.js b/app/mobile/src/session/Session.styled.js index d6b2dbe6..ff1ad439 100644 --- a/app/mobile/src/session/Session.styled.js +++ b/app/mobile/src/session/Session.styled.js @@ -95,7 +95,7 @@ export const styles = StyleSheet.create({ paddingTop: 8, paddingLeft: 8, paddingRight: 8, - backgroundColor: Colors.formBackground, + backgroundColor: Colors.drawerBase, }, options: { display: 'flex', diff --git a/app/mobile/src/session/profile/Profile.jsx b/app/mobile/src/session/profile/Profile.jsx index 1b6e93a9..4c7b67d1 100644 --- a/app/mobile/src/session/profile/Profile.jsx +++ b/app/mobile/src/session/profile/Profile.jsx @@ -13,7 +13,7 @@ import { useProfile } from './useProfile.hook'; import { styles } from './Profile.styled'; import avatar from 'images/avatar.png'; -export function Profile() { +export function Profile({ drawer }) { const [busyDetail, setBusyDetail] = useState(false); const { state, actions } = useProfile(); @@ -71,79 +71,87 @@ export function Profile() { } return ( - - - - - - - - - - - { state.strings.edit } - - - - - - { state.strings.editImage } - - - { state.strings.editDetails } - - - - - - - - - { state.name && ( - { state.name } - )} - { !state.name && ( - { state.strings.name } - )} - - { state.username } - - - - - { state.location && ( - { state.location } - )} - { !state.location && ( - Location - )} - - - - - - { state.description && ( - { state.description } - )} - { !state.description && ( - Description - )} + <> + { drawer && ( + + { state.username } + + + + { state.strings.edit } + - + - - - - - setVisible(!state.searchable)}> - { state.strings.visibleRegistry } - - - + )} + { !drawer && ( + + + + + + + + + { state.strings.edit } + + + + + + { state.strings.editImage } + + + { state.strings.editDetails } + + + + + + { state.name && ( + { state.name } + )} + { !state.name && ( + { state.strings.name } + )} + { state.username } + + + + { state.location && ( + { state.location } + )} + { !state.location && ( + Location + )} + + + + + + { state.description && ( + { state.description } + )} + { !state.description && ( + Description + )} + + + + + + + setVisible(!state.searchable)}> + { state.strings.visibleRegistry } + + + + + + - - + )} - - + ); } diff --git a/app/mobile/src/session/profile/Profile.styled.js b/app/mobile/src/session/profile/Profile.styled.js index aa923585..94cccb58 100644 --- a/app/mobile/src/session/profile/Profile.styled.js +++ b/app/mobile/src/session/profile/Profile.styled.js @@ -2,6 +2,43 @@ import { StyleSheet } from 'react-native'; import { Colors } from 'constants/Colors'; export const styles = StyleSheet.create({ + drawerContainer: { + width: '100%', + display: 'flex', + alignItems: 'center', + }, + drawerHeader: { + fontFamily: 'roboto', + color: Colors.text, + fontSize: 20, + padding: 16, + }, + drawerFrame: { + width: '50%', + maxWidth: 400, + paddingBottom: 16, + }, + drawerLogo: { + aspectRatio: 1, + resizeMode: 'contain', + borderRadius: 8, + width: null, + height: null, + }, + drawerLogoEdit: { + position: 'absolute', + top: 0, + display: 'flex', + flexDirection: 'row', + alignItems: 'center', + alignSelf: 'center', + backgroundColor: 'rgba(255,255,255,0.6)', + paddingLeft: 8, + paddingRight: 8, + borderBottomLeftRadius: 6, + borderBottomRightRadius: 6, + }, + container: { width: '100%', height: '100%', diff --git a/app/mobile/src/session/profile/blockedContacts/BlockedContacts.jsx b/app/mobile/src/session/profile/blockedContacts/BlockedContacts.jsx deleted file mode 100644 index e8c0df4b..00000000 --- a/app/mobile/src/session/profile/blockedContacts/BlockedContacts.jsx +++ /dev/null @@ -1,48 +0,0 @@ -import { FlatList, View, Alert, TouchableOpacity, Text } from 'react-native'; -import { styles } from './BlockedContacts.styled'; -import { useBlockedContacts } from './useBlockedContacts.hook'; -import { Logo } from 'utils/Logo'; - -export function BlockedContacts() { - - const { state, actions } = useBlockedContacts(); - - const unblock = (cardId) => { - Alert.alert( - 'Unblocking Contact', - 'Confirm?', - [ - { text: "Cancel", onPress: () => {}, }, - { text: "Unblock", onPress: () => actions.unblock(cardId) }, - ], - ); - }; - - const BlockedItem = ({ item }) => { - return ( - unblock(item.cardId)}> - - - { item.name } - { item.handle } - - - ) - } - - return ( - - { state.cards.length === 0 && ( - No Blocked Contacts - )} - { state.cards.length !== 0 && ( - } - keyExtractor={item => item.cardId} - /> - )} - - ); -} - diff --git a/app/mobile/src/session/profile/blockedContacts/BlockedContacts.styled.js b/app/mobile/src/session/profile/blockedContacts/BlockedContacts.styled.js deleted file mode 100644 index 18a5c33d..00000000 --- a/app/mobile/src/session/profile/blockedContacts/BlockedContacts.styled.js +++ /dev/null @@ -1,43 +0,0 @@ -import { StyleSheet } from 'react-native'; -import { Colors } from 'constants/Colors'; - -export const styles = StyleSheet.create({ - container: { - backgroundColor: Colors.white, - display: 'flex', - width: '100%', - justifyContent: 'center', - fontSize: 14, - height: 200, - }, - default: { - textAlign: 'center', - color: Colors.grey, - }, - item: { - width: '100%', - display: 'flex', - flexDirection: 'row', - height: 48, - paddingLeft: 16, - alignItems: 'center', - borderBottomWidth: 1, - borderColor: Colors.itemDivider, - }, - detail: { - paddingLeft: 12, - display: 'flex', - flexDirection: 'column', - justifyContent: 'center', - flexGrow: 1, - flexShrink: 1, - }, - name: { - color: Colors.text, - fontSize: 14, - }, - handle: { - color: Colors.text, - fontSize: 12, - }, -}); diff --git a/app/mobile/src/session/profile/blockedContacts/useBlockedContacts.hook.js b/app/mobile/src/session/profile/blockedContacts/useBlockedContacts.hook.js deleted file mode 100644 index cd860c10..00000000 --- a/app/mobile/src/session/profile/blockedContacts/useBlockedContacts.hook.js +++ /dev/null @@ -1,53 +0,0 @@ -import { useState, useEffect, useContext } from 'react'; -import { CardContext } from 'context/CardContext'; - -export function useBlockedContacts() { - - const [state, setState] = useState({ - cards: [], - }); - - const card = useContext(CardContext); - - const updateState = (value) => { - setState((s) => ({ ...s, ...value })); - } - - const setCardItem = (item) => { - const { profile } = item; - return { - cardId: item.cardId, - name: profile?.name, - handle: `${profile?.handle}@${profile?.node}`, - blocked: item.blocked, - logo: profile?.imageSet ? card.actions.getCardImageUrl(item.cardId) : 'avatar', - } - }; - - useEffect(() => { - const cards = Array.from(card.state.cards.values()); - const items = cards.map(setCardItem); - const filtered = items.filter(item => { - return item.blocked; - }); - filtered.sort((a, b) => { - if (a.name === b.name) { - return 0; - } - if (!a.name || (a.name < b.name)) { - return -1; - } - return 1; - }); - updateState({ cards: filtered }); - }, [card.state]); - - const actions = { - unblock: async (cardId) => { - await card.actions.clearCardFlag(cardId); - } - }; - - return { state, actions }; -} - diff --git a/app/mobile/src/session/profile/blockedMessages/BlockedMessages.jsx b/app/mobile/src/session/profile/blockedMessages/BlockedMessages.jsx deleted file mode 100644 index 4160eaf4..00000000 --- a/app/mobile/src/session/profile/blockedMessages/BlockedMessages.jsx +++ /dev/null @@ -1,47 +0,0 @@ -import { FlatList, View, Alert, TouchableOpacity, Text } from 'react-native'; -import { styles } from './BlockedMessages.styled'; -import { useBlockedMessages } from './useBlockedMessages.hook'; -import { Logo } from 'utils/Logo'; - -export function BlockedMessages() { - - const { state, actions } = useBlockedMessages(); - - const unblock = (cardId, channelId, topicId) => { - Alert.alert( - 'Unblocking Message', - 'Confirm?', - [ - { text: "Cancel", onPress: () => {}, }, - { text: "Unblock", onPress: () => actions.unblock(cardId, channelId, topicId) }, - ], - ); - }; - - const BlockedItem = ({ item }) => { - return ( - unblock(item.cardId, item.channelId, item.topicId)}> - - { item.name } - { item.timestamp } - - - ) - } - - return ( - - { state.messages.length === 0 && ( - No Blocked Messages - )} - { state.messages.length !== 0 && ( - } - keyExtractor={item => item.id} - /> - )} - - ); -} - diff --git a/app/mobile/src/session/profile/blockedMessages/BlockedMessages.styled.js b/app/mobile/src/session/profile/blockedMessages/BlockedMessages.styled.js deleted file mode 100644 index c29efdcb..00000000 --- a/app/mobile/src/session/profile/blockedMessages/BlockedMessages.styled.js +++ /dev/null @@ -1,46 +0,0 @@ -import { StyleSheet } from 'react-native'; -import { Colors } from 'constants/Colors'; - -export const styles = StyleSheet.create({ - container: { - backgroundColor: Colors.white, - display: 'flex', - width: '100%', - justifyContent: 'center', - fontSize: 14, - height: 200, - }, - default: { - textAlign: 'center', - color: Colors.grey, - }, - item: { - width: '100%', - display: 'flex', - flexDirection: 'row', - height: 32, - paddingLeft: 16, - alignItems: 'center', - borderBottomWidth: 1, - borderColor: Colors.itemDivider, - }, - detail: { - paddingLeft: 12, - display: 'flex', - flexDirection: 'row', - justifyContent: 'center', - width: '100%', - }, - name: { - color: Colors.text, - fontSize: 14, - flexGrow: 1, - flexShrink: 1, - minWidth: 0, - }, - created: { - color: Colors.text, - fontSize: 12, - paddingRight: 16, - }, -}); diff --git a/app/mobile/src/session/profile/blockedMessages/useBlockedMessages.hook.js b/app/mobile/src/session/profile/blockedMessages/useBlockedMessages.hook.js deleted file mode 100644 index 23893bf5..00000000 --- a/app/mobile/src/session/profile/blockedMessages/useBlockedMessages.hook.js +++ /dev/null @@ -1,121 +0,0 @@ -import { useState, useEffect, useContext } from 'react'; -import { StoreContext } from 'context/StoreContext'; -import { ChannelContext } from 'context/ChannelContext'; -import { CardContext } from 'context/CardContext'; -import { ProfileContext } from 'context/ProfileContext'; -import { getCardByGuid } from 'context/cardUtil'; -import moment from 'moment'; - -export function useBlockedMessages() { - - const [state, setState] = useState({ - messages: [] - }); - - const store = useContext(StoreContext); - const card = useContext(CardContext); - const channel = useContext(ChannelContext); - const profile = useContext(ProfileContext); - - const updateState = (value) => { - setState((s) => ({ ...s, ...value })); - } - - const setTopicItem = (cardId, channelId, topic) => { - let name, nameSet - if (topic.detail.guid === profile.state.identity.guid) { - const identity = profile.state.identity; - if (identity.name) { - name = identity.name; - } - else { - name = `${identity.handle}@${identity.node}`; - } - nameSet = true; - } - else { - const contact = getCardByGuid(card.state.cards, topic.detail.guid); - if (contact) { - if (contact?.card?.profile?.name) { - name = contact.card.profile.name; - } - else { - name = `${contact.card.profile.handle}@${contact.card.profile.node}`; - } - nameSet = true; - } - else { - name = 'unknown'; - nameSet = false; - } - } - - let timestamp; - const date = new Date(topic.detail.created * 1000); - const now = new Date(); - const offset = now.getTime() - date.getTime(); - if(offset < 86400000) { - timestamp = moment(date).format('h:mma'); - } - else if (offset < 31449600000) { - timestamp = moment(date).format('M/DD'); - } - else { - timestamp = moment(date).format('M/DD/YYYY'); - } - - const { topicId } = topic; - return { name, nameSet, timestamp, cardId, channelId, topicId, id: `${cardId}:${channelId}:${topicId}` }; - }; - - const loadBlocked = async () => { - const channels = []; - channel.state.channels.forEach((channelItem, channelId, map) => { - channels.push({ channelId }); - }); - card.state.cards.forEach((cardItem, cardId, map) => { - cardItem.channels.forEach((channelItem, channelId, map) => { - channels.push({ cardId, channelId }); - }); - }); - - const merged = []; - for(let i = 0; i < channels.length; i++) { - let topics; - const { cardId, channelId } = channels[i]; - if (cardId) { - topics = await card.actions.getTopicItems(cardId, channelId); - } - else { - topics = await channel.actions.getTopicItems(channelId); - } - topics.forEach((topic) => { - if (topic.blocked) { - merged.push(setTopicItem(cardId, channelId, topic)); - } - }); - } - - updateState({ messages: merged }); - }; - - useEffect(() => { - loadBlocked(); - }, []); - - const actions = { - unblock: async (cardId, channelId, topicId) => { - const id = `${cardId}:${channelId}:${topicId}`; - if (cardId) { - card.actions.clearTopicFlag(cardId, channelId, topicId); - } - else { - channel.actions.clearTopicFlag(channelId, topicId); - } - updateState({ messages: state.messages.filter(item => item.id !== id) }); - } - }; - - return { state, actions }; -} - diff --git a/app/mobile/src/session/profile/blockedTopics/BlockedTopics.jsx b/app/mobile/src/session/profile/blockedTopics/BlockedTopics.jsx deleted file mode 100644 index cb788d41..00000000 --- a/app/mobile/src/session/profile/blockedTopics/BlockedTopics.jsx +++ /dev/null @@ -1,47 +0,0 @@ -import { FlatList, View, Alert, TouchableOpacity, Text } from 'react-native'; -import { styles } from './BlockedTopics.styled'; -import { useBlockedTopics } from './useBlockedTopics.hook'; -import { Logo } from 'utils/Logo'; - -export function BlockedTopics() { - - const { state, actions } = useBlockedTopics(); - - const unblock = (cardId, channelId) => { - Alert.alert( - 'Unblocking Contact', - 'Confirm?', - [ - { text: "Cancel", onPress: () => {}, }, - { text: "Unblock", onPress: () => actions.unblock(cardId, channelId) }, - ], - ); - }; - - const BlockedItem = ({ item }) => { - return ( - unblock(item.cardId, item.channelId)}> - - { item.name } - { item.created } - - - ) - } - - return ( - - { state.channels.length === 0 && ( - No Blocked Topics - )} - { state.channels.length !== 0 && ( - } - keyExtractor={item => item.id} - /> - )} - - ); -} - diff --git a/app/mobile/src/session/profile/blockedTopics/BlockedTopics.styled.js b/app/mobile/src/session/profile/blockedTopics/BlockedTopics.styled.js deleted file mode 100644 index c29efdcb..00000000 --- a/app/mobile/src/session/profile/blockedTopics/BlockedTopics.styled.js +++ /dev/null @@ -1,46 +0,0 @@ -import { StyleSheet } from 'react-native'; -import { Colors } from 'constants/Colors'; - -export const styles = StyleSheet.create({ - container: { - backgroundColor: Colors.white, - display: 'flex', - width: '100%', - justifyContent: 'center', - fontSize: 14, - height: 200, - }, - default: { - textAlign: 'center', - color: Colors.grey, - }, - item: { - width: '100%', - display: 'flex', - flexDirection: 'row', - height: 32, - paddingLeft: 16, - alignItems: 'center', - borderBottomWidth: 1, - borderColor: Colors.itemDivider, - }, - detail: { - paddingLeft: 12, - display: 'flex', - flexDirection: 'row', - justifyContent: 'center', - width: '100%', - }, - name: { - color: Colors.text, - fontSize: 14, - flexGrow: 1, - flexShrink: 1, - minWidth: 0, - }, - created: { - color: Colors.text, - fontSize: 12, - paddingRight: 16, - }, -}); diff --git a/app/mobile/src/session/profile/blockedTopics/useBlockedTopics.hook.js b/app/mobile/src/session/profile/blockedTopics/useBlockedTopics.hook.js deleted file mode 100644 index 8f4ace38..00000000 --- a/app/mobile/src/session/profile/blockedTopics/useBlockedTopics.hook.js +++ /dev/null @@ -1,92 +0,0 @@ -import { useState, useEffect, useContext } from 'react'; -import { CardContext } from 'context/CardContext'; -import { ChannelContext } from 'context/ChannelContext'; -import { ProfileContext } from 'context/ProfileContext'; -import { getCardByGuid } from 'context/cardUtil'; -import { getChannelSubjectLogo } from 'context/channelUtil'; -import moment from 'moment'; - -export function useBlockedTopics() { - - const [state, setState] = useState({ - channels: [] - }); - - const profile = useContext(ProfileContext); - const card = useContext(CardContext); - const channel = useContext(ChannelContext); - - const updateState = (value) => { - setState((s) => ({ ...s, ...value })); - } - - const getCard = (guid) => { - let contact = null - card.state.cards.forEach((card, cardId, map) => { - if (card?.profile?.guid === guid) { - contact = card; - } - }); - return contact; - } - - const setChannelItem = (item) => { - let timestamp; - const date = new Date(item.channel.detail.created * 1000); - const now = new Date(); - const offset = now.getTime() - date.getTime(); - if(offset < 86400000) { - timestamp = moment(date).format('h:mma'); - } - else if (offset < 31449600000) { - timestamp = moment(date).format('M/DD'); - } - else { - timestamp = moment(date).format('M/DD/YYYY'); - } - - - const profileGuid = profile.state?.identity?.guid; - const { logo, subject } = getChannelSubjectLogo(item.cardId, profileGuid, item.channel, card.state.cards, card.actions.getCardImageUrl); - - return { - id: `${item.cardId}:${item.channel.channelId}`, - cardId: item.cardId, - channelId: item.channel.channelId, - name: subject, - created: timestamp, - } - }; - - useEffect(() => { - let merged = []; - card.state.cards.forEach((cardItem, cardId, map) => { - cardItem.channels.forEach((channelItem) => { - if (channelItem.blocked) { - merged.push({ cardId, channel: channelItem }); - } - }); - }); - channel.state.channels.forEach((channelItem, channelId, map) => { - if (channelItem.blocked) { - merged.push({ channel: channelItem }); - } - }); - const items = merged.map(setChannelItem); - updateState({ channels: items }); - }, [card.state, channel.state]); - - const actions = { - unblock: async (cardId, channelId) => { - if (cardId) { - await card.actions.clearChannelFlag(cardId, channelId); - } - else { - await channel.actions.clearChannelFlag(channelId); - } - } - }; - - return { state, actions }; -} - diff --git a/app/mobile/src/session/profile/useProfile.hook.js b/app/mobile/src/session/profile/useProfile.hook.js index ebe952bd..ff549d22 100644 --- a/app/mobile/src/session/profile/useProfile.hook.js +++ b/app/mobile/src/session/profile/useProfile.hook.js @@ -49,7 +49,7 @@ export function useProfile() { useEffect(() => { const { name, handle, node, location, description, image } = profile.state.identity; const imageSource = image ? { uri: profile.state.imageUrl } : avatar; - const username = `${handle} / ${node}` + const username = `${handle}/${node}` updateState({ name, username, location, description, imageSource }); }, [profile.state]); diff --git a/app/mobile/src/session/profileSettings/ProfileSettings.jsx b/app/mobile/src/session/profileSettings/ProfileSettings.jsx new file mode 100644 index 00000000..570a9d48 --- /dev/null +++ b/app/mobile/src/session/profileSettings/ProfileSettings.jsx @@ -0,0 +1,18 @@ +import { ScrollView, View } from 'react-native'; +import { Profile } from '../profile/Profile'; +import { Settings } from '../settings/Settings'; +import { styles } from './ProfileSettings.styled'; +import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'; + +export function ProfileSettings() { + + return ( + + + + + + + ); +} + diff --git a/app/mobile/src/session/profileSettings/ProfileSettings.styled.js b/app/mobile/src/session/profileSettings/ProfileSettings.styled.js new file mode 100644 index 00000000..e5a3030b --- /dev/null +++ b/app/mobile/src/session/profileSettings/ProfileSettings.styled.js @@ -0,0 +1,15 @@ +import { StyleSheet } from 'react-native'; +import { Colors } from 'constants/Colors'; + +export const styles = StyleSheet.create({ + drawer: { + width: '100%', + height: '100%', + backgroundColor: Colors.drawerBase, + }, + container: { + display: 'flex', + alignItems: 'center', + }, +}); + diff --git a/app/mobile/src/session/settings/Settings.jsx b/app/mobile/src/session/settings/Settings.jsx index ec10d24b..4e24603a 100644 --- a/app/mobile/src/session/settings/Settings.jsx +++ b/app/mobile/src/session/settings/Settings.jsx @@ -10,7 +10,7 @@ import { BlurView } from "@react-native-community/blur"; import { InputField } from 'utils/InputField'; import { Logo } from 'utils/Logo'; -export function Settings() { +export function Settings({ drawer }) { const navigate = useNavigate(); const [ busy, setBusy ] = useState(false); @@ -161,585 +161,592 @@ export function Settings() { }; return ( - - + <> + { drawer && ( + SETTINGS DRAWER + )} + { !drawer && ( + + - { state.strings.messaging } - - - - - - - setNotifications(!state.pushEnabled)}> - { state.strings.enableNotifications } + { state.strings.messaging } + + + + + + + setNotifications(!state.pushEnabled)}> + { state.strings.enableNotifications } + + + - - - - - - - - - - { state.sealEnabled && ( - { state.strings.manageTopics } - )} - { !state.sealEnabled && ( - { state.strings.enableTopics } - )} - - - - - { state.strings.display } - - - - - - - { state.strings.hourMode } - actions.setTimeFull(false)}> - { !state.timeFull && ( - - )} - { state.timeFull && ( - - )} - { state.strings.timeHalf } - - actions.setTimeFull(true)}> - { state.timeFull && ( - - )} - { !state.timeFull && ( - - )} - { state.strings.timeFull } + + + + + + + { state.sealEnabled && ( + { state.strings.manageTopics } + )} + { !state.sealEnabled && ( + { state.strings.enableTopics } + )} + - - - - - - - - { state.strings.dateMode } - actions.setMonthLast(false)}> - { !state.monthLast && ( - - )} - { state.monthLast && ( - - )} - { state.strings.monthStart } - - actions.setMonthLast(true)}> - { state.monthLast && ( - - )} - { !state.monthLast && ( - - )} - { state.strings.monthEnd } - - - - - - { state.strings.account } - - - - - - - { state.strings.logout } - - - - - - - - - { state.strings.changeLogin } - - - - - - - - - { state.strings.deleteAccount } - - - - - { state.strings.blocked } - - - - - - - { state.strings.contacts } - - - - - - - - - { state.strings.topics } - - - - - - - - - { state.strings.messages } - - - - - { state.strings.support } - - Linking.openURL('https://github.com/balzack/databag/discussions')}> - - - - - github.com/balzack/databag - - - - - - - - - - - - - - + { state.strings.display } + + + + + + + { state.strings.hourMode } + actions.setTimeFull(false)}> + { !state.timeFull && ( + + )} + { state.timeFull && ( + + )} + { state.strings.timeHalf } + + actions.setTimeFull(true)}> + { state.timeFull && ( + + )} + { !state.timeFull && ( + + )} + { state.strings.timeFull } - { state.strings.sealedTopics } - { !state.sealEnabled && ( - <> - { state.strings.sealUnset } + + + + + + + + { state.strings.dateMode } + actions.setMonthLast(false)}> + { !state.monthLast && ( + + )} + { state.monthLast && ( + + )} + { state.strings.monthStart } + + actions.setMonthLast(true)}> + { state.monthLast && ( + + )} + { !state.monthLast && ( + + )} + { state.strings.monthEnd } + + + + + - - - { state.sealPassword && ( - sealAction(actions.generateKey)}> - { busy && ( - - )} - { !busy && ( - { state.strings.generate } - )} - - )} - { !state.sealPassword && ( - - { state.strings.generate } - - )} - { state.strings.delayMessage } - - )} - { state.sealEnabled && !state.sealUnlocked && !state.sealRemove && ( - <> - { state.strings.sealLocked } + { state.strings.account } + + + + + + + { state.strings.logout } + + + + + + + + + { state.strings.changeLogin } + + + + + + + + + { state.strings.deleteAccount } + + + - + { state.strings.blocked } + + + + + + + { state.strings.contacts } + + + + + + + + + { state.strings.topics } + + + + + + + + + { state.strings.messages } + + + - { state.sealPassword && ( - sealAction(actions.unlockKey)}> - { busy && ( - - )} - { !busy && ( - { state.strings.unlock } - )} - - )} - { !state.sealPassword && ( - - { state.strings.unlock } - - )} - - { state.strings.removeSeal } - - - )} - { state.sealEnabled && state.sealUnlocked && !state.sealRemove && !state.sealUpdate && ( - <> - { state.strings.sealUnlocked } - sealAction(actions.disableKey)}> + { state.strings.support } + + Linking.openURL('https://github.com/balzack/databag/discussions')}> + + + + + github.com/balzack/databag + + + + + + + + )} + + + + + + + + + + + + { state.strings.sealedTopics } + { !state.sealEnabled && ( + <> + { state.strings.sealUnset } + + + + { state.sealPassword && ( + sealAction(actions.generateKey)}> { busy && ( )} { !busy && ( - { state.strings.disable } + { state.strings.generate } )} - - { state.strings.changeKey } - - - { state.strings.removeSeal } - - - )} - { state.sealEnabled && state.sealRemove && ( - <> - { state.strings.sealDelete } - - { state.sealDelete === state.strings.deleteKey && ( - sealAction(actions.removeKey)}> - { busy && ( - - )} - { !busy && ( - { state.strings.delete } - )} - - )} - { state.sealDelete !== state.strings.deleteKey && ( - - { state.strings.delete } - - )} - - { state.sealUnlocked && ( - { state.strings.disableSeal } - )} - { !state.sealUnlocked && ( - { state.strings.unlockSeal } - )} - - - )} - { state.sealEnabled && state.sealUnlocked && state.sealUpdate && ( - <> - { state.strings.changePassword } - - - - { state.sealPassword && ( - sealAction(actions.updateKey)}> - { busy && ( - - )} - { !busy && ( - { state.strings.update } - )} - - )} - { !state.sealPassword && ( - - { state.strings.update } - - )} - - { state.sealUnlocked && ( - { state.strings.disableSeal } - )} - { !state.sealUnlocked && ( - { state.strings.unlockSeal } - )} - - - )} - - - - - - - - - - - - - - - - { state.strings.changeLogin } - - - { state.strings.changeMessage } - - - - - - - { state.validated && !state.available && ( - { state.strings.notAvailable } )} - - - - { state.strings.cancel } - - { (!state.available || !state.password || !state.validated || !state.username) && ( + { !state.sealPassword && ( - { state.strings.update } + { state.strings.generate } )} - { state.available && state.password && state.validated && state.username && ( - - { state.strings.update } - - )} - - - - - - - - - - - - - - - - - { state.strings.deleteAccount } - + { state.strings.delayMessage } + + )} + { state.sealEnabled && !state.sealUnlocked && !state.sealRemove && ( + <> + { state.strings.sealLocked } - - - - { state.confirm === state.strings.deleteKey && ( - - { state.strings.delete } + + + { state.sealPassword && ( + sealAction(actions.unlockKey)}> + { busy && ( + + )} + { !busy && ( + { state.strings.unlock } + )} )} - { state.confirm !== state.strings.deleteKey && ( + { !state.sealPassword && ( + + { state.strings.unlock } + + )} + + { state.strings.removeSeal } + + + )} + { state.sealEnabled && state.sealUnlocked && !state.sealRemove && !state.sealUpdate && ( + <> + { state.strings.sealUnlocked } + sealAction(actions.disableKey)}> + { busy && ( + + )} + { !busy && ( + { state.strings.disable } + )} + + + { state.strings.changeKey } + + + { state.strings.removeSeal } + + + )} + { state.sealEnabled && state.sealRemove && ( + <> + { state.strings.sealDelete } + + { state.sealDelete === state.strings.deleteKey && ( + sealAction(actions.removeKey)}> + { busy && ( + + )} + { !busy && ( + { state.strings.delete } + )} + + )} + { state.sealDelete !== state.strings.deleteKey && ( { state.strings.delete } )} - - - - - - - - - - - - - - + + { state.sealUnlocked && ( + { state.strings.disableSeal } + )} + { !state.sealUnlocked && ( + { state.strings.unlockSeal } + )} - - { state.strings.blockedContacts } - - - { state.contacts.length === 0 && ( - - { state.strings.noBlockedContacts } + + )} + { state.sealEnabled && state.sealUnlocked && state.sealUpdate && ( + <> + { state.strings.changePassword } + + + + { state.sealPassword && ( + sealAction(actions.updateKey)}> + { busy && ( + + )} + { !busy && ( + { state.strings.update } + )} + + )} + { !state.sealPassword && ( + + { state.strings.update } )} - { state.contacts.length !== 0 && ( - item.cardId} - /> - )} - - - - { state.strings.close } + + { state.sealUnlocked && ( + { state.strings.disableSeal } + )} + { !state.sealUnlocked && ( + { state.strings.unlockSeal } + )} - + + )} + + + + + + + + + + + + + + + + { state.strings.changeLogin } + + + { state.strings.changeMessage } + + + + + + + { state.validated && !state.available && ( + { state.strings.notAvailable } + )} + + + + { state.strings.cancel } + + { (!state.available || !state.password || !state.validated || !state.username) && ( + + { state.strings.update } + + )} + { state.available && state.password && state.validated && state.username && ( + + { state.strings.update } + + )} + + + + + + + + + + + + + + + + + { state.strings.deleteAccount } + + + + + + { state.confirm === state.strings.deleteKey && ( + + { state.strings.delete } + + )} + { state.confirm !== state.strings.deleteKey && ( + + { state.strings.delete } + + )} + + + + + + + + + + + + + + + + + { state.strings.blockedContacts } + + + { state.contacts.length === 0 && ( + + { state.strings.noBlockedContacts } + + )} + { state.contacts.length !== 0 && ( + item.cardId} + /> + )} + + + + { state.strings.close } + - - - - - - - - - - - - - { state.strings.blockedTopics } - - - { state.topics.length === 0 && ( - - { state.strings.noBlockedTopics } - - )} - { state.topics.length !== 0 && ( - `${item.cardId}.${item.channelId}`} - /> - )} - - - - { state.strings.close } - - + + + + + + + + + + + + + + { state.strings.blockedTopics } + + + { state.topics.length === 0 && ( + + { state.strings.noBlockedTopics } + + )} + { state.topics.length !== 0 && ( + `${item.cardId}.${item.channelId}`} + /> + )} + + + + { state.strings.close } + - - - - - - - - - - - - - { state.strings.blockedMessages } - - - { state.messages.length === 0 && ( - - { state.strings.noBlockedMessages } - - )} - { state.messages.length !== 0 && ( - `${item.cardId}.${item.channelId}.${item.topicId}`} - /> - )} - - - - { state.strings.close } - - + + + + + + + + + + + + + + { state.strings.blockedMessages } + + + { state.messages.length === 0 && ( + + { state.strings.noBlockedMessages } + + )} + { state.messages.length !== 0 && ( + `${item.cardId}.${item.channelId}.${item.topicId}`} + /> + )} + + + + { state.strings.close } + - - - - + + + + ); }