This commit is contained in:
2019-08-05 21:23:17 -04:00
parent a9f4324f29
commit 1e464de7e8
42 changed files with 837 additions and 165 deletions

View File

@@ -0,0 +1,11 @@
import { connect } from 'react-redux';
import { getProfileAvatarUrl } from '../selectors/profile.js';
import HeaderContentRight from './HeaderContentRight.js';
const matchStateToProps = (state) => ({
avatarUrl: getProfileAvatarUrl(state),
});
export default connect(matchStateToProps, null)(HeaderContentRight);

View File

@@ -0,0 +1,35 @@
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,
};