Files
Eventment/app/components/AppHeader/UserProfileButton/UserProfileButton.js
2019-08-05 21:23:17 -04:00

36 lines
817 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { Image, TouchableOpacity, View } from 'react-native';
import { Icon } from 'react-native-elements';
import styles from './UserProfileButton.styles.js';
export default function UserProfileButton({ avatarUrl, navigation }) {
const _goToProfile = () => {
navigation.navigate('Profile');
return false;
};
return (
<TouchableOpacity onPress={_goToProfile}>
{avatarUrl !== null ? (
<View style={styles.avatarWrap}>
<Image source={{ uri: avatarUrl }} />
</View>
) : (
<Icon name="ei-user" type="evilicons" size={28} />;
)}
</TouchableOpacity>
);
}
HeaderContentRight.propTypes = {
avatarUrl: PropTypes.string,
};
HeaderContentRight.propTypes = {
avatarUrl: null,
};