Expand uploaded thumbnail (#2611)

signup-info-prompt
alpaca-tc 2017-04-29 21:29:13 +09:00 committed by Eugen Rochko
parent 7d36a76180
commit 96c84da1d4
2 changed files with 4 additions and 1 deletions

View File

@ -18,7 +18,7 @@ class UploadForm extends React.PureComponent {
<div className='compose-form__upload' key={attachment.get('id')}> <div className='compose-form__upload' key={attachment.get('id')}>
<Motion defaultStyle={{ scale: 0.8 }} style={{ scale: spring(1, { stiffness: 180, damping: 12 }) }}> <Motion defaultStyle={{ scale: 0.8 }} style={{ scale: spring(1, { stiffness: 180, damping: 12 }) }}>
{({ scale }) => {({ scale }) =>
<div className='compose-form__upload-thumbnail' style={{ transform: `translateZ(0) scale(${scale})`, background: `url(${attachment.get('preview_url')}) no-repeat center` }}> <div className='compose-form__upload-thumbnail' style={{ transform: `translateZ(0) scale(${scale})`, backgroundImage: `url(${attachment.get('preview_url')})` }}>
<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'))} />
</div> </div>
} }

View File

@ -274,6 +274,9 @@
.compose-form__upload-thumbnail { .compose-form__upload-thumbnail {
border-radius: 4px; border-radius: 4px;
background-position: center;
background-size: cover;
background-repeat: no-repeat;
height: 100px; height: 100px;
width: 100%; width: 100%;
} }