Skip to content

Commit

Permalink
Avatar picture diamond issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
francinelucca committed Jan 15, 2020
1 parent 73b60a2 commit a20c78e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 8 deletions.
20 changes: 15 additions & 5 deletions App/Components/Common/Avatar/Avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Text from '../Text';

class Avatar extends React.Component {
renderAvatar = () => {
const { src, uri, initialsText, style, textStyle } = this.props;
const { src, uri, initialsText, style, textStyle, textBorderStyle } = this.props;

if (src || uri) {
return (
Expand All @@ -21,7 +21,10 @@ class Avatar extends React.Component {
}

return (
<View {...this.props} style={[styles.avatarStyle, style]}>
<View
{...this.props}
style={[styles.avatarStyle, styles.textBorderStyle, style, textBorderStyle]}
>
<View style={[style, styles.textViewStyle]}>
<Text.Medium text={initialsText} style={[styles.textStyle, textStyle]} />
</View>
Expand All @@ -36,13 +39,18 @@ class Avatar extends React.Component {

const styles = StyleSheet.create({
avatarStyle: {
height: toBaseDesignPx(110),
width: toBaseDesignPx(110),
borderRadius: toBaseDesignPx(100),
height: toBaseDesignPx(94),
width: toBaseDesignPx(94),
borderRadius: toBaseDesignPx(47),
backgroundColor: colors.GRAY_LIGHT,
alignItems: 'center',
justifyContent: 'center',
},
textBorderStyle: {
height: toBaseDesignPx(110),
width: toBaseDesignPx(110),
borderRadius: toBaseDesignPx(100),
},
textViewStyle: {
width: toBaseDesignPx(110),
height: toBaseDesignPx(110),
Expand Down Expand Up @@ -72,6 +80,7 @@ Avatar.defaultProps = {
initialsText: null,
style: null,
textStyle: null,
textBorderStyle: null,
};

Avatar.propTypes = {
Expand All @@ -80,6 +89,7 @@ Avatar.propTypes = {
initialsText: PropTypes.string,
style: ViewPropTypes.style,
textStyle: PropTypes.shape({}),
textBorderStyle: PropTypes.shape({}),
};

export default Avatar;
8 changes: 7 additions & 1 deletion App/Components/EventCalendar/EventCalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class EventCalendar extends React.Component {
initialsText={initialsText}
style={styles.avatarStyle}
textStyle={styles.avatarTextStyle}
textBorderStyle={styles.textBorderStyle}
/>
<Text.Medium
text={author}
Expand Down Expand Up @@ -108,9 +109,14 @@ const styles = StyleSheet.create({
avatarStyle: {
height: toBaseDesignPx(32),
width: toBaseDesignPx(32),
borderRadius: toBaseDesignPx(32),
borderRadius: toBaseDesignPx(16),
...spacers.MR_1,
},
textBorderStyle: {
height: toBaseDesignPx(32),
width: toBaseDesignPx(32),
borderRadius: toBaseDesignPx(32),
},
authorStyle: {
...fonts.SIZE_XS,
color: colors.GRAY,
Expand Down
6 changes: 5 additions & 1 deletion App/Components/ParticipantCard/ParticipantCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class ParticipantCard extends React.Component {
initialsText={initialsText}
style={styles.avatarStyle}
textStyle={styles.avatarTextStyle}
textBorderStyle={styles.textBorderStyle}
/>
<Text.Medium
text={participantName}
Expand All @@ -59,10 +60,13 @@ const styles = StyleSheet.create({
avatarStyle: {
height: toBaseDesignPx(32),
width: toBaseDesignPx(32),
borderRadius: toBaseDesignPx(32),
borderRadius: toBaseDesignPx(16),
...spacers.MR_8,
...spacers.ML_8,
},
textBorderStyle: {
borderRadius: toBaseDesignPx(32),
},
participantStyle: {
...fonts.SIZE_XS,
color: colors.GRAY_LIGHT,
Expand Down
6 changes: 5 additions & 1 deletion App/Components/PostComment/PostComment.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class PostComment extends React.Component {
initialsText={initialsText}
style={styles.avatarStyle}
textStyle={styles.avatarTextStyle}
textBorderStyle={styles.textBorderStyle}
/>
<View style={styles.fullFlex}>
<Text.SemiBold text={comment} style={[styles.commentStyle]} />
Expand Down Expand Up @@ -136,10 +137,13 @@ const styles = StyleSheet.create({
avatarStyle: {
height: toBaseDesignPx(32),
width: toBaseDesignPx(32),
borderRadius: toBaseDesignPx(32),
borderRadius: toBaseDesignPx(16),
...spacers.MR_8,
...spacers.ML_4,
},
textBorderStyle: {
borderRadius: toBaseDesignPx(32),
},
authorStyle: {
...fonts.SIZE_XXS,
color: colors.GRAY_LIGHT,
Expand Down
4 changes: 4 additions & 0 deletions App/Components/PostInfo/PostInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class PostInfo extends React.Component {
initialsText={initialsText}
style={styles.avatarStyle}
textStyle={styles.avatarTextStyle}
textBorderStyle={styles.textBorderStyle}
/>
</View>
</InLineComponent>
Expand Down Expand Up @@ -365,6 +366,9 @@ const styles = StyleSheet.create({
avatarStyle: {
height: toBaseDesignPx(32),
width: toBaseDesignPx(32),
borderRadius: toBaseDesignPx(16),
},
textBorderStyle: {
borderRadius: toBaseDesignPx(32),
},
authorStyle: {
Expand Down

0 comments on commit a20c78e

Please sign in to comment.