mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-21 04:17:01 -04:00
Fix MoreUserTags Settings
This commit is contained in:
parent
a0dfaf056a
commit
d2a0324647
3 changed files with 67 additions and 49 deletions
|
@ -179,20 +179,18 @@ export default function PluginModal({ plugin, onRestartNeeded, onClose, transiti
|
|||
}
|
||||
}
|
||||
|
||||
function renderMoreUsers(_label: string, count: number) {
|
||||
const sliceCount = plugin.authors.length - count;
|
||||
const sliceStart = plugin.authors.length - sliceCount;
|
||||
const sliceEnd = sliceStart + plugin.authors.length - count;
|
||||
function renderMoreUsers(_label: string) {
|
||||
const remainingAuthors = plugin.authors.slice(6);
|
||||
|
||||
return (
|
||||
<Tooltip text={plugin.authors.slice(sliceStart, sliceEnd).map(u => u.name).join(", ")}>
|
||||
<Tooltip text={remainingAuthors.map(u => u.name).join(", ")}>
|
||||
{({ onMouseEnter, onMouseLeave }) => (
|
||||
<div
|
||||
className={AvatarStyles.moreUsers}
|
||||
onMouseEnter={onMouseEnter}
|
||||
onMouseLeave={onMouseLeave}
|
||||
>
|
||||
+{sliceCount}
|
||||
+{remainingAuthors.length}
|
||||
</div>
|
||||
)}
|
||||
</Tooltip>
|
||||
|
@ -252,7 +250,7 @@ export default function PluginModal({ plugin, onRestartNeeded, onClose, transiti
|
|||
renderIcon={false}
|
||||
showDefaultAvatarsForNullUsers
|
||||
showUserPopout
|
||||
renderMoreUsers={plugin.authors.length > 6 ? renderMoreUsers : undefined}
|
||||
renderMoreUsers={renderMoreUsers}
|
||||
renderUser={(user: User) => (
|
||||
<Clickable
|
||||
className={AvatarStyles.clickableAvatar}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue