Skip to content
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

Fix clickable area of multiple avatars component #22595

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/MultipleAvatars.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ function MultipleAvatars(props) {
// Height of one avatar + border space
const height = oneAvatarSize.height + 2 * oneAvatarBorderWidth;
if (props.icons.length > 4) {
// Width of overlapping avatars + border space
width = oneAvatarSize.width * 3 + oneAvatarBorderWidth * 8;
const length = avatarRows.length > 1 ? Math.max(avatarRows[0].length, avatarRows[1].length) : avatarRows[0].length;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const length = avatarRows.length > 1 ? Math.max(avatarRows[0].length, avatarRows[1].length) : avatarRows[0].length;
const length = Math.min(props.maxAvatarsInRow, avatarRows.length > 1 ? Math.max(avatarRows[0].length, avatarRows[1].length) : avatarRows[0].length);

And if else condition can be removed. "if width" already involves "else width".

width = oneAvatarSize.width + overlapSize * 2 * (length - 1) + oneAvatarBorderWidth * (length * 2);
} else {
// one avatar width + overlaping avatar sizes + border space
width = oneAvatarSize.width + overlapSize * 2 * (props.icons.length - 1) + oneAvatarBorderWidth * (props.icons.length * 2);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionItemCreated.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function ReportActionItemCreated(props) {
>
<PressableWithoutFeedback
onPress={() => ReportUtils.navigateToDetailsPage(props.report)}
style={[styles.ph5, styles.pb3, styles.alignSelfStart]}
style={[styles.mh5, styles.mb3, styles.alignSelfStart]}
accessibilityLabel={props.translate('common.details')}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
>
Expand Down