diff --git a/src/components/MultipleAvatars.js b/src/components/MultipleAvatars.js index e617a7c94564..7eec7147747c 100644 --- a/src/components/MultipleAvatars.js +++ b/src/components/MultipleAvatars.js @@ -55,7 +55,9 @@ const defaultProps = { }; const MultipleAvatars = (props) => { - let avatarContainerStyles = props.size === CONST.AVATAR_SIZE.SMALL ? styles.emptyAvatarSmall : styles.emptyAvatar; + let avatarContainerStyles = props.size === CONST.AVATAR_SIZE.SMALL + ? [styles.emptyAvatarSmall, styles.emptyAvatarMarginSmall] + : [styles.emptyAvatar, styles.emptyAvatarMargin]; const singleAvatarStyles = props.size === CONST.AVATAR_SIZE.SMALL ? styles.singleAvatarSmall : styles.singleAvatar; const secondAvatarStyles = [ props.size === CONST.AVATAR_SIZE.SMALL ? styles.secondAvatarSmall : styles.secondAvatar, diff --git a/src/components/OptionRow.js b/src/components/OptionRow.js index dcfc7e3ca382..d5e5115d9ef2 100644 --- a/src/components/OptionRow.js +++ b/src/components/OptionRow.js @@ -207,7 +207,6 @@ class OptionRow extends Component { secondaryAvatar={this.props.option.icons[1]} mainTooltip={this.props.option.ownerEmail} secondaryTooltip={this.props.option.subtitle} - size={CONST.AVATAR_SIZE.DEFAULT} backgroundColor={ hovered && !this.props.optionIsFocused ? hoveredBackgroundColor diff --git a/src/components/SubscriptAvatar.js b/src/components/SubscriptAvatar.js index 6da3e918fec4..8b552b405ad5 100644 --- a/src/components/SubscriptAvatar.js +++ b/src/components/SubscriptAvatar.js @@ -28,6 +28,9 @@ const propTypes = { /** Background color used for subscript avatar border */ backgroundColor: PropTypes.string, + + /** Removes margin from around the avatar, used for the chat view */ + noMargin: PropTypes.bool, }; const defaultProps = { @@ -37,36 +40,48 @@ const defaultProps = { backgroundColor: themeColors.componentBG, mainAvatar: {}, secondaryAvatar: {}, + noMargin: false, }; -const SubscriptAvatar = props => ( - - - - - - +const SubscriptAvatar = (props) => { + const containerStyle = props.size === CONST.AVATAR_SIZE.SMALL ? styles.emptyAvatarSmall : styles.emptyAvatar; + + // Default the margin style to what is normal for small or normal sized avatars + let marginStyle = props.size === CONST.AVATAR_SIZE.SMALL ? styles.emptyAvatarMargin : styles.emptyAvatarMarginSmall; + + // Some views like the chat view require that there be no margins + if (props.noMargin) { + marginStyle = {}; + } + return ( + + + + + + + - -); + ); +}; SubscriptAvatar.displayName = 'SubscriptAvatar'; SubscriptAvatar.propTypes = propTypes; diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index e1a77f244c32..9d8588ccc196 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -96,8 +96,9 @@ const ReportActionItemSingle = (props) => { ) : ( diff --git a/src/styles/styles.js b/src/styles/styles.js index 8f22d7de08a8..a85d623538af 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -1816,17 +1816,23 @@ const styles = { }, emptyAvatar: { - marginRight: variables.avatarChatSpacing, height: variables.avatarSizeNormal, width: variables.avatarSizeNormal, }, emptyAvatarSmall: { - marginRight: variables.avatarChatSpacing - 4, height: variables.avatarSizeSmall, width: variables.avatarSizeSmall, }, + emptyAvatarMargin: { + marginRight: variables.avatarChatSpacing, + }, + + emptyAvatarMarginSmall: { + marginRight: variables.avatarChatSpacing - 4, + }, + modalViewContainer: { alignItems: 'center', flex: 1,