mastodon/app/javascript/mastodon/features/ui/components/messaging/instantMessaging.js

61 lines
1.7 KiB
JavaScript

import React from 'react';
import ImmutablePureComponent from 'react-immutable-pure-component';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ContactsList from './contacts-list';
import ConversationStack from './conversationStack';
const mapStateToProps = (state, props) => ({
isAccount : !!state.getIn(['accounts', props.params.accountId]),
accountIds: state.getIn(['user_lists', 'following', props.params.accountId, 'items']),
hasMore : !!state.getIn(['user_lists', 'following', props.params.accountId, 'next']),
blockedBy : state.getIn(['relationships', props.params.accountId, 'blocked_by'], false),
});
// @connect(mapStateToProps)
/**
* main component for IM, gathers contact list and list of conversations
*/
export default class InstantMessaging extends ImmutablePureComponent {
static propTypes = {
// params : PropTypes.object.isRequired,
dispatch : PropTypes.func.isRequired,
shouldUpdateScroll: PropTypes.func,
accountIds : ImmutablePropTypes.list,
hasMore : PropTypes.bool,
blockedBy : PropTypes.bool,
isAccount : PropTypes.bool,
multiColumn : PropTypes.bool,
};
// static defaultProps = {
// threadsCompile: true,
// };
// openConversationWith(account) {
// let conversationFound = account;
// if conversation exist, focus on it
// if (conversationFound) {
//
// } else {
//
// }
// else, create conversation and focus on it
// };
// submitCompose() {
//
// };
render() {
return (
<div className='main-instant-messaging'>
<ContactsList />
<ConversationStack />
</div >
);
}
};