updating layout for ios

This commit is contained in:
balzack 2022-10-22 22:40:40 -07:00
parent 9f7fecdf9f
commit 1e6143ac07
10 changed files with 36 additions and 31 deletions

View File

@ -310,7 +310,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 15; CURRENT_PROJECT_VERSION = 16;
DEVELOPMENT_TEAM = 3P65PQ7SUR; DEVELOPMENT_TEAM = 3P65PQ7SUR;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
@ -348,7 +348,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 15; CURRENT_PROJECT_VERSION = 16;
DEVELOPMENT_TEAM = 3P65PQ7SUR; DEVELOPMENT_TEAM = 3P65PQ7SUR;
INFOPLIST_FILE = Databag/Info.plist; INFOPLIST_FILE = Databag/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Databag; INFOPLIST_KEY_CFBundleDisplayName = Databag;

View File

@ -1,4 +1,4 @@
import { ActivityIndicator, Alert, Text, TextInput, View, TouchableOpacity } from 'react-native'; import { KeyboardAvoidingView, ActivityIndicator, Alert, Text, TextInput, View, TouchableOpacity } from 'react-native';
import { styles } from './Admin.styled'; import { styles } from './Admin.styled';
import Ionicons from '@expo/vector-icons/AntDesign'; import Ionicons from '@expo/vector-icons/AntDesign';
import { useAdmin } from './useAdmin.hook'; import { useAdmin } from './useAdmin.hook';
@ -21,7 +21,7 @@ export function Admin() {
} }
return ( return (
<View style={styles.wrapper}> <KeyboardAvoidingView style={styles.wrapper} behavior="padding" enabled={Platform.OS === 'ios' ? true : false}>
<View style={styles.container}> <View style={styles.container}>
<View style={styles.control}> <View style={styles.control}>
<TouchableOpacity onPress={actions.login}> <TouchableOpacity onPress={actions.login}>
@ -70,6 +70,6 @@ export function Admin() {
)} )}
</View> </View>
</View> </View>
</View> </KeyboardAvoidingView>
); );
} }

View File

@ -1,4 +1,4 @@
import { ScrollView, ActivityIndicator, Alert, Text, TextInput, View, TouchableOpacity } from 'react-native'; import { KeyboardAvoidingView, ScrollView, ActivityIndicator, Alert, Text, TextInput, View, TouchableOpacity } from 'react-native';
import { styles } from './Create.styled'; import { styles } from './Create.styled';
import Ionicons from '@expo/vector-icons/AntDesign'; import Ionicons from '@expo/vector-icons/AntDesign';
import { useCreate } from './useCreate.hook'; import { useCreate } from './useCreate.hook';
@ -25,7 +25,7 @@ export function Create() {
const validUsername = (state.username && state.usernameChecked && state.usernameValid); const validUsername = (state.username && state.usernameChecked && state.usernameValid);
return ( return (
<View style={styles.wrapper}> <KeyboardAvoidingView style={styles.wrapper} behavior="padding" enabled={Platform.OS === 'ios' ? true : false}>
<View style={styles.container}> <View style={styles.container}>
<View style={styles.control}> <View style={styles.control}>
<TouchableOpacity onPress={actions.config}> <TouchableOpacity onPress={actions.config}>
@ -154,6 +154,6 @@ export function Create() {
</View> </View>
</ScrollView> </ScrollView>
</View> </View>
</View> </KeyboardAvoidingView>
); );
} }

View File

@ -1,4 +1,4 @@
import { ActivityIndicator, Alert, Text, TextInput, View, TouchableOpacity } from 'react-native'; import { KeyboardAvoidingView, ActivityIndicator, Alert, Text, TextInput, View, TouchableOpacity } from 'react-native';
import { styles } from './Login.styled'; import { styles } from './Login.styled';
import Ionicons from '@expo/vector-icons/AntDesign'; import Ionicons from '@expo/vector-icons/AntDesign';
import { useLogin } from './useLogin.hook'; import { useLogin } from './useLogin.hook';
@ -21,7 +21,7 @@ export function Login() {
} }
return ( return (
<View style={styles.wrapper}> <KeyboardAvoidingView style={styles.wrapper} behavior="padding" enabled={Platform.OS === 'ios' ? true : false}>
<View style={styles.container}> <View style={styles.container}>
<View style={styles.control}> <View style={styles.control}>
<TouchableOpacity onPress={actions.config}> <TouchableOpacity onPress={actions.config}>
@ -85,6 +85,6 @@ export function Login() {
</View> </View>
</View> </View>
</View> </View>
</View> </KeyboardAvoidingView>
); );
} }

View File

@ -1,4 +1,4 @@
import { ActivityIndicator, Alert, Text, TextInput, View, TouchableOpacity } from 'react-native'; import { KeyboardAvoidingView, ActivityIndicator, Alert, Text, TextInput, View, TouchableOpacity } from 'react-native';
import { styles } from './Reset.styled'; import { styles } from './Reset.styled';
import Ionicons from '@expo/vector-icons/AntDesign'; import Ionicons from '@expo/vector-icons/AntDesign';
import { useReset } from './useReset.hook'; import { useReset } from './useReset.hook';
@ -21,7 +21,7 @@ export function Reset() {
} }
return ( return (
<View style={styles.wrapper}> <KeyboardAvoidingView style={styles.wrapper} behavior="padding" enabled={Platform.OS === 'ios' ? true : false}>
<View style={styles.container}> <View style={styles.container}>
<View style={styles.control}> <View style={styles.control}>
<TouchableOpacity onPress={actions.config}> <TouchableOpacity onPress={actions.config}>
@ -65,6 +65,6 @@ export function Reset() {
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
</View> </KeyboardAvoidingView>
); );
} }

View File

@ -62,7 +62,7 @@ export function ChannelsBody({ state, actions, openConversation }) {
<Text style={styles.addHeader}>New Topic:</Text> <Text style={styles.addHeader}>New Topic:</Text>
<View style={styles.inputField}> <View style={styles.inputField}>
<TextInput style={styles.input} value={state.addSubject} onChangeText={actions.setAddSubject} <TextInput style={styles.input} value={state.addSubject} onChangeText={actions.setAddSubject}
autoCapitalize="words" placeholder="Subject (optional)" /> autoCapitalize="words" placeholder="Subject (optional)" placeholderTextColor={Colors.grey} />
</View> </View>
<Text style={styles.label}>Members:</Text> <Text style={styles.label}>Members:</Text>
{ state.connected.length == 0 && ( { state.connected.length == 0 && (

View File

@ -73,10 +73,12 @@ export function useChannels() {
let updated = false; let updated = false;
const login = app.state.loginTimestamp; const login = app.state.loginTimestamp;
const update = item?.summary?.lastTopic?.created; const { created, guid } = item?.summary?.lastTopic;
if (update && login && login < update) { if (created && login && login < created) {
if (!item.readRevision || item.readRevision < item.revision) { if (!item.readRevision || item.readRevision < item.revision) {
updated = true; if (profile.state.profile.guid != guid) {
updated = true;
}
} }
} }
@ -147,9 +149,7 @@ export function useChannels() {
} }
} }
const timestamp = item?.summary?.lastTopic?.created; return { cardId: item.cardId, channelId: item.channelId, contacts, logo, subject, message, updated, revision: item.revision, timestamp: created, blocked: item.blocked === 1 };
return { cardId: item.cardId, channelId: item.channelId, contacts, logo, subject, message, updated, revision: item.revision, timestamp, blocked: item.blocked === 1 };
} }
useEffect(() => { useEffect(() => {

View File

@ -144,7 +144,7 @@ export function DetailsBody({ channel, clearConversation }) {
<Text style={styles.editHeader}>Edit Subject:</Text> <Text style={styles.editHeader}>Edit Subject:</Text>
<View style={styles.inputField}> <View style={styles.inputField}>
<TextInput style={styles.input} value={state.subjectUpdate} onChangeText={actions.setSubjectUpdate} <TextInput style={styles.input} value={state.subjectUpdate} onChangeText={actions.setSubjectUpdate}
autoCapitalize="words" placeholder="Subject" /> autoCapitalize="words" placeholder="Subject" placeholderTextColor={Colors.grey} />
</View> </View>
<View style={styles.editControls}> <View style={styles.editControls}>
<TouchableOpacity style={styles.cancel} onPress={actions.hideEditSubject}> <TouchableOpacity style={styles.cancel} onPress={actions.hideEditSubject}>

View File

@ -251,15 +251,16 @@ export function Profile() {
<Text style={styles.editHeader}>Edit Details:</Text> <Text style={styles.editHeader}>Edit Details:</Text>
<View style={styles.inputField}> <View style={styles.inputField}>
<TextInput style={styles.input} value={state.editName} onChangeText={actions.setEditName} <TextInput style={styles.input} value={state.editName} onChangeText={actions.setEditName}
autoCapitalize="words" placeholder="Name" /> autoCapitalize="words" placeholder="Name" placeholderTextColor={Colors.grey} />
</View> </View>
<View style={styles.inputField}> <View style={styles.inputField}>
<TextInput style={styles.input} value={state.editLocation} onChangeText={actions.setEditLocation} <TextInput style={styles.input} value={state.editLocation} onChangeText={actions.setEditLocation}
autoCapitalize="words" placeholder="Location" /> autoCapitalize="words" placeholder="Location" placeholderTextColor={Colors.grey} />
</View> </View>
<View style={styles.inputField}> <View style={styles.inputField}>
<TextInput style={styles.input} value={state.editDescription} onChangeText={actions.setEditDescription} <TextInput style={styles.input} value={state.editDescription} onChangeText={actions.setEditDescription}
autoCapitalize="sentences" placeholder="Description" multiline={true} /> autoCapitalize="sentences" placeholder="Description" multiline={true}
placeholderTextColor={Colors.grey} />
</View> </View>
<View style={styles.editControls}> <View style={styles.editControls}>
<TouchableOpacity style={styles.cancel} onPress={actions.hideDetailEdit}> <TouchableOpacity style={styles.cancel} onPress={actions.hideDetailEdit}>
@ -284,7 +285,7 @@ export function Profile() {
<Text style={styles.editHeader}>Change Login:</Text> <Text style={styles.editHeader}>Change Login:</Text>
<View style={styles.inputField}> <View style={styles.inputField}>
<TextInput style={styles.input} value={state.editHandle} onChangeText={actions.setEditHandle} <TextInput style={styles.input} value={state.editHandle} onChangeText={actions.setEditHandle}
autoCapitalize={'none'} placeholder="Username" /> autoCapitalize={'none'} placeholder="Username" placeholderTextColor={Colors.grey} />
{ state.checked && state.available && ( { state.checked && state.available && (
<Ionicons style={styles.icon} name="checkcircleo" size={18} color={Colors.background} /> <Ionicons style={styles.icon} name="checkcircleo" size={18} color={Colors.background} />
)} )}
@ -295,7 +296,8 @@ export function Profile() {
{ !state.showPassword && ( { !state.showPassword && (
<View style={styles.inputField}> <View style={styles.inputField}>
<TextInput style={styles.input} value={state.editPassword} onChangeText={actions.setEditPassword} <TextInput style={styles.input} value={state.editPassword} onChangeText={actions.setEditPassword}
autoCapitalize={'none'} secureTextEntry={true} placeholder="Password" /> autoCapitalize={'none'} secureTextEntry={true} placeholder="Password"
placeholderTextColor={Colors.grey} />
<TouchableOpacity onPress={actions.showPassword}> <TouchableOpacity onPress={actions.showPassword}>
<Ionicons style={styles.icon} name="eyeo" size={18} color="#888888" /> <Ionicons style={styles.icon} name="eyeo" size={18} color="#888888" />
</TouchableOpacity> </TouchableOpacity>
@ -304,7 +306,8 @@ export function Profile() {
{ state.showPassword && ( { state.showPassword && (
<View style={styles.inputField}> <View style={styles.inputField}>
<TextInput style={styles.input} value={state.editPassword} onChangeText={actions.setEditPassword} <TextInput style={styles.input} value={state.editPassword} onChangeText={actions.setEditPassword}
autoCapitalize={'none'} secureTextEntry={false} placeholder="Password" /> autoCapitalize={'none'} secureTextEntry={false} placeholder="Password"
placeholderTextColor={Colors.grey} />
<TouchableOpacity onPress={actions.hidePassword}> <TouchableOpacity onPress={actions.hidePassword}>
<Ionicons style={styles.icon} name="eye" size={18} color="#888888" /> <Ionicons style={styles.icon} name="eye" size={18} color="#888888" />
</TouchableOpacity> </TouchableOpacity>
@ -313,7 +316,8 @@ export function Profile() {
{ !state.showConfirm && ( { !state.showConfirm && (
<View style={styles.inputField}> <View style={styles.inputField}>
<TextInput style={styles.input} value={state.editConfirm} onChangeText={actions.setEditConfirm} <TextInput style={styles.input} value={state.editConfirm} onChangeText={actions.setEditConfirm}
autoCapitalize={'none'} secureTextEntry={true} placeholder="Confirm" /> autoCapitalize={'none'} secureTextEntry={true} placeholder="Confirm"
placeholderTextColor={Colors.grey} />
<TouchableOpacity onPress={actions.showConfirm}> <TouchableOpacity onPress={actions.showConfirm}>
<Ionicons style={styles.icon} name="eyeo" size={18} color="#888888" /> <Ionicons style={styles.icon} name="eyeo" size={18} color="#888888" />
</TouchableOpacity> </TouchableOpacity>
@ -322,7 +326,8 @@ export function Profile() {
{ state.showConfirm && ( { state.showConfirm && (
<View style={styles.inputField}> <View style={styles.inputField}>
<TextInput style={styles.input} value={state.editConfirm} onChangeText={actions.setEditConfirm} <TextInput style={styles.input} value={state.editConfirm} onChangeText={actions.setEditConfirm}
autoCapitalize={'none'} secureTextEntry={false} placeholder="Confirm" /> autoCapitalize={'none'} secureTextEntry={false} placeholder="Confirm"
placeholderTextColor={Colors.grey} />
<TouchableOpacity onPress={actions.hideConfirm}> <TouchableOpacity onPress={actions.hideConfirm}>
<Ionicons style={styles.icon} name="eye" size={18} color="#888888" /> <Ionicons style={styles.icon} name="eye" size={18} color="#888888" />
</TouchableOpacity> </TouchableOpacity>

View File

@ -34,7 +34,7 @@ export function useRegistry() {
useEffect(() => { useEffect(() => {
const server = profile.state.profile.node; const server = profile.state.profile.node;
updateState({ server }); updateState({ server });
getAccounts(server); getAccounts(server, true);
}, [profile]); }, [profile]);
const setAccountItem = (item) => { const setAccountItem = (item) => {