File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " react-chat-elements" ,
3- "version" : " 10.0.5 " ,
3+ "version" : " 10.1.0 " ,
44 "description" : " Reactjs chat components" ,
55 "author" : " Avare Kodcu <abdurrahmaneker58@gmail.com>" ,
66 "main" : " dist/main.js" ,
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React, { Component } from 'react';
22import './FileMessage.css' ;
33
44import FaCloudDownload from 'react-icons/lib/fa/cloud-download' ;
5+ import FaError from 'react-icons/lib/fa/exclamation-triangle' ;
56import FaFile from 'react-icons/lib/fa/file' ;
67
78const ProgressBar = require ( 'react-progress-bar.js' ) ;
@@ -37,6 +38,8 @@ export class FileMessage extends Component {
3738 }
3839 } ;
3940
41+ const error = this . props . data . status && this . props . data . status . error === true ;
42+
4043 return (
4144 < div className = 'rce-mbox-file' >
4245 < button onClick = { this . onClick . bind ( this ) } >
@@ -52,13 +55,20 @@ export class FileMessage extends Component {
5255 </ div >
5356 < div className = "rce-mbox-file--buttons" >
5457 {
58+ error &&
59+ < FaError
60+ color = '#ff3d3d' />
61+ }
62+ {
63+ ! error &&
5564 this . props . data . status &&
5665 ! this . props . data . status . download &&
5766 ! this . props . data . status . click &&
5867 < FaCloudDownload
5968 color = '#aaa' />
6069 }
6170 {
71+ ! error &&
6272 this . props . data . status &&
6373 typeof this . props . data . status . loading === 'number' &&
6474 this . props . data . status . loading !== 0 &&
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import React, { Component } from 'react';
33import './PhotoMessage.css' ;
44
55import FaCloudDownload from 'react-icons/lib/fa/cloud-download' ;
6+ import FaError from 'react-icons/lib/fa/exclamation-triangle' ;
67
78const ProgressBar = require ( 'react-progress-bar.js' ) ;
89const Circle = ProgressBar . Circle ;
@@ -26,6 +27,8 @@ export class PhotoMessage extends Component {
2627 }
2728 } ;
2829
30+ const error = this . props . data . status && this . props . data . status . error === true ;
31+
2932 return (
3033 < div className = "rce-mbox-photo" >
3134 < div
@@ -39,7 +42,18 @@ export class PhotoMessage extends Component {
3942 alt = { this . props . data . alt }
4043 onClick = { this . props . onOpen }
4144 onLoad = { this . props . onLoad } />
45+
46+ {
47+ error &&
48+ < div className = "rce-mbox-photo--img__block" >
49+ < button
50+ className = "rce-mbox-photo--img__block-item rce-mbox-photo--download" >
51+ < FaError />
52+ </ button >
53+ </ div >
54+ }
4255 {
56+ ! error &
4357 this . props . data . status &&
4458 ! this . props . data . status . download &&
4559 < div className = "rce-mbox-photo--img__block" >
You can’t perform that action at this time.
0 commit comments