diff --git a/app/src/components/Sidebar/History.tsx b/app/src/components/Sidebar/History.tsx index 5e4d822..60582e2 100644 --- a/app/src/components/Sidebar/History.tsx +++ b/app/src/components/Sidebar/History.tsx @@ -6,6 +6,7 @@ import { Theme, withStyles } from '@material-ui/core/styles' interface HistoryItem { title: JSX.Element | string value: string | any + selected?: boolean } interface Props { @@ -28,18 +29,18 @@ class MessageHistory extends React.Component { } public renderHistory() { - const style = { - backgroundColor: 'rgba(80, 80, 80, 0.6)', + const style = (element: HistoryItem) => ({ + backgroundColor: element.selected ? 'rgba(120, 120, 120, 0.6)' : 'rgba(80, 80, 80, 0.6)', margin: '8px', padding: '8px 8px 0 8px', cursor: this.props.onClick ? 'pointer' : 'inherit', - } + }) const messageStyle: React.CSSProperties = { textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden' } const elements = this.props.items.map((element, index) => (
this.props.onClick && this.props.onClick(index, event.target)} >
{element.title}
diff --git a/app/src/components/Sidebar/MessageHistory.tsx b/app/src/components/Sidebar/MessageHistory.tsx index 514c397..13bf378 100644 --- a/app/src/components/Sidebar/MessageHistory.tsx +++ b/app/src/components/Sidebar/MessageHistory.tsx @@ -11,6 +11,7 @@ const throttle = require('lodash.throttle') interface Props { node?: q.TreeNode + selected?: q.Message onSelect: (message: q.Message) => void } @@ -52,6 +53,7 @@ class MessageHistory extends React.Component { const historyElements = history.reverse().map(message => ({ title: , value: message.value, + selected: message === this.props.selected, })) const numericMessages = history.filter(message => !isNaN(parseFloat(message.value))) diff --git a/app/src/components/Sidebar/Sidebar.tsx b/app/src/components/Sidebar/Sidebar.tsx index c9ca855..00e164f 100644 --- a/app/src/components/Sidebar/Sidebar.tsx +++ b/app/src/components/Sidebar/Sidebar.tsx @@ -169,10 +169,7 @@ class Sidebar extends React.Component {
-
- - {this.showValueComparison} - +
@@ -195,18 +192,6 @@ class Sidebar extends React.Component { ) } - private valueRenderWidthChange = (width: number) => { - this.setState({ valueRenderWidth: width }) - } - - private showValueComparison = (a: any) => ( - - - - - - ) - private messageMetaInfo() { if (!this.props.node || !this.props.node.message || !this.props.node.mqttMessage) { return null