diff --git a/embark-ui/src/components/Communication.js b/embark-ui/src/components/Communication.js index 888364b30..27f974cd0 100644 --- a/embark-ui/src/components/Communication.js +++ b/embark-ui/src/components/Communication.js @@ -1,6 +1,6 @@ import PropTypes from "prop-types"; import React, {Component} from 'react'; -import {Button, Form} from 'tabler-react'; +import {Button, Form, Card, Grid, List} from 'tabler-react'; class Communication extends Component { constructor(props) { @@ -11,8 +11,7 @@ class Communication extends Component { channel: '', message: '', subscribedChannels: [], - messageList: [], - logs: [] + messageList: [] }; } @@ -25,25 +24,18 @@ class Communication extends Component { sendMessage(e) { e.preventDefault(); this.props.sendMessage(this.state.channel, this.state.message); - this.addToLog("EmbarkJS.Messages.sendMessage({topic: '" + this.state.channel + "', data: '" + this.state.message + "'})"); } listenToChannel(e) { e.preventDefault(); const subscribedChannels = this.state.subscribedChannels; - subscribedChannels.push(Subscribed to {this.state.listenTo}. Now try sending a message); + subscribedChannels.push(this.state.listenTo); this.setState({ subscribedChannels }); this.props.listenToMessages(this.state.listenTo); - this.addToLog("EmbarkJS.Messages.listenTo({topic: ['" + this.state.listenTo + "']}).then(function(message) {})"); - } - - addToLog(txt) { - this.state.logs.push(txt); - this.setState({logs: this.state.logs}); } render() { @@ -58,26 +50,37 @@ class Communication extends Component { onChange={e => this.handleChange(e, 'listenTo')}/> -
{item}
)} -Messages received:
-{channelName}
- {this.props.channels[channelName].messages.map((message, f) => { - return{message}
; - })} -{message}
; + })} +Javascript calls being made:
-EmbarkJS.Messages.setProvider('whisper')
- { - this.state.logs.map((item, i) =>{item}
) - } -