Move & more out of the loop

This commit is contained in:
Ian Philips 2022-09-03 06:33:33 -06:00
parent bfa88c3406
commit 2d88675f42

View File

@ -32,21 +32,22 @@ export function MultiUserTransactionLink(props: {
setOpen(true) setOpen(true)
}} }}
> >
<Row className={'gap-1'}> <Row className={'items-center gap-1 sm:gap-2'}>
{userInfos.map((userInfo, index) => {userInfos.map(
index < maxShowCount ? ( (userInfo, index) =>
<Row key={userInfo.username + 'shortened'}> index < maxShowCount && (
<Avatar <Avatar
username={userInfo.username} username={userInfo.username}
size={'sm'} size={'sm'}
avatarUrl={userInfo.avatarUrl} avatarUrl={userInfo.avatarUrl}
noLink={userInfos.length > 1} noLink={userInfos.length > 1}
key={userInfo.username + 'avatar'}
/> />
</Row>
) : (
<span>& {userInfos.length - maxShowCount} more</span>
) )
)} )}
{userInfos.length > maxShowCount && (
<span>& {userInfos.length - maxShowCount} more</span>
)}
</Row> </Row>
</Button> </Button>
<Modal open={open} setOpen={setOpen} size={'sm'}> <Modal open={open} setOpen={setOpen} size={'sm'}>