diff --git a/src/features/presence/PresenceAvatarList.tsx b/src/features/presence/PresenceAvatarList.tsx index 3cb30bfd1a..c7359546b1 100644 --- a/src/features/presence/PresenceAvatarList.tsx +++ b/src/features/presence/PresenceAvatarList.tsx @@ -1,10 +1,12 @@ import * as React from 'react'; import classNames from 'classnames'; import noop from 'lodash/noop'; +import { Tooltip as BPTooltip, TooltipProvider as BPTooltipProvider } from '@box/blueprint-web'; // @ts-ignore flow import import PresenceAvatar from './PresenceAvatar'; import PresenceAvatarTooltipContent from './PresenceAvatarTooltipContent'; import Tooltip, { TooltipPosition } from '../../components/tooltip'; +import { withBlueprintModernization } from '../../elements/common/withBlueprintModernization'; import './PresenceAvatarList.scss'; export type Collaborator = { @@ -21,12 +23,14 @@ export type Props = { avatarAttributes?: React.HTMLAttributes; className?: string; collaborators: Array; + enableModernizedComponents?: boolean; hideAdditionalCount?: boolean; hideTooltips?: boolean; maxAdditionalCollaborators?: number; maxDisplayedAvatars?: number; onAvatarMouseEnter?: (id: string) => void; onAvatarMouseLeave?: () => void; + isPreviewModernizationEnabled?: boolean; }; function PresenceAvatarList(props: Props, ref: React.Ref): JSX.Element | null { @@ -40,9 +44,9 @@ function PresenceAvatarList(props: Props, ref: React.Ref): JSX.E maxDisplayedAvatars = 3, onAvatarMouseEnter = noop, onAvatarMouseLeave = noop, + isPreviewModernizationEnabled = false, ...rest } = props; - const [activeTooltip, setActiveTooltip] = React.useState(null); const hideTooltip = (): void => { @@ -63,39 +67,59 @@ function PresenceAvatarList(props: Props, ref: React.Ref): JSX.E return null; } - return ( + const renderAvatar = (collaborator: Collaborator) => { + const { id, avatarUrl, name, isActive, interactedAt, interactionType } = collaborator; + + const avatarElement = ( +