File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ import { MessageBox } from 'react-chat-elements'
133133| onClick | none | function | message on click (message(object) is returned) |
134134| onOpen | none | function | message on open (file or photo) (message(object) is returned) |
135135| onDownload | none | function | message on download (file or photo) (message(object) is returned) |
136+ | onLoad | none | function | message on load photo |
136137| onTitleClick | none | function | message title on click event |
137138| onForwardClick | none | function | message forward on click event |
138139| forwarded | none | boolean | message forward icon |
Original file line number Diff line number Diff line change @@ -109,6 +109,9 @@ export class App extends Component {
109109 latitude : '37.773972' ,
110110 longitude : '-122.431297' ,
111111 } ,
112+ onLoad : ( ) => {
113+ console . log ( 'Photo loaded' ) ;
114+ } ,
112115 status : status ,
113116 date : new Date ( ) ,
114117 dateString : moment ( new Date ( ) ) . format ( 'HH:mm' ) ,
Original file line number Diff line number Diff line change 11{
22 "name" : " react-chat-elements" ,
3- "version" : " 10.0.0 " ,
3+ "version" : " 10.0.1 " ,
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 @@ -110,6 +110,7 @@ export class MessageBox extends Component {
110110 < PhotoMessage
111111 onOpen = { this . props . onOpen }
112112 onDownload = { this . props . onDownload }
113+ onLoad = { this . props . onLoad }
113114 data = { this . props . data }
114115 width = { this . props . width }
115116 height = { this . props . height }
@@ -220,6 +221,7 @@ MessageBox.defaultProps = {
220221 onClick : null ,
221222 onOpen : null ,
222223 onDownload : null ,
224+ onLoad : null ,
223225 forwarded : false ,
224226 status : null ,
225227 dateString : null ,
Original file line number Diff line number Diff line change @@ -34,7 +34,11 @@ export class PhotoMessage extends Component {
3434 width : this . props . data . width ,
3535 height : this . props . data . height ,
3636 } } >
37- < img src = { this . props . data . uri } alt = { this . props . data . alt } onClick = { this . props . onOpen } />
37+ < img
38+ src = { this . props . data . uri }
39+ alt = { this . props . data . alt }
40+ onClick = { this . props . onOpen }
41+ onLoad = { this . props . onLoad } />
3842 {
3943 this . props . data . status &&
4044 ! this . props . data . status . download &&
@@ -75,6 +79,7 @@ PhotoMessage.defaultProps = {
7579 data : { } ,
7680 onDownload : null ,
7781 onOpen : null ,
82+ onLoad : null ,
7883} ;
7984
8085
You can’t perform that action at this time.
0 commit comments