UI fixes group (#186)
* Scrolling input for group creation * Add group description * Adding members ro existing group
This commit is contained in:
parent
39a02cc0ed
commit
15f64df575
|
@ -48,6 +48,7 @@ export function ChatCreation({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
setQuery("");
|
setQuery("");
|
||||||
|
if (activeChannel) addMembers(styledGroup, activeChannel.id);
|
||||||
},
|
},
|
||||||
[setStyledGroup, styledGroup]
|
[setStyledGroup, styledGroup]
|
||||||
);
|
);
|
||||||
|
@ -86,9 +87,9 @@ export function ChatCreation({
|
||||||
className="narrow"
|
className="narrow"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<InputBar>
|
<InputBar className={`${narrow && "narrow"}`}>
|
||||||
<InputText>To:</InputText>
|
<InputText>To:</InputText>
|
||||||
<StyledList>
|
<StyledList className={`${narrow && "narrow"}`}>
|
||||||
{styledGroup.map((member) => (
|
{styledGroup.map((member) => (
|
||||||
<StyledMember key={member}>
|
<StyledMember key={member}>
|
||||||
<StyledName>{member.slice(0, 10)}</StyledName>
|
<StyledName>{member.slice(0, 10)}</StyledName>
|
||||||
|
@ -182,6 +183,10 @@ const InputBar = styled.div`
|
||||||
margin-right: 16px;
|
margin-right: 16px;
|
||||||
|
|
||||||
${textMediumStyles}
|
${textMediumStyles}
|
||||||
|
|
||||||
|
&.narrow {
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Input = styled.input`
|
const Input = styled.input`
|
||||||
|
@ -216,6 +221,14 @@ const CreationBtn = styled.button`
|
||||||
|
|
||||||
const StyledList = styled.div`
|
const StyledList = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
|
&.narrow {
|
||||||
|
overflow-x: scroll;
|
||||||
|
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledMember = styled.div`
|
const StyledMember = styled.div`
|
||||||
|
|
|
@ -40,6 +40,7 @@ export function useGroupChats(
|
||||||
id: chat.chatId,
|
id: chat.chatId,
|
||||||
name: chat.name ?? chat.chatId,
|
name: chat.name ?? chat.chatId,
|
||||||
type: "group",
|
type: "group",
|
||||||
|
description: `${chat.members.length} members`,
|
||||||
members: members,
|
members: members,
|
||||||
};
|
};
|
||||||
setChannels((prev) => {
|
setChannels((prev) => {
|
||||||
|
|
Loading…
Reference in New Issue