- The fix is in! Linty fresh and pretty...
This commit is contained in:
@@ -2,11 +2,16 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { Image, TouchableOpacity, View } from 'react-native';
|
||||
import { Icon } from 'react-native-elements';
|
||||
import { Avatar, Icon } from 'react-native-elements';
|
||||
|
||||
import styles from './UserProfileButton.styles.js';
|
||||
|
||||
export default function UserProfileButton({ avatarUrl, navigation }) {
|
||||
export default function UserProfileButton({
|
||||
avatarUrl,
|
||||
initials,
|
||||
isRegisteredAccount,
|
||||
navigation,
|
||||
}) {
|
||||
const _goToProfile = () => {
|
||||
navigation.navigate('Profile');
|
||||
return false;
|
||||
@@ -14,10 +19,12 @@ export default function UserProfileButton({ avatarUrl, navigation }) {
|
||||
|
||||
return (
|
||||
<TouchableOpacity onPress={_goToProfile}>
|
||||
{avatarUrl !== null ? (
|
||||
<View style={styles.avatarWrap}>
|
||||
<Image source={{ uri: avatarUrl }} />
|
||||
</View>
|
||||
{isRegisteredAccount !== null ? (
|
||||
avatarUrl !== null ? (
|
||||
<Avatar source={{ uri: avatarUrl }} />
|
||||
) : (
|
||||
<Avatar title={initials} />
|
||||
)
|
||||
) : (
|
||||
<Icon name="ei-user" type="evilicons" size={28} />
|
||||
)}
|
||||
@@ -27,8 +34,12 @@ export default function UserProfileButton({ avatarUrl, navigation }) {
|
||||
|
||||
UserProfileButton.propTypes = {
|
||||
avatarUrl: PropTypes.string,
|
||||
initials: PropTypes.string,
|
||||
isRegisteredAccount: PropTypes.bool,
|
||||
};
|
||||
|
||||
UserProfileButton.propTypes = {
|
||||
avatarUrl: null,
|
||||
initials: null,
|
||||
isRegisteredAccount: false,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user