diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-09-21 20:01:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-21 20:01:16 +0200 |
commit | bc5678d0151dd96e0ec5f3d4084ac6356c1d02f5 (patch) | |
tree | 75fc676a4726b74a0e387970156b0efed10c72d9 /app/javascript/mastodon/components/avatar_composite.js | |
parent | 33b2e0f1895f981c13e3257badcd1210c3d86946 (diff) |
Change conversations UI (#11896)
Fix #11414, fix #9860, fix #10434
Diffstat (limited to 'app/javascript/mastodon/components/avatar_composite.js')
-rw-r--r-- | app/javascript/mastodon/components/avatar_composite.js | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/app/javascript/mastodon/components/avatar_composite.js b/app/javascript/mastodon/components/avatar_composite.js index 4a9a73c51..5d5b89749 100644 --- a/app/javascript/mastodon/components/avatar_composite.js +++ b/app/javascript/mastodon/components/avatar_composite.js @@ -35,35 +35,35 @@ export default class AvatarComposite extends React.PureComponent { if (size === 2) { if (index === 0) { - right = '2px'; + right = '1px'; } else { - left = '2px'; + left = '1px'; } } else if (size === 3) { if (index === 0) { - right = '2px'; + right = '1px'; } else if (index > 0) { - left = '2px'; + left = '1px'; } if (index === 1) { - bottom = '2px'; + bottom = '1px'; } else if (index > 1) { - top = '2px'; + top = '1px'; } } else if (size === 4) { if (index === 0 || index === 2) { - right = '2px'; + right = '1px'; } if (index === 1 || index === 3) { - left = '2px'; + left = '1px'; } if (index < 2) { - bottom = '2px'; + bottom = '1px'; } else { - top = '2px'; + top = '1px'; } } @@ -88,7 +88,13 @@ export default class AvatarComposite extends React.PureComponent { return ( <div className='account__avatar-composite' style={{ width: `${size}px`, height: `${size}px` }}> - {accounts.take(4).map((account, i) => this.renderItem(account, accounts.size, i))} + {accounts.take(4).map((account, i) => this.renderItem(account, Math.min(accounts.size, 4), i))} + + {accounts.size > 4 && ( + <span className='account__avatar-composite__label'> + +{accounts.size - 4} + </span> + )} </div> ); } |