|
@@ -9,21 +9,14 @@ import {
|
|
|
actionChatGroup,
|
|
|
actionMessage,
|
|
|
actionUsers,
|
|
|
+ actionAllMessOneUser,
|
|
|
} from "./chatGroups/actionChatGroup/actionChatGroup";
|
|
|
import history from "../history";
|
|
|
|
|
|
-const Create = () => {
|
|
|
- return (
|
|
|
- <div className="create">
|
|
|
- <input type="text" />
|
|
|
- </div>
|
|
|
- );
|
|
|
-};
|
|
|
-
|
|
|
class MyProfile1 extends Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
- this.state = { text: "" };
|
|
|
+ this.state = { text: ""};
|
|
|
}
|
|
|
|
|
|
way(obj, resolverName, a) {
|
|
@@ -55,6 +48,8 @@ class MyProfile1 extends Component {
|
|
|
const a = localStorage.getItem("id");
|
|
|
this.props.chatGroup(a);
|
|
|
this.props.message();
|
|
|
+ // const ar = localStorage.getItem("a");
|
|
|
+ // this.props.allMessOneUser("2");
|
|
|
}
|
|
|
|
|
|
render() {
|
|
@@ -68,7 +63,7 @@ class MyProfile1 extends Component {
|
|
|
<TeamOutlined />
|
|
|
<span className="span">Список чатов</span>
|
|
|
</div>
|
|
|
- <FormOutlined className="createChat" onClick={() => {}} />
|
|
|
+ <FormOutlined className="createChat" />
|
|
|
</div>
|
|
|
|
|
|
<div className="search-input">
|
|
@@ -86,42 +81,39 @@ class MyProfile1 extends Component {
|
|
|
|
|
|
<div className="chat-groups">
|
|
|
{this.way1("users", "getUser") ||
|
|
|
- this.way("chatGroup", "getAllChatGroupsOneUser", (el) => (
|
|
|
- // <div onClick={() => history.push(`/my_profile/${el.id}`)}>
|
|
|
- <ChatGroupsBar
|
|
|
- key={el.id}
|
|
|
- id={el.id}
|
|
|
- login={
|
|
|
- +localStorage.getItem("id") !== el.autorId.id
|
|
|
- ? el.autorId.login
|
|
|
- : el.partnerId.login
|
|
|
- }
|
|
|
- />
|
|
|
- // </div>
|
|
|
- ))}
|
|
|
+ this.way("chatGroup", "getAllChatGroupsOneUser", (el) => {
|
|
|
+ return (
|
|
|
+ <div key={el.id} onClick={() => console.log(this.state.idChat)}>
|
|
|
+ <ChatGroupsBar
|
|
|
+ id={el.id}
|
|
|
+ login={
|
|
|
+ +localStorage.getItem("id") !== el.autorId.id
|
|
|
+ ? el.autorId.login
|
|
|
+ : el.partnerId.login
|
|
|
+ }
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ })}
|
|
|
</div>
|
|
|
</div>
|
|
|
- {/* <Create /> */}
|
|
|
+
|
|
|
<div className="chat-messages">
|
|
|
<ChatMessage />
|
|
|
- {/* {this.way("message", "getAllMessages", (el) => (
|
|
|
- <ChatMessages
|
|
|
- key={el.id}
|
|
|
- id={
|
|
|
- +localStorage.getItem("id") !== el.autorId.id
|
|
|
- ? el.autorId.id
|
|
|
- : el.partnerId.id
|
|
|
- }
|
|
|
- message={el.message}
|
|
|
- autor={el.autorId}
|
|
|
- partner={el.partnerId}
|
|
|
- login={
|
|
|
- +localStorage.getItem("id") !== el.autorId.id
|
|
|
- ? el.autorId.login
|
|
|
- : el.partnerId.login
|
|
|
- }
|
|
|
- />
|
|
|
- ))} */}
|
|
|
+ {/* {this.way("allMessOneUser", "getAllMessagesOneUser", (el) => {
|
|
|
+ return (
|
|
|
+ <div key={el.id} >
|
|
|
+ <ChatMessage
|
|
|
+ id={el.id}
|
|
|
+ // login={
|
|
|
+ // +localStorage.getItem("id") !== el.autorId.id
|
|
|
+ // ? el.autorId.login
|
|
|
+ // : el.partnerId.login
|
|
|
+ // }
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ })} */}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -139,6 +131,7 @@ const ConnectedChatGroups = connect(
|
|
|
chatGroup: actionChatGroup,
|
|
|
message: actionMessage,
|
|
|
users: actionUsers,
|
|
|
+ allMessOneUser: actionAllMessOneUser,
|
|
|
}
|
|
|
)(MyProfile1);
|
|
|
|