| 162 | } |
| 163 | |
| 164 | renderFiles () { |
| 165 | let files = this.state.files; |
| 166 | return Object.keys(files).map((id, i) => { |
| 167 | let file = this.state.files[id]; |
| 168 | let className = classnames({ |
| 169 | 'uploaded': file.status === 2, |
| 170 | 'has-error': file.status === 3 |
| 171 | }); |
| 172 | return ( |
| 173 | <div key={i} className={className}> |
| 174 | <div className="rct-file"> |
| 175 | <span>{file.name}</span> |
| 176 | <a className="remove" onClick={this.removeFile.bind(this, id)}>× {getLang('buttons.cancel')}</a> |
| 177 | </div> |
| 178 | <div ref={(c) => this.files[id] = c} className={'rct-upload-progress'}></div> |
| 179 | </div> |
| 180 | ); |
| 181 | }); |
| 182 | } |
| 183 | |
| 184 | render () { |