-
Notifications
You must be signed in to change notification settings - Fork 3.9k
UI MoneyRequestHeader Polish #18775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI MoneyRequestHeader Polish #18775
Changes from all commits
f0b4058
bf8240a
ab5a6ff
37e2038
c554f5d
a49b6b6
29cc594
2070ceb
0636a68
7416f31
22b0376
ff1d770
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,23 +63,21 @@ const SubscriptAvatar = (props) => { | |
| type={props.mainAvatar.type} | ||
| /> | ||
| </Tooltip> | ||
| <View | ||
| style={[ | ||
| props.size === CONST.AVATAR_SIZE.SMALL ? styles.secondAvatarSubscriptCompact : styles.secondAvatarSubscript, | ||
| StyleUtils.getBackgroundAndBorderStyle(props.backgroundColor), | ||
| StyleUtils.getAvatarBorderStyle(props.size, props.secondaryAvatar.type), | ||
| ]} | ||
| > | ||
| <Tooltip text={props.secondaryTooltip}> | ||
| <Avatar | ||
| source={props.secondaryAvatar.source} | ||
| size={props.size === CONST.AVATAR_SIZE.SMALL ? CONST.AVATAR_SIZE.SMALL_SUBSCRIPT : CONST.AVATAR_SIZE.SUBSCRIPT} | ||
| fill={themeColors.iconSuccessFill} | ||
| name={props.secondaryAvatar.name} | ||
| type={props.secondaryAvatar.type} | ||
| /> | ||
| </Tooltip> | ||
| </View> | ||
| <Tooltip text={props.secondaryTooltip}> | ||
| <Avatar | ||
| imageStyles={null} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi this PR caused #19905 More details - #19905 (comment)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @rushatgabhane We didn't test with a real image indeed. Nice catch! |
||
| containerStyles={[props.size === CONST.AVATAR_SIZE.SMALL ? styles.secondAvatarSubscriptCompact : styles.secondAvatarSubscript]} | ||
| iconAdditionalStyles={[ | ||
| StyleUtils.getAvatarBorderWidth(props.size === CONST.AVATAR_SIZE.SMALL ? CONST.AVATAR_SIZE.SMALL_SUBSCRIPT : CONST.AVATAR_SIZE.SUBSCRIPT), | ||
| StyleUtils.getBorderColorStyle(props.backgroundColor), | ||
| ]} | ||
| source={props.secondaryAvatar.source} | ||
| size={props.size === CONST.AVATAR_SIZE.SMALL ? CONST.AVATAR_SIZE.SMALL_SUBSCRIPT : CONST.AVATAR_SIZE.SUBSCRIPT} | ||
| fill={themeColors.iconSuccessFill} | ||
| name={props.secondaryAvatar.name} | ||
| type={props.secondaryAvatar.type} | ||
| /> | ||
| </Tooltip> | ||
| </View> | ||
| ); | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,7 @@ const workspaceColorOptions = [ | |
| const avatarBorderSizes = { | ||
| [CONST.AVATAR_SIZE.SMALL_SUBSCRIPT]: variables.componentBorderRadiusSmall, | ||
| [CONST.AVATAR_SIZE.MID_SUBSCRIPT]: variables.componentBorderRadiusSmall, | ||
| [CONST.AVATAR_SIZE.SUBSCRIPT]: variables.componentBorderRadiusSmall, | ||
| [CONST.AVATAR_SIZE.SUBSCRIPT]: variables.componentBorderRadiusMedium, | ||
| [CONST.AVATAR_SIZE.SMALLER]: variables.componentBorderRadiusMedium, | ||
| [CONST.AVATAR_SIZE.SMALL]: variables.componentBorderRadiusMedium, | ||
| [CONST.AVATAR_SIZE.HEADER]: variables.componentBorderRadiusMedium, | ||
|
|
@@ -85,7 +85,7 @@ function getAvatarStyle(size) { | |
| /** | ||
| * Get Font size of '+1' text on avatar overlay | ||
| * @param {String} size | ||
| * @returns {Number} | ||
| * @returns {Object} | ||
| */ | ||
| function getAvatarExtraFontSizeStyle(size) { | ||
| const AVATAR_SIZES = { | ||
|
|
@@ -107,12 +107,12 @@ function getAvatarExtraFontSizeStyle(size) { | |
| /** | ||
| * Get Bordersize of Avatar based on avatar size | ||
| * @param {String} size | ||
| * @returns {Number} | ||
| * @returns {Object} | ||
| */ | ||
| function getAvatarBorderWidth(size) { | ||
| const AVATAR_SIZES = { | ||
| [CONST.AVATAR_SIZE.DEFAULT]: 3, | ||
| [CONST.AVATAR_SIZE.SMALL_SUBSCRIPT]: 2, | ||
| [CONST.AVATAR_SIZE.SMALL_SUBSCRIPT]: 1, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was based on the removed border width from |
||
| [CONST.AVATAR_SIZE.MID_SUBSCRIPT]: 2, | ||
| [CONST.AVATAR_SIZE.SUBSCRIPT]: 2, | ||
| [CONST.AVATAR_SIZE.SMALL]: 3, | ||
|
|
@@ -121,7 +121,9 @@ function getAvatarBorderWidth(size) { | |
| [CONST.AVATAR_SIZE.MEDIUM]: 3, | ||
| [CONST.AVATAR_SIZE.LARGE_BORDERED]: 4, | ||
| }; | ||
| return AVATAR_SIZES[size]; | ||
| return { | ||
| borderWidth: AVATAR_SIZES[size], | ||
| }; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -349,6 +351,18 @@ function getBackgroundColorStyle(backgroundColor) { | |
| }; | ||
| } | ||
|
|
||
| /** | ||
| * Returns a style with the specified borderColor | ||
| * | ||
| * @param {String} borderColor | ||
| * @returns {Object} | ||
| */ | ||
| function getBorderColorStyle(borderColor) { | ||
| return { | ||
| borderColor, | ||
| }; | ||
| } | ||
|
|
||
| /** | ||
| * Returns the width style for the wordmark logo on the sign in page | ||
| * | ||
|
|
@@ -1122,6 +1136,7 @@ export { | |
| getAutoGrowHeightInputStyle, | ||
| getBackgroundAndBorderStyle, | ||
| getBackgroundColorStyle, | ||
| getBorderColorStyle, | ||
| getBackgroundColorWithOpacityStyle, | ||
| getBadgeColorStyle, | ||
| getButtonBackgroundColorStyle, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is taken from
MoneyRequestHeader