Skip to content

Commit 86e66d0

Browse files
width and height props moved on message data object
1 parent 26a9299 commit 86e66d0

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ 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) |
8482

8583

8684
## SystemMessage Component

example/App.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ 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,
6765
data: {
6866
uri: `data:image/png;base64,${this.photo(150)}`,
6967
status: {
7068
click: false,
7169
loading: 0,
72-
}
70+
},
71+
width: 300,
72+
height: 300,
7373
},
7474
date: new Date(),
7575
};

src/PhotoMessage/PhotoMessage.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ export class PhotoMessage extends Component {
3030
<div className="rce-mbox-photo">
3131
<div
3232
className="rce-mbox-photo--img"
33-
style={this.props.width && this.props.height && {
34-
width: this.props.width,
35-
height: this.props.height,
33+
style={this.props.data.width && this.props.data.height && {
34+
width: this.props.data.width,
35+
height: this.props.data.height,
3636
}}>
3737
<img src={this.props.data.uri} alt={this.props.data.alt} onClick={this.props.onOpen}/>
3838
{

0 commit comments

Comments
 (0)