From d11277e691f2a733df2bc4f1a5d557c902a0efc9 Mon Sep 17 00:00:00 2001 From: devyaniChoubey <52153085+devyaniChoubey@users.noreply.github.com> Date: Tue, 17 Mar 2020 21:44:54 +0530 Subject: [PATCH] [IMPROVEMENT] Make username clickable on message (#1618) Co-authored-by: Diego Mello --- .../__snapshots__/Storyshots.test.js.snap | 3772 +++++++++++------ app/containers/message/User.js | 31 +- 2 files changed, 2511 insertions(+), 1292 deletions(-) diff --git a/__tests__/__snapshots__/Storyshots.test.js.snap b/__tests__/__snapshots__/Storyshots.test.js.snap index 758bf734..030de158 100644 --- a/__tests__/__snapshots__/Storyshots.test.js.snap +++ b/__tests__/__snapshots__/Storyshots.test.js.snap @@ -3792,33 +3792,51 @@ exports[`Storyshots Message list message 1`] = ` } > - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. - + + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + + - - diego.mello - + + diego.mello + + - - Diego Mello - @ - diego.mello + Diego Mello + + @ + diego.mello + - + - - Diego Mello - @ - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + Diego Mello + + @ + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + - + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - Diego Mello - + + Diego Mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - rocket.cat - + + rocket.cat + + - - diego.mello - + + diego.mello + + - - rocket.cat - + + rocket.cat + + - - diego.mello - + + diego.mello + + - - rocket.cat - + + rocket.cat + + - - diego.mello - + + diego.mello + + - - rocket.cat - + + rocket.cat + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + - - diego.mello - + + diego.mello + + { if (isHeader || hasError) { + const navParam = { + t: 'd', + rid: author._id + }; const username = (useRealName && author.name) || author.username; const aliasUsername = alias ? ( @{username}) : null; const time = moment(ts).format(timeFormat); return ( - - - {alias || username} - {aliasUsername} - - + navToRoomInfo(navParam)} + disabled={author._id === user.id} + > + + + {alias || username} + {aliasUsername} + + + {time} { hasError && } @@ -64,7 +75,9 @@ User.propTypes = { alias: PropTypes.string, ts: PropTypes.instanceOf(Date), timeFormat: PropTypes.string, - theme: PropTypes.string + theme: PropTypes.string, + user: PropTypes.obj, + navToRoomInfo: PropTypes.func }; User.displayName = 'MessageUser';