make group members list scrollable

This commit is contained in:
Michael Fatemi 2021-08-12 15:56:30 -04:00
parent 7e2b8233b3
commit 21cf8fc7d2

View File

@ -53,27 +53,48 @@ export default function GroupMembersLink() {
style={{ style={{
textAlign: 'center', textAlign: 'center',
backgroundColor: '#fdfdfd', backgroundColor: '#fdfdfd',
maxHeight: 'calc(100vh - 4rem)',
position: 'relative',
}} }}
cancelClicks
> >
<h3>Members</h3> <h3>Members</h3>
<span>Member count: {group.users.length}</span>
<div
style={{
display: 'flex',
flexDirection: 'column',
overflowY: 'auto',
padding: '2rem 0.5rem',
textAlign: 'left',
}}
>
{group.users.map(({ name, id }) => ( {group.users.map(({ name, id }) => (
<span key={id}> <div
{name} {adminIds.has(id) && ' (admin)'}{' '} key={id}
style={{
display: 'flex',
justifyContent: 'space-between',
margin: '0.5rem 0',
}}
>
<span>
{name} {adminIds.has(id) && ' (admin)'}
</span>
{amIAdmin && {amIAdmin &&
(adminIds.has(id) ? ( (adminIds.has(id) ? (
<button onClick={() => removeAdmin(id)}> <button onClick={() => removeAdmin(id)}>
Remove as admin Remove admin
</button> </button>
) : ( ) : (
<button onClick={() => addAdmin(id, name)}> <button onClick={() => addAdmin(id, name)}>
Add as admin Make admin
</button> </button>
))} ))}
</span> </div>
))} ))}
<br /> </div>
<GroupInviteCode /> <GroupInviteCode />
</UISecondaryBox> </UISecondaryBox>