Skip to content

Commit

Permalink
create SubscriptAvatar component
Browse files Browse the repository at this point in the history
  • Loading branch information
marcochavezf committed Feb 23, 2022
1 parent 3817498 commit 39cc286
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/components/SubscriptAvatar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React, {memo} from 'react';
import PropTypes from 'prop-types';
import {Image, View} from 'react-native';
import styles from '../styles/styles';
import Tooltip from './Tooltip';

const propTypes = {
/** Array of avatar URL */
avatarImageURLs: PropTypes.arrayOf(PropTypes.string).isRequired,

/** Tooltip for the Avatar */
avatarTooltips: PropTypes.arrayOf(PropTypes.string).isRequired,
};

const SubscriptAvatar = props => (
<View style={styles.emptyAvatar}>
<Tooltip text={props.avatarTooltips[0]} absolute>
<Image
source={{uri: props.avatarImageURLs[0]}}
style={styles.avatarNormal}
/>
</Tooltip>
<View
style={[
styles.secondAvatarSubscript,
styles.secondAvatarHovered,
]}
>
<Tooltip text={props.avatarTooltips[1]} absolute>
<Image
source={{uri: props.avatarImageURLs[1]}}
style={styles.singleSubscript}
/>
</Tooltip>
</View>
</View>
);

SubscriptAvatar.propTypes = propTypes;
export default memo(SubscriptAvatar);

0 comments on commit 39cc286

Please sign in to comment.