File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,6 +79,8 @@ import { MessageBox } from 'react-chat-elements'
7979| onClick | none | function | message on click (message(object) is returned) |
8080| onOpen | none | function | message on open (file or photo) (message(object) is returned) |
8181| onDownload | none | function | message on download (file or photo) (message(object) is returned) |
82+ | width | none | int | only photo width (optional) |
83+ | height | none | int | only photo height (optional) |
8284
8385
8486## SystemMessage Component
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ export class App extends Component {
6262 position : ( this . token ( ) >= 1 ? 'right' : 'left' ) ,
6363 type : type ,
6464 text : loremIpsum ( { count : 1 , units : 'sentences' } ) ,
65+ width : 300 ,
66+ height : 300 ,
6567 data : {
6668 uri : `data:image/png;base64,${ this . photo ( 150 ) } ` ,
6769 status : {
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ export class MessageBox extends Component {
3131 onOpen = { this . props . onOpen }
3232 onDownload = { this . props . onDownload }
3333 data = { this . props . data }
34+ width = { this . props . width }
35+ height = { this . props . height }
3436 text = { this . props . text } />
3537 }
3638 {
Original file line number Diff line number Diff line change @@ -28,7 +28,12 @@ export class PhotoMessage extends Component {
2828
2929 return (
3030 < div className = "rce-mbox-photo" >
31- < div className = "rce-mbox-photo--img" >
31+ < div
32+ className = "rce-mbox-photo--img"
33+ style = { this . props . width && this . props . height && {
34+ width : this . props . width ,
35+ height : this . props . height ,
36+ } } >
3237 < img src = { this . props . data . uri } alt = { this . props . data . alt } onClick = { this . props . onOpen } />
3338 {
3439 this . props . data . status &&
You can’t perform that action at this time.
0 commit comments