fix: User profiles dont open from document collaborator facepile

This commit is contained in:
Tom Moor
2019-07-11 22:32:37 -07:00
parent c9da515d4c
commit b3f847a371

View File

@ -60,6 +60,7 @@ class Collaborators extends React.Component<Props> {
<Avatars> <Avatars>
{overflow > 0 && <More>+{overflow}</More>} {overflow > 0 && <More>+{overflow}</More>}
{mostRecentViewers.map(({ lastViewedAt, user }) => ( {mostRecentViewers.map(({ lastViewedAt, user }) => (
<React.Fragment>
<AvatarPile <AvatarPile
key={user.id} key={user.id}
tooltip={ tooltip={
@ -76,15 +77,17 @@ class Collaborators extends React.Component<Props> {
src={user.avatarUrl} src={user.avatarUrl}
onClick={() => this.handleOpenProfile(user.id)} onClick={() => this.handleOpenProfile(user.id)}
/> />
</Viewer>
</AvatarPile>
<UserProfile <UserProfile
user={user} user={user}
isOpen={this.openProfileId === user.id} isOpen={this.openProfileId === user.id}
onRequestClose={this.handleCloseProfile} onRequestClose={this.handleCloseProfile}
/> />
</Viewer> </React.Fragment>
</AvatarPile>
))} ))}
{collaborators.map(user => ( {collaborators.map(user => (
<React.Fragment>
<AvatarPile <AvatarPile
key={user.id} key={user.id}
tooltip={ tooltip={
@ -103,13 +106,14 @@ class Collaborators extends React.Component<Props> {
src={user.avatarUrl} src={user.avatarUrl}
onClick={() => this.handleOpenProfile(user.id)} onClick={() => this.handleOpenProfile(user.id)}
/> />
</Collaborator>
</AvatarPile>
<UserProfile <UserProfile
user={user} user={user}
isOpen={this.openProfileId === user.id} isOpen={this.openProfileId === user.id}
onRequestClose={this.handleCloseProfile} onRequestClose={this.handleCloseProfile}
/> />
</Collaborator> </React.Fragment>
</AvatarPile>
))} ))}
</Avatars> </Avatars>
); );