Progress with DMs

Progress with DMs
This commit is contained in:
mgabdev
2020-12-03 17:13:11 -05:00
parent a129b3ce3b
commit 137a36b810
53 changed files with 539 additions and 182 deletions

View File

@@ -70,6 +70,7 @@ class HomePage extends React.PureComponent {
intl,
isPro,
totalQueuedItemsCount,
unreadChatsCount,
} = this.props
const { lazyLoaded } = this.state
@@ -80,6 +81,11 @@ class HomePage extends React.PureComponent {
page='home'
title={title}
actions={[
{
icon: 'chat',
to: '/messages',
count: unreadChatsCount,
},
{
icon: 'search',
to: '/search',
@@ -117,6 +123,7 @@ const messages = defineMessages({
const mapStateToProps = (state) => ({
totalQueuedItemsCount: state.getIn(['timelines', 'home', 'totalQueuedItemsCount']),
unreadChatsCount: state.getIn(['chats', 'chatsUnreadCount']),
isPro: state.getIn(['accounts', me, 'is_pro']),
})
@@ -125,6 +132,7 @@ HomePage.propTypes = {
dispatch: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
isPro: PropTypes.bool,
unreadChatsCount: PropTypes.number.isRequired,
totalQueuedItemsCount: PropTypes.number.isRequired,
}

View File

@@ -1,10 +1,23 @@
import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import isObject from 'lodash.isobject'
import { setChatConversationSelected } from '../actions/chats'
import PageTitle from '../features/ui/util/page_title'
import MessagesLayout from '../layouts/messages_layout'
class MessagesPage extends React.PureComponent {
componentDidMount() {
if (isObject(this.props.params)) {
const { chatConversationId } = this.props.params
if (chatConversationId) {
this.props.dispatch(setChatConversationSelected(chatConversationId))
}
}
}
render() {
const {
children,
@@ -34,4 +47,4 @@ MessagesPage.propTypes = {
source: PropTypes.string,
}
export default MessagesPage
export default connect()(MessagesPage)