feat: bump socket.io-client & collab tweaks (#7444)

This commit is contained in:
David Luzar 2023-12-16 00:23:59 +01:00 committed by GitHub
parent 2c0929e537
commit 20e3acf7a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 89 additions and 179 deletions

View file

@ -10,6 +10,7 @@ type AvatarProps = {
name: string;
src?: string;
isBeingFollowed?: boolean;
isCurrentUser: boolean;
};
export const Avatar = ({
@ -18,6 +19,7 @@ export const Avatar = ({
name,
src,
isBeingFollowed,
isCurrentUser,
}: AvatarProps) => {
const shortName = getNameInitial(name);
const [error, setError] = useState(false);
@ -25,7 +27,10 @@ export const Avatar = ({
const style = loadImg ? undefined : { background: color };
return (
<div
className={clsx("Avatar", { "Avatar--is-followed": isBeingFollowed })}
className={clsx("Avatar", {
"Avatar--is-followed": isBeingFollowed,
"Avatar--is-current-user": isCurrentUser,
})}
style={style}
onClick={onClick}
>

View file

@ -338,7 +338,9 @@ const LayerUI = ({
},
)}
>
<UserList collaborators={appState.collaborators} />
{appState.collaborators.size > 0 && (
<UserList collaborators={appState.collaborators} />
)}
{renderTopRightUI?.(device.editor.isMobile, appState)}
{!appState.viewModeEnabled &&
// hide button when sidebar docked

View file

@ -100,7 +100,7 @@ export const UserList = React.memo(
// const uniqueCollaboratorsMap = sampleCollaborators;
const uniqueCollaboratorsArray = Array.from(uniqueCollaboratorsMap).filter(
([_, collaborator]) => Object.keys(collaborator).length !== 1,
([_, collaborator]) => collaborator.username?.trim(),
);
const [searchTerm, setSearchTerm] = React.useState("");