diff options
author | 2019-04-05 16:40:01 +0300 | |
---|---|---|
committer | 2023-01-13 10:37:54 +0300 | |
commit | fa7c14b495be64da4749f0eb1789c24f91993497 (patch) | |
tree | 157b1bd484bc3b6f36c6a59484763086a949455c /vnext/src | |
parent | 0249ff0480c247d70b95423e2388260ee52146fa (diff) |
UserInfo in Chat
Diffstat (limited to 'vnext/src')
-rw-r--r-- | vnext/src/components/Chat.js | 39 | ||||
-rw-r--r-- | vnext/src/components/UserInfo.js | 2 |
2 files changed, 20 insertions, 21 deletions
diff --git a/vnext/src/components/Chat.js b/vnext/src/components/Chat.js index 0da8dcde..57415d29 100644 --- a/vnext/src/components/Chat.js +++ b/vnext/src/components/Chat.js @@ -5,6 +5,7 @@ import moment from 'moment'; import PM from './PM'; import MessageInput from './MessageInput'; +import UserInfo from './UserInfo'; import { getChat, pm } from '../api'; @@ -56,27 +57,25 @@ export default class Chat extends React.Component { const { chats } = this.state; const uname = this.props.match.params.user; return ( - <div className="msgs"> - <article className="msg-cont"> - - {uname ? ( - <div className="chatroom"> - <ul className="Chat_messages"> - { - chats.map((chat) => - <PM key={moment.utc(chat.timestamp).valueOf()} chat={chat} {...this.props} /> - ) - } - </ul> - <MessageInput data={{ mid: 0, timestamp: '0', to: { uname: uname } }} onSend={this.onSend}> - Reply... + <div className="msg-cont"> + <UserInfo user={uname} /> + {uname ? ( + <div className="chatroom"> + <ul className="Chat_messages"> + { + chats.map((chat) => + <PM key={moment.utc(chat.timestamp).valueOf()} chat={chat} {...this.props} /> + ) + } + </ul> + <MessageInput data={{ mid: 0, timestamp: '0', to: { uname: uname } }} onSend={this.onSend}> + Reply... </MessageInput> - </div> - ) : ( - <div className="chatroom no-selection"><p>No chat selected</p></div> - ) - } - </article> + </div> + ) : ( + <div className="chatroom no-selection"><p>No chat selected</p></div> + ) + } </div> ); } diff --git a/vnext/src/components/UserInfo.js b/vnext/src/components/UserInfo.js index e92ccfd5..0a13f050 100644 --- a/vnext/src/components/UserInfo.js +++ b/vnext/src/components/UserInfo.js @@ -41,7 +41,7 @@ export default function UserInfo(props) { { user.uid > 0 && <> - <Link to="/pm"> + <Link to={`/pm/${user.uname}`}> <Icon name="ei-envelope" size="s" /> <span className="desktop">PM</span> </Link> |