The code powering m.abunchtell.com https://m.abunchtell.com
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 

20 рядки
762 B

  1. import { connect } from 'react-redux';
  2. import Conversation from '../components/conversation';
  3. import { markConversationRead } from '../../../actions/conversations';
  4. const mapStateToProps = (state, { conversationId }) => {
  5. const conversation = state.getIn(['conversations', 'items']).find(x => x.get('id') === conversationId);
  6. return {
  7. accounts: conversation.get('accounts').map(accountId => state.getIn(['accounts', accountId], null)),
  8. unread: conversation.get('unread'),
  9. lastStatusId: conversation.get('last_status', null),
  10. };
  11. };
  12. const mapDispatchToProps = (dispatch, { conversationId }) => ({
  13. markRead: () => dispatch(markConversationRead(conversationId)),
  14. });
  15. export default connect(mapStateToProps, mapDispatchToProps)(Conversation);