mirror of
https://github.com/balzack/databag.git
synced 2025-05-04 15:35:16 +00:00
workaround for stale profile image
This commit is contained in:
parent
2ef4d337d2
commit
cfa20fda43
@ -23,7 +23,16 @@ export const styles = StyleSheet.create({
|
|||||||
width: 48,
|
width: 48,
|
||||||
height: 48,
|
height: 48,
|
||||||
},
|
},
|
||||||
logo: {
|
logoUnset: {
|
||||||
|
aspectRatio: 1,
|
||||||
|
resizeMode: 'contain',
|
||||||
|
borderRadius: 4,
|
||||||
|
width: null,
|
||||||
|
height: null,
|
||||||
|
borderWidth: 1,
|
||||||
|
borderColor: '#888888',
|
||||||
|
},
|
||||||
|
logoSet: {
|
||||||
aspectRatio: 1,
|
aspectRatio: 1,
|
||||||
resizeMode: 'contain',
|
resizeMode: 'contain',
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
|
@ -12,7 +12,12 @@ export function Identity({ openSettings }) {
|
|||||||
<SafeAreaView style={styles.identity}>
|
<SafeAreaView style={styles.identity}>
|
||||||
<TouchableOpacity style={styles.identityData} activeOpacity={1} onPress={() => setMenu(true)}>
|
<TouchableOpacity style={styles.identityData} activeOpacity={1} onPress={() => setMenu(true)}>
|
||||||
<View style={styles.image}>
|
<View style={styles.image}>
|
||||||
<Image style={styles.logo} resizeMode={'contain'} source={{ uri: state.imageUrl }} />
|
{state.profile.imageSet && (
|
||||||
|
<Image style={styles.logoSet} resizeMode={'contain'} source={state.imageUrl} />
|
||||||
|
)}
|
||||||
|
{!state.profile.imageSet && (
|
||||||
|
<Image style={styles.logoUnset} resizeMode={'contain'} source={state.imageUrl} />
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.details}>
|
<View style={styles.details}>
|
||||||
{state.profile.name && (
|
{state.profile.name && (
|
||||||
|
@ -29,8 +29,9 @@ export function useIdentity() {
|
|||||||
updateState({
|
updateState({
|
||||||
profile,
|
profile,
|
||||||
profileSet: true,
|
profileSet: true,
|
||||||
imageUrl: identity.getProfileImageUrl(),
|
imageUrl: { uri: identity.getProfileImageUrl() },
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
identity.addProfileListener(setProfile)
|
identity.addProfileListener(setProfile)
|
||||||
return () => {
|
return () => {
|
||||||
|
@ -79,7 +79,16 @@ export const styles = StyleSheet.create({
|
|||||||
marginTop: 16,
|
marginTop: 16,
|
||||||
marginBottom: 8,
|
marginBottom: 8,
|
||||||
},
|
},
|
||||||
logo: {
|
logoSet: {
|
||||||
|
aspectRatio: 1,
|
||||||
|
resizeMode: 'contain',
|
||||||
|
borderRadius: 8,
|
||||||
|
width: null,
|
||||||
|
height: null,
|
||||||
|
borderWidth: 1,
|
||||||
|
borderColor: Colors.primary,
|
||||||
|
},
|
||||||
|
logoUnset: {
|
||||||
aspectRatio: 1,
|
aspectRatio: 1,
|
||||||
resizeMode: 'contain',
|
resizeMode: 'contain',
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
|
@ -52,7 +52,12 @@ export function Settings() {
|
|||||||
<SafeAreaView style={styles.settings}>
|
<SafeAreaView style={styles.settings}>
|
||||||
<Text style={styles.header} adjustsFontSizeToFit={true} numberOfLines={1}>{`${state.profile.handle}${state.profile.node ? '/' + state.profile.node : ''}`}</Text>
|
<Text style={styles.header} adjustsFontSizeToFit={true} numberOfLines={1}>{`${state.profile.handle}${state.profile.node ? '/' + state.profile.node : ''}`}</Text>
|
||||||
<View style={styles.image}>
|
<View style={styles.image}>
|
||||||
<Image style={styles.logo} resizeMode={'contain'} source={{ uri: state.imageUrl }} />
|
{!state.profile.imageSet && (
|
||||||
|
<Image style={styles.logoUnset} resizeMode={'contain'} source={{ uri: state.imageUrl }} />
|
||||||
|
)}
|
||||||
|
{state.profile.imageSet && (
|
||||||
|
<Image style={styles.logoSet} resizeMode={'contain'} source={{ uri: state.imageUrl }} />
|
||||||
|
)}
|
||||||
<View style={styles.editBar}>
|
<View style={styles.editBar}>
|
||||||
<TouchableOpacity onPress={selectImage}>
|
<TouchableOpacity onPress={selectImage}>
|
||||||
<Surface style={styles.editBorder} elevation={0}>
|
<Surface style={styles.editBorder} elevation={0}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user