Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
feat(group): add to group combobox working
Browse files Browse the repository at this point in the history
  • Loading branch information
horacioh committed Nov 23, 2023
1 parent a930db7 commit 914c4fa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion frontend/packages/app/components/accounts-combobox.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.combobox {
font-family: var(--f-fa);
appearance: none;
height: 2.5rem;
height: 2rem;
/* width: 250px; */
border-radius: 0.375rem;
border-style: none;
Expand Down
22 changes: 16 additions & 6 deletions frontend/packages/app/pages/group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,10 @@ function InviteMemberDialog({
{matches.length == 0 ? (
<TagInputItem
onClick={() => {
setMemberSelection((values) => [...values, value])
let unpackedId = unpackHmId(value)
if (unpackedId && unpackedId.type == 'a') {
setMemberSelection((values) => [...values, unpackedId.eid])
}
}}
>
Add &quot;{value}&quot;
Expand Down Expand Up @@ -934,6 +937,10 @@ export const TagInput = forwardRef<HTMLInputElement, TagInputProps>(
>
{selectedValues.map((value) => {
let account = accountsMap[value]
let alias =
account && account.profile?.alias ? account.profile.alias : value
let avatar =
account && account.profile?.avatar ? account.profile.avatar : '?'
return (
<<<<<<< HEAD
<AccountCard accountId={value} key={value}>
Expand Down Expand Up @@ -970,6 +977,7 @@ export const TagInput = forwardRef<HTMLInputElement, TagInputProps>(
<XStack
gap="$2"
padding="$1.5"
minHeight="2rem"
borderRadius="$1"
backgroundColor="$backgroundFocus"
borderColor="$borderColor"
Expand All @@ -982,14 +990,16 @@ export const TagInput = forwardRef<HTMLInputElement, TagInputProps>(
}
>
<UIAvatar
label={account?.alias}
label={alias}
id={value}
url={`${BACKEND_FILE_URL}/${account.profile?.avatar}`}
url={avatar ? `${BACKEND_FILE_URL}/${avatar}` : undefined}
/>
<SizableText size="$3">
{account?.alias
? account.alias
: `${value?.slice(0, 5)}...${value?.slice(-5)}`}
{alias
? alias
: value.length > 20
? `${value?.slice(0, 5)}...${value?.slice(-5)}`
: value}
</SizableText>
{/* <span className="tag-remove"></span> */}
<X size={12} />
Expand Down

0 comments on commit 914c4fa

Please sign in to comment.