Detailed status view scrollable

This commit is contained in:
Eugen Rochko
2016-09-18 13:03:37 +02:00
parent ab7291b8fe
commit 08896f7dcf
3 changed files with 15 additions and 10 deletions

View File

@ -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 (
<div style={{ marginTop: '8px', overflow: 'hidden', width: '100%', height: '110px', boxSizing: 'border-box' }}>
<div style={{ marginTop: '8px', overflow: 'hidden', width: '100%', height: `${this.props.height}px`, boxSizing: 'border-box' }}>
{children}
</div>
);

View File

@ -69,7 +69,7 @@ const Status = React.createClass({
if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
media = <VideoPlayer media={status.getIn(['media_attachments', 0])} />;
} else {
media = <MediaGallery media={status.get('media_attachments')} />;
media = <MediaGallery media={status.get('media_attachments')} height={110} />;
}
}