-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Improve] profile edit screen #2857
Changes from 2 commits
038bc58
aeb539e
4ecf73a
f89b216
d29c216
80780e5
d8d6507
f5a01cb
a757555
51a5116
f3a202c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,48 @@ | ||
import React from 'react'; | ||
import { View, Text, SafeAreaView, TouchableOpacity } from 'react-native'; | ||
import { useNavigation } from '@react-navigation/native'; | ||
import LinearGradient from 'react-native-linear-gradient'; | ||
import { View, Text, TouchableOpacity } from 'react-native'; | ||
|
||
import { UserAvatar } from '../userAvatar'; | ||
import { IconButton } from '../iconButton'; | ||
|
||
// Styles | ||
import styles from './avatarHeaderStyles'; | ||
|
||
const AvatarHeader = | ||
({ username, name, reputation, avatarUrl, showImageUploadActions, isUploading }) => | ||
() => { | ||
const navigation = useNavigation(); | ||
const AvatarHeader = ({ | ||
username, | ||
name, | ||
reputation, | ||
avatarUrl, | ||
showImageUploadActions, | ||
isUploading, | ||
}) => { | ||
return ( | ||
<View style={styles.headerContainer}> | ||
<View style={styles.wrapper}> | ||
<TouchableOpacity onPress={showImageUploadActions}> | ||
<UserAvatar | ||
key={`${avatarUrl}-${username}`} | ||
noAction | ||
size="xl" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. try using even larger size is possible without making alot of changes |
||
username={username} | ||
avatarUrl={avatarUrl} | ||
isLoading={isUploading} | ||
/> | ||
<IconButton | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
iconStyle={styles.addIcon} | ||
style={styles.addButton} | ||
iconType="MaterialCommunityIcons" | ||
name="plus" | ||
onPress={showImageUploadActions} | ||
size={15} | ||
/> | ||
</TouchableOpacity> | ||
|
||
return ( | ||
<LinearGradient | ||
start={{ x: 0, y: 0 }} | ||
end={{ x: 1, y: 0 }} | ||
colors={['#357ce6', '#2d5aa0']} | ||
style={styles.headerView} | ||
> | ||
<SafeAreaView> | ||
<View style={styles.headerContainer}> | ||
<IconButton | ||
iconStyle={styles.backIcon} | ||
iconType="MaterialIcons" | ||
name="arrow-back" | ||
onPress={navigation.goBack} | ||
size={25} | ||
/> | ||
<View style={styles.wrapper}> | ||
<TouchableOpacity onPress={showImageUploadActions}> | ||
<UserAvatar | ||
key={`${avatarUrl}-${username}`} | ||
noAction | ||
size="xl" | ||
username={username} | ||
avatarUrl={avatarUrl} | ||
isLoading={isUploading} | ||
/> | ||
<IconButton | ||
iconStyle={styles.addIcon} | ||
style={styles.addButton} | ||
iconType="MaterialCommunityIcons" | ||
name="plus" | ||
onPress={showImageUploadActions} | ||
size={15} | ||
/> | ||
</TouchableOpacity> | ||
|
||
<View style={styles.textWrapper}> | ||
{!!name && <Text style={styles.name}>{name}</Text>} | ||
<Text style={styles.username}>{`@${username} (${reputation})`}</Text> | ||
</View> | ||
</View> | ||
</View> | ||
</SafeAreaView> | ||
</LinearGradient> | ||
); | ||
}; | ||
<View style={styles.textWrapper}> | ||
{!!name && <Text style={styles.name}>{name}</Text>} | ||
<Text style={styles.username}>{`@${username} (${reputation})`}</Text> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
</View> | ||
</View> | ||
</View> | ||
); | ||
}; | ||
export default AvatarHeader; |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if
AvatarHeader
is not being used anywhere else perhaps we can rename component toEditAvatar