diff --git a/app/scenes/Document/components/Combobox.tsx b/app/scenes/Document/components/Combobox.tsx index 68721157cc..ebaa008a97 100644 --- a/app/scenes/Document/components/Combobox.tsx +++ b/app/scenes/Document/components/Combobox.tsx @@ -20,6 +20,8 @@ import { undraggableOnDesktop } from "~/styles"; type Suggestion = { id: string; value: string; + /** A label to show instead of the value if a more rich component is needed */ + label?: React.ReactNode; [key: string]: any; }; @@ -31,7 +33,7 @@ type Props = Omit, "list"> & { /** Value held by the search input bar */ value: string; /** Label for search input */ - label: string; + label?: string; /** Label for the search results list */ listLabel: string; /** Handler which triggers upon search input change */ @@ -66,7 +68,7 @@ function Combobox({ }; const state = useComboboxState({ - gutter: 8, + gutter: 2, values: suggestions.map((s) => s.value), }); @@ -148,7 +150,7 @@ function Combobox({ state.hide(); }} > - {item.value} + {item.label ?? item.value} )) : null} @@ -198,6 +200,7 @@ const StyledComboboxInput = styled(ComboboxInput)` const StyledComboboxOption = styled(ComboboxOption)` ${MenuAnchorCSS} + /* overriding the styles from MenuAnchorCSS because we use   here */ svg:not(:last-child) { margin-right: 0px; diff --git a/app/scenes/Document/components/InviteTeamMembers.tsx b/app/scenes/Document/components/InviteTeamMembers.tsx index 4e8f30a580..5eede5580d 100644 --- a/app/scenes/Document/components/InviteTeamMembers.tsx +++ b/app/scenes/Document/components/InviteTeamMembers.tsx @@ -10,6 +10,8 @@ import Document from "~/models/Document"; import User from "~/models/User"; import UserMembership from "~/models/UserMembership"; import MemberListItem from "~/scenes/CollectionPermissions/components/MemberListItem"; +import Avatar from "~/components/Avatar"; +import { AvatarSize } from "~/components/Avatar/Avatar"; import Flex from "~/components/Flex"; import LoadingIndicator from "~/components/LoadingIndicator"; import PaginatedList from "~/components/PaginatedList"; @@ -169,13 +171,18 @@ function InviteTeamMembers({ document }: Props) { suggestions={nonMembers.map((user) => ({ id: user.id, value: user.name, + label: ( + + + {user.name} + + ), }))} value={query} onChangeInput={handleQuery} onSelectOption={handleSelect} - label={t("Invite team members")} listLabel={t("Team members")} - placeholder={`${t("Search by name")}…`} + placeholder={`${t("Add workspace members")}…`} autoFocus /> unless restored.": "This template will be permanently deleted in <2> unless restored.", "This document will be permanently deleted in <2> unless restored.": "This document will be permanently deleted in <2> unless restored.",