fixing profile image setting

This commit is contained in:
balzack 2023-03-05 23:44:34 -08:00
parent 749960b262
commit 1fb2907b80
3 changed files with 31 additions and 23 deletions

View File

@ -41,17 +41,17 @@ export function Create() {
<Ionicons style={styles.icon} name="database" size={18} color="#888888" /> <Ionicons style={styles.icon} name="database" size={18} color="#888888" />
<TextInput style={styles.inputfield} value={state.server} onChangeText={actions.setServer} <TextInput style={styles.inputfield} value={state.server} onChangeText={actions.setServer}
autoCorrect={false} autoCapitalize="none" placeholder="server" placeholderTextColor={Colors.grey} /> autoCorrect={false} autoCapitalize="none" placeholder="server" placeholderTextColor={Colors.grey} />
<View style={styles.space}> { (!state.server || !state.serverChecked) && (
{ (!state.server || !state.serverChecked) && ( <View style={styles.required}>
<Text style={styles.required}></Text> <Text style={styles.requiredtest}></Text>
)} </View>
{ state.server && state.serverChecked && !state.serverValid && ( )}
<Ionicons style={styles.icon} name="exclamationcircleo" size={18} color="#ff8888" /> { state.server && state.serverChecked && !state.serverValid && (
)} <Ionicons style={styles.icon} name="exclamationcircleo" size={18} color="#ff8888" />
{ state.server && state.serverChecked && state.serverValid && ( )}
<Ionicons style={styles.icon} name="checkcircleo" size={18} color="#448866" /> { state.server && state.serverChecked && state.serverValid && (
)} <Ionicons style={styles.icon} name="checkcircleo" size={18} color="#448866" />
</View> )}
</View> </View>
<View style={styles.token}> <View style={styles.token}>
{ state.tokenRequired && ( { state.tokenRequired && (
@ -82,17 +82,15 @@ export function Create() {
<Ionicons style={styles.icon} name="user" size={18} color="#888888" /> <Ionicons style={styles.icon} name="user" size={18} color="#888888" />
<TextInput style={styles.inputfield} value={state.username} onChangeText={actions.setUsername} <TextInput style={styles.inputfield} value={state.username} onChangeText={actions.setUsername}
autoCorrect={false} autoCapitalize="none" placeholder="username" placeholderTextColor={Colors.grey} /> autoCorrect={false} autoCapitalize="none" placeholder="username" placeholderTextColor={Colors.grey} />
<View style={styles.space}> { (!validServer || !validToken || !state.username || !state.usernameChecked) && (
{ (!validServer || !validToken || !state.username || !state.usernameChecked) && ( <Text style={styles.required}></Text>
<Text style={styles.required}></Text> )}
)} { validServer && validToken && state.username && state.usernameChecked && !state.usernameValid && (
{ validServer && validToken && state.username && state.usernameChecked && !state.usernameValid && ( <Ionicons style={styles.icon} name="exclamationcircleo" size={18} color="#ff8888" />
<Ionicons style={styles.icon} name="exclamationcircleo" size={18} color="#ff8888" /> )}
)} { validServer && validToken && state.username && state.usernameChecked && state.usernameValid && (
{ validServer && validToken && state.username && state.usernameChecked && state.usernameValid && ( <Ionicons style={styles.icon} name="checkcircleo" size={18} color="#448866" />
<Ionicons style={styles.icon} name="checkcircleo" size={18} color="#448866" /> )}
)}
</View>
</View> </View>
{ state.showPassword && ( { state.showPassword && (
<View style={styles.inputwrapper}> <View style={styles.inputwrapper}>

View File

@ -11,6 +11,8 @@ export const styles = StyleSheet.create({
}, },
icon: { icon: {
padding: 8, padding: 8,
width: 40,
textAlign: 'center',
}, },
demo: { demo: {
alignItems: 'center', alignItems: 'center',
@ -31,6 +33,11 @@ export const styles = StyleSheet.create({
required: { required: {
fontSize: 12, fontSize: 12,
color: Colors.grey, color: Colors.grey,
width: 32,
padding: 8,
textAlign: 'center',
},
requiredtext: {
textAlignVertical: 'center', textAlignVertical: 'center',
}, },
container: { container: {
@ -103,7 +110,7 @@ export const styles = StyleSheet.create({
alignItems: 'center', alignItems: 'center',
}, },
inputfield: { inputfield: {
flex: 1, flexGrow: 1,
textAlign: 'center', textAlign: 'center',
padding: 8, padding: 8,
color: Colors.text, color: Colors.text,

View File

@ -342,6 +342,9 @@ export function useProfile() {
saveLogin: async () => { saveLogin: async () => {
await account.actions.setLogin(state.editHandle, state.editPassword); await account.actions.setLogin(state.editHandle, state.editPassword);
}, },
setProfileImage: async (data) => {
await profile.actions.setProfileImage(data);
},
}; };
return { state, actions }; return { state, actions };