From ad10a80a9925c247ef14837d3a14ff7e7375f001 Mon Sep 17 00:00:00 2001 From: kibigo! Date: Fri, 5 Jan 2018 20:04:13 -0800 Subject: Styling and autosuggest fixes for #293 --- .../flavours/glitch/features/composer/index.js | 11 ++---- .../glitch/features/composer/reply/index.js | 42 ++++------------------ .../glitch/features/composer/textarea/index.js | 4 +-- .../composer/textarea/suggestions/item/index.js | 15 ++++++-- 4 files changed, 24 insertions(+), 48 deletions(-) (limited to 'app/javascript/flavours/glitch/features/composer') diff --git a/app/javascript/flavours/glitch/features/composer/index.js b/app/javascript/flavours/glitch/features/composer/index.js index 4c9d4b197..3582dedfe 100644 --- a/app/javascript/flavours/glitch/features/composer/index.js +++ b/app/javascript/flavours/glitch/features/composer/index.js @@ -59,7 +59,7 @@ function mapStateToProps (state) { preselectDate: state.getIn(['compose', 'preselectDate']), privacy: state.getIn(['compose', 'privacy']), progress: state.getIn(['compose', 'progress']), - replyAccount: inReplyTo ? state.getIn(['accounts', state.getIn(['statuses', inReplyTo, 'account'])]) : null, + replyAccount: inReplyTo ? state.getIn(['statuses', inReplyTo, 'account']) : null, replyContent: inReplyTo ? state.getIn(['statuses', inReplyTo, 'contentHtml']) : null, resetFileKey: state.getIn(['compose', 'resetFileKey']), sideArm: state.getIn(['local_settings', 'side_arm']), @@ -265,7 +265,6 @@ class Composer extends React.Component { handleSubmit, handleRefTextarea, } = this.handlers; - const { history } = this.context; const { acceptContentTypes, amUnlocked, @@ -317,7 +316,6 @@ class Composer extends React.Component { @@ -384,11 +382,6 @@ class Composer extends React.Component { } -// Context -Composer.contextTypes = { - history: PropTypes.object, -}; - // Props. Composer.propTypes = { intl: PropTypes.object.isRequired, @@ -405,7 +398,7 @@ Composer.propTypes = { preselectDate: PropTypes.instanceOf(Date), privacy: PropTypes.string, progress: PropTypes.number, - replyAccount: ImmutablePropTypes.map, + replyAccount: PropTypes.string, replyContent: PropTypes.string, resetFileKey: PropTypes.number, sideArm: PropTypes.string, diff --git a/app/javascript/flavours/glitch/features/composer/reply/index.js b/app/javascript/flavours/glitch/features/composer/reply/index.js index 568705aff..0b8ceddee 100644 --- a/app/javascript/flavours/glitch/features/composer/reply/index.js +++ b/app/javascript/flavours/glitch/features/composer/reply/index.js @@ -1,12 +1,10 @@ // Package imports. import PropTypes from 'prop-types'; import React from 'react'; -import ImmutablePropTypes from 'react-immutable-proptypes'; import { defineMessages } from 'react-intl'; // Components. -import Avatar from 'flavours/glitch/components/avatar'; -import DisplayName from 'flavours/glitch/components/display_name'; +import AccountContainer from 'flavours/glitch/containers/account_container'; import IconButton from 'flavours/glitch/components/icon_button'; // Utils. @@ -31,17 +29,6 @@ const handlers = { onCancel(); } }, - - // Handles a click on the status's account. - handleClickAccount () { - const { - account, - history, - } = this.props; - if (history) { - history.push(`/accounts/${account.get('id')}`); - } - }, }; // The component. @@ -55,10 +42,7 @@ export default class ComposerReply extends React.PureComponent { // Rendering. render () { - const { - handleClick, - handleClickAccount, - } = this.handlers; + const { handleClick } = this.handlers; const { account, content, @@ -76,21 +60,10 @@ export default class ComposerReply extends React.PureComponent { title={intl.formatMessage(messages.cancel)} /> {account ? ( - - - - + ) : null}
-- cgit