|
|
|
@ -29,9 +29,10 @@ export default class NormalMessage extends Component { |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
render() { |
|
|
|
|
const { message, user, document, isSelf, prevUserId } = this.props; |
|
|
|
|
const { message, user, document, isSelf, prevUserId, children } = this.props; |
|
|
|
|
const { messageMenu } = this.state; |
|
|
|
|
const hasavatar = prevUserId != message.userId; |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div |
|
|
|
|
className="normal-message d-flex flex-column d-flex" |
|
|
|
@ -65,7 +66,7 @@ export default class NormalMessage extends Component { |
|
|
|
|
: `normal-message__box normal-message__box--file` |
|
|
|
|
} |
|
|
|
|
style={{ |
|
|
|
|
paddingTop: hasavatar ? 25 : 10, |
|
|
|
|
paddingTop: hasavatar ? 25 : 15, |
|
|
|
|
backgroundColor: isSelf ? 'rgb(15, 93, 190)' : 'white', |
|
|
|
|
width: 'calc(100%-70px)', |
|
|
|
|
}} |
|
|
|
@ -141,7 +142,12 @@ export default class NormalMessage extends Component { |
|
|
|
|
) : null} |
|
|
|
|
{message.voice !== null ? <ReactAudioPlayer src={message.voice.url} controls /> : null} |
|
|
|
|
{message.image !== null ? ( |
|
|
|
|
<div className="normal-message__box--caption"> |
|
|
|
|
<div |
|
|
|
|
className="normal-message__box--caption" |
|
|
|
|
ref={(refElem) => { |
|
|
|
|
console.log(refElem); |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
<a href={message.image} download> |
|
|
|
|
<img src={message.image} download alt="" /> |
|
|
|
|
</a> |
|
|
|
@ -192,6 +198,7 @@ export default class NormalMessage extends Component { |
|
|
|
|
<div>{message.document.name}</div> |
|
|
|
|
</a> |
|
|
|
|
) : null} |
|
|
|
|
|
|
|
|
|
<div className="normal-message__box--date d-flex"> |
|
|
|
|
<span style={{ color: isSelf ? '#aaa' : 'gray' }}> |
|
|
|
|
{message.status == 1 && <DoneIcon fontSize="small" />} |
|
|
|
@ -208,6 +215,7 @@ export default class NormalMessage extends Component { |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div className={isSelf ? 'icons self' : 'icons'}> |
|
|
|
|
<div> |
|
|
|
|
<FavoriteIcon fontSize="samall" color="primary" /> |
|
|
|
@ -223,6 +231,17 @@ export default class NormalMessage extends Component { |
|
|
|
|
</div> */} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div |
|
|
|
|
className="f-flex keys" |
|
|
|
|
style={{ |
|
|
|
|
width: 'calc(100% - 70px)', |
|
|
|
|
marginRight: isSelf ? 0 : 70, |
|
|
|
|
marginLeft: isSelf ? 70 : 0, |
|
|
|
|
alignSelf: isSelf ? 'flex-end' : 'flex-start', |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
{children} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|