Skip to content

Commit

Permalink
AvatarWithConnectivity: add a tooltip with more information
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMure committed Mar 11, 2018
1 parent af9bead commit bab4553
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/components/common/AvatarWithConnectivity.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// @flow
import React, { Component } from 'react'
import { withStyles } from 'material-ui/styles'
import classNames from 'classnames'
import Tooltip from 'material-ui/Tooltip'
import Profile, { ConnectivityStatus } from 'models/Profile'
import type { ConnectivityStatusType } from 'models/Profile'
import Avatar from 'components/common/Avatar'
import classNames from 'classnames'
import Moment from 'react-moment'

class AvatarWithConnectivity extends Component {

Expand All @@ -27,10 +29,14 @@ class AvatarWithConnectivity extends Component {
[classes.bad]: status === ConnectivityStatus.BAD,
})

const tooltip = <span>Profile published <Moment fromNow>{profile.lastPublished}</Moment></span>

return (
<div className={classes.wrapper + ' ' + statusClass}>
<Avatar person={profile} className={avatarClass} />
</div>
<Tooltip id='connectivity' title={tooltip}>
<div className={classes.wrapper + ' ' + statusClass}>
<Avatar person={profile} className={avatarClass} />
</div>
</Tooltip>
)
}
}
Expand Down

0 comments on commit bab4553

Please sign in to comment.