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.

36 lines
1.0 KiB

  1. import React from 'react';
  2. import { connect } from 'react-redux';
  3. import PropTypes from 'prop-types';
  4. import SearchContainer from 'mastodon/features/compose/containers/search_container';
  5. import ComposeFormContainer from 'mastodon/features/compose/containers/compose_form_container';
  6. import NavigationContainer from 'mastodon/features/compose/containers/navigation_container';
  7. import LinkFooter from './link_footer';
  8. import { changeComposing } from 'mastodon/actions/compose';
  9. export default @connect()
  10. class ComposePanel extends React.PureComponent {
  11. static propTypes = {
  12. dispatch: PropTypes.func.isRequired,
  13. };
  14. onFocus = () => {
  15. this.props.dispatch(changeComposing(true));
  16. }
  17. onBlur = () => {
  18. this.props.dispatch(changeComposing(false));
  19. }
  20. render() {
  21. return (
  22. <div className='compose-panel' onFocus={this.onFocus}>
  23. <SearchContainer openInRoute />
  24. <NavigationContainer onClose={this.onBlur} />
  25. <ComposeFormContainer singleColumn />
  26. <LinkFooter withHotkeys />
  27. </div>
  28. );
  29. }
  30. }