diff --git a/dev/App.js b/dev/App.js index 8a10d049c..d32befcfc 100644 --- a/dev/App.js +++ b/dev/App.js @@ -10,6 +10,11 @@ export default class App extends Component { addResponseMessage(newMessage); } + handleOnChangeMessage = (event) => { + event.preventDefault(); + console.log(event.target.value); + } + render() { return ( ); diff --git a/src/components/Widget/components/Conversation/components/Sender/index.js b/src/components/Widget/components/Conversation/components/Sender/index.js index 09367a749..892ae3de1 100644 --- a/src/components/Widget/components/Conversation/components/Sender/index.js +++ b/src/components/Widget/components/Conversation/components/Sender/index.js @@ -5,9 +5,9 @@ import send from '@assets/send_button.svg'; import './style.scss'; -const Sender = ({ sendMessage, placeholder, disabledInput, autofocus }) => +const Sender = ({ sendMessage, placeholder, disabledInput, autofocus, handleOnChangeMessage }) =>
- + @@ -15,6 +15,7 @@ const Sender = ({ sendMessage, placeholder, disabledInput, autofocus }) => Sender.propTypes = { sendMessage: PropTypes.func, + handleOnChangeMessage: PropTypes.func, placeholder: PropTypes.string, disabledInput: PropTypes.bool, autofocus: PropTypes.bool diff --git a/src/components/Widget/components/Conversation/index.js b/src/components/Widget/components/Conversation/index.js index 4fee8d370..61556e03e 100644 --- a/src/components/Widget/components/Conversation/index.js +++ b/src/components/Widget/components/Conversation/index.js @@ -19,6 +19,7 @@ const Conversation = props => profileAvatar={props.profileAvatar} /> ); } @@ -59,7 +60,8 @@ Widget.propTypes = { fullScreenMode: PropTypes.bool, badge: PropTypes.number, autofocus: PropTypes.bool, - customLauncher: PropTypes.func + customLauncher: PropTypes.func, + handleOnChangeMessage: PropTypes.func }; export default connect()(Widget); diff --git a/src/components/Widget/layout.js b/src/components/Widget/layout.js index 05d449401..14e3396a3 100644 --- a/src/components/Widget/layout.js +++ b/src/components/Widget/layout.js @@ -25,6 +25,7 @@ const WidgetLayout = props => ( disabledInput={props.disabledInput} autofocus={props.autofocus} titleAvatar={props.titleAvatar} + handleOnChangeMessage={props.handleOnChangeMessage} /> } {props.customLauncher ? @@ -52,7 +53,8 @@ WidgetLayout.propTypes = { fullScreenMode: PropTypes.bool, badge: PropTypes.number, autofocus: PropTypes.bool, - customLauncher: PropTypes.func + customLauncher: PropTypes.func, + handleOnChangeMessage: PropTypes.func, }; export default connect(store => ({ diff --git a/src/index.js b/src/index.js index 753c51b10..b51e6e44e 100644 --- a/src/index.js +++ b/src/index.js @@ -19,6 +19,7 @@ const ConnectedWidget = props => badge={props.badge} autofocus={props.autofocus} customLauncher={props.launcher} + handleOnChangeMessage={props.handleOnChangeMessage} /> ; @@ -33,7 +34,8 @@ ConnectedWidget.propTypes = { fullScreenMode: PropTypes.bool, badge: PropTypes.number, autofocus: PropTypes.bool, - launcher: PropTypes.func + launcher: PropTypes.func, + handleOnChangeMessage: PropTypes.func, }; ConnectedWidget.defaultProps = {