From 28aa505cc40c7c31533c5aeb43d03e79ba3944d5 Mon Sep 17 00:00:00 2001 From: Matthieu Joannon Date: Wed, 6 Mar 2019 17:05:18 +0100 Subject: [PATCH 1/2] fixed named links rendering --- .../components/Messages/components/Message/index.js | 6 +++++- .../components/Messages/components/docViewer/index.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Widget/components/Conversation/components/Messages/components/Message/index.js b/src/components/Widget/components/Conversation/components/Messages/components/Message/index.js index bce1ed55..d5ad3750 100644 --- a/src/components/Widget/components/Conversation/components/Messages/components/Message/index.js +++ b/src/components/Widget/components/Conversation/components/Messages/components/Message/index.js @@ -26,7 +26,11 @@ class Message extends PureComponent { transformLinkUri={null} renderers={{ link: props => - docViewer ? : {props.href} + docViewer ? ( + {props.children} + ) : ( + {props.children} + ) }} /> ) : ( diff --git a/src/components/Widget/components/Conversation/components/Messages/components/docViewer/index.js b/src/components/Widget/components/Conversation/components/Messages/components/docViewer/index.js index 8c0a6bce..8e3f23a4 100644 --- a/src/components/Widget/components/Conversation/components/Messages/components/docViewer/index.js +++ b/src/components/Widget/components/Conversation/components/Messages/components/docViewer/index.js @@ -50,7 +50,7 @@ class DocViewer extends Component { return ( {this.state.openedModal && ( From 24f7a99f170f9bedfb5f8a78294d5ad54c8e7b3b Mon Sep 17 00:00:00 2001 From: Matthieu Joannon Date: Wed, 6 Mar 2019 17:08:14 +0100 Subject: [PATCH 2/2] new version --- CHANGELOG.md | 3 +++ README.md | 2 +- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8b57bf4..ab7f6a62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.5.6 +- fixed a bug where named links would not render in a received message + ## 0.5.5 - new prop, `docViewer`, if this props is true, this will treat every link in received messages as a document and will open it in a popup using docs.google.com/viewer (note: this is an experimental feature and should be used with caution) diff --git a/README.md b/README.md index 9cfc4832..01de1143 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A simple webchat widget to connect with a chatbot. Forked from [react-chat-widge In your ``: ```javascript
- +