You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
863 B
37 lines
863 B
import React, { Component } from 'react'; |
|
import {Link} from 'react-router-dom'; |
|
import { list } from '../../Redux/actions/chat'; |
|
import { connect } from 'react-redux'; |
|
import ChatIcon from '@material-ui/icons/Chat'; |
|
import Chat from './Chat/index'; |
|
import Navbar from '../Home/Navbar/index'; |
|
|
|
|
|
import './index.scss'; |
|
|
|
class ChatList extends Component { |
|
componentDidMount() { |
|
this.props.list(); |
|
} |
|
render() { |
|
return ( |
|
<div className="chat-list d-flex flex-column"> |
|
<Navbar /> |
|
{this.props.chat_list.map((item, i) => ( |
|
<Chat key={i} data={item} /> |
|
))} |
|
<Link to="/characters" className="chat-list__float d-flex"> |
|
<ChatIcon fontSize="small" /> |
|
</Link> |
|
</div> |
|
); |
|
} |
|
} |
|
|
|
export default connect( |
|
(state) => ({ |
|
chat_list: state.chat.list || [], |
|
}), |
|
{ list } |
|
)(ChatList); |
|
|
|
|