Skip to content

Commit

Permalink
[IMPROVE] Improve the add user drop down for add a user in create cha…
Browse files Browse the repository at this point in the history
…nnel modal for UserAutoCompleteMultiple (#23766)

* Adding the new UI

* Correcting

* Adding the key

* Adding the listenners

* Lint

* Lint

* Lint

* adding a eslint-disable

* lint

* lint

Co-authored-by: Jean <45966964+Jeanstaquet@users.noreply.github.com>
Co-authored-by: Jeanstaquet <jean.staquet8@gmail.com>
  • Loading branch information
3 people authored Nov 22, 2021
1 parent 7c8b4e5 commit ecac14d
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import React, { memo, useMemo, useState } from 'react';

import { useEndpointData } from '../../hooks/useEndpointData';
import UserAvatar from '../avatar/UserAvatar';
import Avatar from './Avatar';

const query = (term = '') => ({ selector: JSON.stringify({ term }) });

Expand Down Expand Up @@ -40,8 +39,15 @@ const UserAutoCompleteMultiple = (props) => {
</Chip>
))
}
renderItem={({ value, ...props }) => (
<Option key={value} {...props} avatar={<Avatar value={value} />} />
renderItem={({ value, label, ...props }) => (
<Option key={value} {...props}>
<Option.Avatar>
<UserAvatar username={value} size='x20' />
</Option.Avatar>
<Option.Content>
{label} <Option.Description>({value})</Option.Description>
</Option.Content>
</Option>
)}
options={options}
/>
Expand Down

0 comments on commit ecac14d

Please sign in to comment.