mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-30 13:19:03 +01:00
Don't render the media list when there's no media
This stops the empty compose view from scrolling on 4-inch devices.
This commit is contained in:
parent
db21724a5a
commit
cbcb7e1241
1 changed files with 7 additions and 3 deletions
|
@ -18,9 +18,13 @@ const UploadForm = React.createClass({
|
||||||
mixins: [PureRenderMixin],
|
mixins: [PureRenderMixin],
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { intl } = this.props;
|
const { intl, media } = this.props;
|
||||||
|
|
||||||
const uploads = this.props.media.map(attachment => (
|
if (!media.size) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const uploads = media.map(attachment => (
|
||||||
<div key={attachment.get('id')} style={{ borderRadius: '4px', marginBottom: '10px' }} className='transparent-background'>
|
<div key={attachment.get('id')} style={{ borderRadius: '4px', marginBottom: '10px' }} className='transparent-background'>
|
||||||
<div style={{ width: '100%', height: '100px', borderRadius: '4px', background: `url(${attachment.get('preview_url')}) no-repeat center`, backgroundSize: 'cover' }}>
|
<div style={{ width: '100%', height: '100px', borderRadius: '4px', background: `url(${attachment.get('preview_url')}) no-repeat center`, backgroundSize: 'cover' }}>
|
||||||
<IconButton icon='times' title={intl.formatMessage(messages.undo)} size={36} onClick={this.props.onRemoveFile.bind(this, attachment.get('id'))} />
|
<IconButton icon='times' title={intl.formatMessage(messages.undo)} size={36} onClick={this.props.onRemoveFile.bind(this, attachment.get('id'))} />
|
||||||
|
@ -29,7 +33,7 @@ const UploadForm = React.createClass({
|
||||||
));
|
));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ marginBottom: '20px', padding: '10px', overflow: 'hidden' }}>
|
<div style={{ marginBottom: '20px', padding: '10px', overflow: 'hidden', flexShrink: '0' }}>
|
||||||
{uploads}
|
{uploads}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue