diff --git a/app/soapbox/features/chats/components/chat_panes.js b/app/soapbox/features/chats/components/chat_panes.js index 3ddf4ab58..1bd7167bd 100644 --- a/app/soapbox/features/chats/components/chat_panes.js +++ b/app/soapbox/features/chats/components/chat_panes.js @@ -44,7 +44,6 @@ class ChatPanes extends ImmutablePureComponent { handleClickChat = (chat) => { this.props.dispatch(openChat(chat.get('id'))); - // TODO: Focus chat input } handleMainWindowToggle = () => { diff --git a/app/soapbox/features/chats/index.js b/app/soapbox/features/chats/index.js new file mode 100644 index 000000000..bfb605f86 --- /dev/null +++ b/app/soapbox/features/chats/index.js @@ -0,0 +1,46 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import Column from '../../components/column'; +import ColumnHeader from '../../components/column_header'; +import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; +import ChatList from './components/chat_list'; + +const messages = defineMessages({ + title: { id: 'column.chats', defaultMessage: 'Chats' }, +}); + +export default @injectIntl +class ChatIndex extends React.PureComponent { + + static propTypes = { + dispatch: PropTypes.func.isRequired, + intl: PropTypes.object.isRequired, + }; + + static contextTypes = { + router: PropTypes.object, + }; + + handleClickChat = (chat) => { + this.context.router.history.push(`/chats/${chat.get('id')}`); + } + + render() { + const { intl } = this.props; + + return ( + + + + } + /> + + ); + } + +} diff --git a/app/soapbox/features/ui/index.js b/app/soapbox/features/ui/index.js index 8c6cbcc22..4af1ab29c 100644 --- a/app/soapbox/features/ui/index.js +++ b/app/soapbox/features/ui/index.js @@ -79,6 +79,7 @@ import { PasswordReset, SecurityForm, MfaForm, + ChatIndex, } from './util/async-components'; // Dummy import, to make sure that ends up in the application bundle. @@ -237,6 +238,9 @@ class SwitchingColumnsArea extends React.PureComponent { + + {/* */} + diff --git a/app/soapbox/features/ui/util/async-components.js b/app/soapbox/features/ui/util/async-components.js index c93ad2f8e..9d39c099f 100644 --- a/app/soapbox/features/ui/util/async-components.js +++ b/app/soapbox/features/ui/util/async-components.js @@ -197,3 +197,7 @@ export function SecurityForm() { export function MfaForm() { return import(/* webpackChunkName: "features/security/mfa_form" */'../../security/mfa_form'); } + +export function ChatIndex() { + return import(/* webpackChunkName: "features/chats" */'../../chats'); +}