From 08896f7dcfe2a1732e17d3854ed3d79bdb61c73b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 18 Sep 2016 13:03:37 +0200 Subject: [PATCH] Detailed status view scrollable --- .../components/components/media_gallery.jsx | 5 +++-- .../components/components/status.jsx | 2 +- .../components/features/status/index.jsx | 18 +++++++++++------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/components/components/media_gallery.jsx b/app/assets/javascripts/components/components/media_gallery.jsx index 81bf7c87c..20f9a3d87 100644 --- a/app/assets/javascripts/components/components/media_gallery.jsx +++ b/app/assets/javascripts/components/components/media_gallery.jsx @@ -4,7 +4,8 @@ import PureRenderMixin from 'react-addons-pure-render-mixin'; const MediaGallery = React.createClass({ propTypes: { - media: ImmutablePropTypes.list.isRequired + media: ImmutablePropTypes.list.isRequired, + height: React.PropTypes.number.isRequired }, mixins: [PureRenderMixin], @@ -63,7 +64,7 @@ const MediaGallery = React.createClass({ }); return ( -
+
{children}
); diff --git a/app/assets/javascripts/components/components/status.jsx b/app/assets/javascripts/components/components/status.jsx index 020d90a12..1df7f1fcf 100644 --- a/app/assets/javascripts/components/components/status.jsx +++ b/app/assets/javascripts/components/components/status.jsx @@ -69,7 +69,7 @@ const Status = React.createClass({ if (status.getIn(['media_attachments', 0, 'type']) === 'video') { media = ; } else { - media = ; + media = ; } } diff --git a/app/assets/javascripts/components/features/status/index.jsx b/app/assets/javascripts/components/features/status/index.jsx index 39bc2bec5..03719d88e 100644 --- a/app/assets/javascripts/components/features/status/index.jsx +++ b/app/assets/javascripts/components/features/status/index.jsx @@ -25,8 +25,8 @@ function selectStatuses(state, ids) { const mapStateToProps = (state, props) => ({ status: selectStatus(state, Number(props.params.statusId)), - ancestors: selectStatuses(state, state.getIn(['timelines', 'ancestors', Number(props.params.statusId)], Immutable.List())), - descendants: selectStatuses(state, state.getIn(['timelines', 'descendants', Number(props.params.statusId)], Immutable.List())) + ancestors: selectStatuses(state, state.getIn(['timelines', 'ancestors', Number(props.params.statusId)], Immutable.OrderedSet())), + descendants: selectStatuses(state, state.getIn(['timelines', 'descendants', Number(props.params.statusId)], Immutable.OrderedSet())) }); const Status = React.createClass({ @@ -35,8 +35,8 @@ const Status = React.createClass({ params: React.PropTypes.object.isRequired, dispatch: React.PropTypes.func.isRequired, status: ImmutablePropTypes.map, - ancestors: ImmutablePropTypes.list.isRequired, - descendants: ImmutablePropTypes.list.isRequired + ancestors: ImmutablePropTypes.orderedSet.isRequired, + descendants: ImmutablePropTypes.orderedSet.isRequired }, mixins: [PureRenderMixin], @@ -74,11 +74,15 @@ const Status = React.createClass({ return
Loading {this.props.params.statusId}...
; } + const account = status.get('account'); + return ( -
- {this.renderChildren(ancestors)} +
+
{this.renderChildren(ancestors)}
+ - {this.renderChildren(descendants)} + +
{this.renderChildren(descendants)}
); }