From bd5ad304bac69b34a3c223e9baac532106db7dd8 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 17 Sep 2016 17:47:26 +0200 Subject: Adding media controller, 1 webm/compose form allowed, previews generated --- .../javascripts/components/components/status.jsx | 3 ++- .../javascripts/components/components/upload_form.jsx | 4 +++- .../javascripts/components/features/status/index.jsx | 18 ++++++++++++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) (limited to 'app/assets/javascripts/components') diff --git a/app/assets/javascripts/components/components/status.jsx b/app/assets/javascripts/components/components/status.jsx index 3882fc97f..8cdbd5625 100644 --- a/app/assets/javascripts/components/components/status.jsx +++ b/app/assets/javascripts/components/components/status.jsx @@ -40,8 +40,9 @@ const Status = React.createClass({ if (e.button === 0) { e.preventDefault(); hashHistory.push(`/accounts/${id}`); - e.stopPropagation(); } + + e.stopPropagation(); }, render () { diff --git a/app/assets/javascripts/components/components/upload_form.jsx b/app/assets/javascripts/components/components/upload_form.jsx index 429e672c0..f0b6f7992 100644 --- a/app/assets/javascripts/components/components/upload_form.jsx +++ b/app/assets/javascripts/components/components/upload_form.jsx @@ -25,9 +25,11 @@ const UploadForm = React.createClass({ ); }.bind(this)); + const noMoreAllowed = (this.props.media.some(m => m.get('type') === 'video')) || (this.props.media.size > 3); + return (
- 3} /> +
{uploads} diff --git a/app/assets/javascripts/components/features/status/index.jsx b/app/assets/javascripts/components/features/status/index.jsx index 122db8906..39bc2bec5 100644 --- a/app/assets/javascripts/components/features/status/index.jsx +++ b/app/assets/javascripts/components/features/status/index.jsx @@ -4,6 +4,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import { fetchStatus } from '../../actions/statuses'; import Immutable from 'immutable'; import EmbeddedStatus from '../../components/status'; +import { favourite, reblog } from '../../actions/interactions'; +import { replyCompose } from '../../actions/compose'; function selectStatus(state, id) { let status = state.getIn(['timelines', 'statuses', id]); @@ -49,8 +51,20 @@ const Status = React.createClass({ } }, + handleFavouriteClick (status) { + this.props.dispatch(favourite(status)); + }, + + handleReplyClick (status) { + this.props.dispatch(replyCompose(status)); + }, + + handleReblogClick (status) { + this.props.dispatch(reblog(status)); + }, + renderChildren (list) { - return list.map(s => ); + return list.map(s => ); }, render () { @@ -63,7 +77,7 @@ const Status = React.createClass({ return (
{this.renderChildren(ancestors)} - + {this.renderChildren(descendants)}
); -- cgit