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

View File

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

View File

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