Skip to content

Commit

Permalink
Add a tooltip. (keybase#23785)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjspooner authored Apr 15, 2020
1 parent 79ea592 commit 90125f0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions shared/chat/inbox/row/small-team/bottom-line.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ type Props = {
draft?: string
}

const SnippetDecoration = (type: Kb.IconType, color: string) => {
return (
const SnippetDecoration = (type: Kb.IconType, color: string, tooltip?: string) => {
const icon = (
<Kb.Icon
color={color}
type={type}
fontSize={Styles.isMobile ? 16 : 12}
style={{alignSelf: 'flex-start'}}
/>
)
return tooltip ? <Kb.WithTooltip tooltip={tooltip}>{icon}</Kb.WithTooltip> : icon
}

const BottomLine = React.memo((props: Props) => {
Expand Down Expand Up @@ -90,12 +91,13 @@ const BottomLine = React.memo((props: Props) => {

switch (props.snippetDecoration) {
case RPCChatTypes.SnippetDecoration.pendingMessage:
snippetDecoration = SnippetDecoration('iconfont-hourglass', defaultIconColor)
snippetDecoration = SnippetDecoration('iconfont-hourglass', defaultIconColor, 'Sending…')
break
case RPCChatTypes.SnippetDecoration.failedPendingMessage:
snippetDecoration = SnippetDecoration(
'iconfont-exclamation',
props.isSelected ? Styles.globalColors.white : Styles.globalColors.red
props.isSelected ? Styles.globalColors.white : Styles.globalColors.red,
'Failed to send'
)
break
case RPCChatTypes.SnippetDecoration.explodingMessage:
Expand Down

0 comments on commit 90125f0

Please sign in to comment.