Skip to content

Commit 96c3eb9

Browse files
LocationMessage mapURL and staticURL options added.
1 parent 374aa3b commit 96c3eb9

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,8 @@ import { LocationMessage } from 'react-chat-elements'
462462
data={{
463463
latitude: '37.773972',
464464
longitude: '-122.431297',
465+
// staticURL: '<optional>',
466+
// mapURL: '<optional>'
465467
}}/>
466468
```
467469

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-chat-elements",
3-
"version": "10.4.3",
3+
"version": "10.5.0",
44
"description": "Reactjs chat components",
55
"author": "Avare Kodcu <abdurrahmaneker58@gmail.com>",
66
"main": "dist/main.js",

src/LocationMessage/LocationMessage.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,21 @@ export class LocationMessage extends Component {
3434
}
3535

3636
render() {
37+
const data = this.props.data || {};
38+
3739
return (
3840
<div className='rce-container-lmsg'>
3941
<a
4042
onClick={this.props.onOpen}
4143
target={this.props.target}
42-
href={this.props.href || this.props.src || this.buildURL(MAP_URL)}
44+
href={this.props.href || this.props.src || this.buildURL(data.mapURL || MAP_URL)}
4345
className={this.className()}>
4446
<img
4547
onError={this.props.onError}
4648
className='rce-mbox-location-img'
4749
src={
4850
this.props.src ||
49-
this.buildURL(STATIC_URL)
51+
this.buildURL(data.staticURL || STATIC_URL)
5052
}/>
5153
</a>
5254
{

0 commit comments

Comments
 (0)