Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add row to workspace chat in Workspace #52449

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/components/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,15 @@ function MenuItem(
}
};

const getSubscriptpAvatarBackgroundColor = (isHovered: boolean, pressed: boolean, hoveredBackgroundColor: string, pressedBackgroundColor: string) => {
nkdengineer marked this conversation as resolved.
Show resolved Hide resolved
if (pressed) {
return pressedBackgroundColor;
}
if (isHovered) {
return hoveredBackgroundColor;
}
nkdengineer marked this conversation as resolved.
Show resolved Hide resolved
};

return (
<View onBlur={onBlur}>
{!!label && !isLabelHoverable && (
Expand Down Expand Up @@ -643,8 +652,7 @@ function MenuItem(
)}
{shouldShowAvatar && shouldShowSubscriptAvatar && (
<SubscriptAvatar
// eslint-disable-next-line no-nested-ternary
backgroundColor={pressed ? theme.buttonHoveredBG : isHovered ? theme.hoverComponentBG : undefined}
backgroundColor={getSubscriptpAvatarBackgroundColor(isHovered, pressed, theme.hoverComponentBG, theme.buttonHoveredBG)}
mainAvatar={firstIcon as IconType}
secondaryAvatar={(icon as IconType[]).at(1)}
size={avatarSize}
Expand Down
Loading