fix deprecation warnings

main
Joost Wooning 2022-02-14 14:26:36 +01:00
parent f35ded248e
commit 766168d571
21 changed files with 118 additions and 237 deletions

View File

@ -47,7 +47,6 @@
"raven-js": "^3.16.0", "raven-js": "^3.16.0",
"react": "~16.14", "react": "~16.14",
"react-dom": "~16.14", "react-dom": "~16.14",
"react-emotion": "^8.0.12",
"react-infinite": "^0.11.0", "react-infinite": "^0.11.0",
"react-list": "^0.8.6", "react-list": "^0.8.6",
"react-measure": "^2.0.2", "react-measure": "^2.0.2",

View File

@ -23,7 +23,6 @@ import SaveDbcModal from './components/SaveDbcModal';
import LoadDbcModal from './components/LoadDbcModal'; import LoadDbcModal from './components/LoadDbcModal';
import debounce from './utils/debounce'; import debounce from './utils/debounce';
import EditMessageModal from './components/EditMessageModal'; import EditMessageModal from './components/EditMessageModal';
import LoadingBar from './components/LoadingBar';
import { import {
persistDbc, persistDbc,
fetchPersistedDbc, fetchPersistedDbc,
@ -75,7 +74,6 @@ export default class CanExplorer extends Component {
seekTime: props.seekTime || 0, seekTime: props.seekTime || 0,
seekIndex: 0, seekIndex: 0,
maxByteStateChangeCount: 0, maxByteStateChangeCount: 0,
isLoading: true,
partsLoaded: 0, partsLoaded: 0,
spawnWorkerHash: null, spawnWorkerHash: null,
attemptingPandaConnection: false, attemptingPandaConnection: false,
@ -400,9 +398,6 @@ export default class CanExplorer extends Component {
spawnWorker(options) { spawnWorker(options) {
let { currentParts, currentWorkers, loadingParts } = this.state; let { currentParts, currentWorkers, loadingParts } = this.state;
console.log('Checking worker for', currentParts); console.log('Checking worker for', currentParts);
if (!this.state.isLoading) {
this.setState({ isLoading: true });
}
if (loadingParts.length > 1) { if (loadingParts.length > 1) {
// only 2 workers at a time pls // only 2 workers at a time pls
return; return;
@ -427,11 +422,6 @@ export default class CanExplorer extends Component {
break; break;
} }
} }
if (part === -1) {
console.log('Loading complete');
this.setState({ isLoading: false });
return;
}
console.log('Starting worker for part', part); console.log('Starting worker for part', part);
// options is object of {part, prevMsgEntries, spawnWorkerHash, prepend} // options is object of {part, prevMsgEntries, spawnWorkerHash, prepend}
options = options || {}; options = options || {};
@ -1294,9 +1284,6 @@ export default class CanExplorer extends Component {
id="cabana" id="cabana"
className={cx({ 'is-showing-modal': this.showingModal() })} className={cx({ 'is-showing-modal': this.showingModal() })}
> >
{this.state.isLoading ? (
<LoadingBar isLoading={this.state.isLoading} />
) : null}
<div className="cabana-header"> <div className="cabana-header">
<a className="cabana-header-logo" href="/"> <a className="cabana-header-logo" href="/">
Comma Cabana Comma Cabana

View File

@ -1,8 +0,0 @@
import React from 'react';
import { shallow, mount, render } from 'enzyme';
import LoadingBar from '../../components/LoadingBar';
test('LoadingBar successfully mounts with minimal default props', () => {
const component = shallow(<LoadingBar />);
expect(component.exists()).toBe(true);
});

View File

@ -131,15 +131,13 @@ export default class AddSignals extends Component {
return signalStyles; return signalStyles;
} }
componentWillReceiveProps(newProps) { componentDidUpdate(prevProps) {
if (newProps.message.address !== this.props.message.address if (prevProps.message.address !== this.props.message.address ||
|| newProps.selectedMessageKey !== this.props.selectedMessageKey) { prevProps.selectedMessageKey !== this.props.selectedMessageKey)
const signals = newProps.message.frame ? newProps.message.frame.signals : {}; {
const signals = this.props.message.frame ? this.props.message.frame.signals : {};
this.setState( this.setState({ signals: this.copySignals(signals) }, this.updateSignalStyles);
{ signals: this.copySignals(signals) },
this.updateSignalStyles
);
} }
} }

View File

@ -160,35 +160,31 @@ export default class CanGraph extends Component {
this.view.run(); this.view.run();
}, 250); }, 250);
componentWillReceiveProps(nextProps) { componentDidUpdate(prevProps) {
if ( if (this.props.dragPos && JSON.stringify(prevProps.dragPos) !== JSON.stringify(this.props.dragPos)) {
nextProps.dragPos this.updateStyleFromDragPos(this.props.dragPos);
&& JSON.stringify(nextProps.dragPos) !== JSON.stringify(this.props.dragPos) } else if (!this.props.dragPos && this.state.plotInnerStyle !== null) {
) {
this.updateStyleFromDragPos(nextProps.dragPos);
} else if (!nextProps.dragPos && this.state.plotInnerStyle !== null) {
this.setState({ plotInnerStyle: null }); this.setState({ plotInnerStyle: null });
} }
if (
this.props.messages !== nextProps.messages if (prevProps.messages !== this.props.messages || prevProps.plottedSignal !== this.props.plottedSignal) {
|| this.props.plottedSignal !== nextProps.plottedSignal const data = this.getGraphData(this.props);
) {
console.log('Calculating new data!');
const data = this.getGraphData(nextProps);
// if (
// data.series.length === this.state.data.series.length
// && data.firstRelTime === this.state.data.firstRelTime
// && data.lastRelTime === this.state.data.lastRelTime
// && JSON.stringify(nextProps.signalSpec) === JSON.stringify(this.props.signalSpec)
// ) {
// // do nothing, the data didn't *actually* change
// } else {
console.log('Inserting new data!');
this.setState({ data }); this.setState({ data });
// }
} }
if (this.segmentIsNew(nextProps.segment)) { if (this.segmentIsNew(this.props.segment)) {
this.setState({ spec: this.getGraphSpec(nextProps) }); this.setState({ spec: this.getGraphSpec(this.props) });
}
if (this.view) {
if (this.props.segment.length > 0) {
// Set segmented domain
this.view.signal('segment', this.props.segment);
} else {
// Reset segment to full domain
this.view.signal('segment', 0);
}
this.view.signal('videoTime', this.props.currentTime);
this.view.runAsync();
} }
} }
@ -218,20 +214,6 @@ export default class CanGraph extends Component {
return false; return false;
} }
componentDidUpdate(oldProps, oldState) {
if (this.view) {
if (this.props.segment.length > 0) {
// Set segmented domain
this.view.signal('segment', this.props.segment);
} else {
// Reset segment to full domain
this.view.signal('segment', 0);
}
this.view.signal('videoTime', this.props.currentTime);
this.view.runAsync();
}
}
updateStyleFromDragPos({ left, top }) { updateStyleFromDragPos({ left, top }) {
const plotInnerStyle = { ...this.state.plotInnerStyle }; const plotInnerStyle = { ...this.state.plotInnerStyle };
plotInnerStyle.left = left; plotInnerStyle.left = left;

View File

@ -116,14 +116,14 @@ export default class CanGraphList extends Component {
const { draggingSignal, graphToReceiveDrop } = this.state; const { draggingSignal, graphToReceiveDrop } = this.state;
const { messageId, signalUid } = plottedSignals[0]; const { messageId, signalUid } = plottedSignals[0];
const msg = this.props.messages[messageId]; const msg = this.props.messages[messageId];
if (!this.plotListRef || !msg) {
return [];
}
const signal = Object.values(msg.frame.signals).find( const signal = Object.values(msg.frame.signals).find(
(s) => s.uid === signalUid (s) => s.uid === signalUid
); );
if (!this.plotListRef) {
return [];
}
const isDragging = draggingSignal.signalUid === signalUid const isDragging = draggingSignal.signalUid === signalUid
&& draggingSignal.messageId === messageId; && draggingSignal.messageId === messageId;
const canReceiveGraphDrop = graphToReceiveDrop const canReceiveGraphDrop = graphToReceiveDrop

View File

@ -38,8 +38,8 @@ export default class CanLog extends Component {
this.toggleSignalPlot = this.toggleSignalPlot.bind(this); this.toggleSignalPlot = this.toggleSignalPlot.bind(this);
} }
componentWillReceiveProps(nextProps) { componentDidUpdate(prevProps) {
if (nextProps.message && !this.props.message) { if (!prevProps.message && this.props.message) {
this.addDisplayedMessages(); this.addDisplayedMessages();
} }
} }

View File

@ -118,73 +118,60 @@ export default class Explorer extends Component {
} }
} }
componentWillReceiveProps(nextProps) { componentDidUpdate(prevProps) {
const nextMessage = nextProps.messages[nextProps.selectedMessage]; const prevMessage = prevProps.messages[prevProps.selectedMessage];
const curMessage = this.props.messages[this.props.selectedMessage]; const curMessage = this.props.messages[this.props.selectedMessage];
let { plottedSignals } = this.state;
if (Object.keys(nextProps.messages).length === 0 && Object.keys(this.props.messages).length !== 0) { if (Object.keys(prevProps.messages).length === 0 && Object.keys(this.props.messages).length !== 0) {
this.resetSegment(); this.resetSegment();
} }
if (nextMessage && nextMessage.frame && nextMessage !== curMessage) {
const nextSignalNames = Object.keys(nextMessage.frame.signals);
if (nextSignalNames.length === 0) { if (curMessage && curMessage.frame && prevMessage !== curMessage) {
if (Object.keys(curMessage.frame.signals).length === 0) {
this.setState({ shouldShowAddSignal: true }); this.setState({ shouldShowAddSignal: true });
} }
} }
// remove plottedSignals that no longer exist // remove plottedSignals that no longer exist
plottedSignals = plottedSignals const newPlottedSignals = this.state.plottedSignals
.map((plot) => plot.filter(({ messageId, signalUid }, index) => { .map((plot) => plot.filter(({ messageId, signalUid }) => {
const messageExists = !!nextProps.messages[messageId]; const messageExists = Boolean(this.props.messages[messageId]);
let signalExists = true; let signalExists = true;
if (messageExists) { if (messageExists) {
signalExists = Object.values( signalExists = Object.values(this.props.messages[messageId].frame.signals)
nextProps.messages[messageId].frame.signals .some((signal) => signal.uid === signalUid);
).some((signal) => signal.uid === signalUid);
} }
return messageExists && signalExists; return messageExists && signalExists;
})) }))
.filter((plot) => plot.length > 0); .filter((plot) => plot.length > 0);
this.setState({ plottedSignals }); if (this.state.plottedSignals.length !== newPlottedSignals.length) {
this.setState({ plottedSignals: newPlottedSignals });
}
if ( if (this.props.selectedMessage && prevProps.selectedMessage !== this.props.selectedMessage) {
nextProps.selectedMessage // Update segment and seek state by finding a entry indices corresponding to old message segment/seek times.
&& nextProps.selectedMessage !== this.props.selectedMessage
) {
// Update segment and seek state
// by finding a entry indices
// corresponding to old message segment/seek times.
const { segment, segmentIndices } = clipSegment( const { segment, segmentIndices } = clipSegment(
this.state.segment, this.state.segment,
this.state.segmentIndices, this.state.segmentIndices,
nextMessage curMessage
); );
// console.log('componentWillReceiveProps', this.state.userSeekTime, '->', nextSeekTime);
this.setState({ this.setState({
segment, segment,
segmentIndices, segmentIndices,
userSeekIndex: nextProps.seekIndex, userSeekIndex: this.props.seekIndex,
// userSeekTime: nextSeekTime
}); });
} }
if ( if (prevMessage && curMessage && prevMessage.entries.length !== curMessage.entries.length) {
nextMessage
&& curMessage
&& nextMessage.entries.length !== curMessage.entries.length
) {
const { segment, segmentIndices } = clipSegment( const { segment, segmentIndices } = clipSegment(
this.state.segment, this.state.segment,
this.state.segmentIndices, this.state.segmentIndices,
nextMessage curMessage
); );
// console.log(this.state.segment, '->', segment, segmentIndices);
this.setState({ segment, segmentIndices }); this.setState({ segment, segmentIndices });
} }
} }

View File

@ -23,14 +23,6 @@ export default class GithubDbcList extends Component {
this.updatePathQuery = this.updatePathQuery.bind(this); this.updatePathQuery = this.updatePathQuery.bind(this);
} }
componentWillReceiveProps(nextProps) {
if (nextProps.repo !== this.props.repo) {
this.props.openDbcClient.list(nextProps.repo).then((paths) => {
this.setState({ paths, selectedPath: null });
});
}
}
componentDidMount() { componentDidMount() {
this.props.openDbcClient.list(this.props.repo).then((paths) => { this.props.openDbcClient.list(this.props.repo).then((paths) => {
paths = paths.filter((path) => path.indexOf('.dbc') !== -1); paths = paths.filter((path) => path.indexOf('.dbc') !== -1);
@ -38,6 +30,14 @@ export default class GithubDbcList extends Component {
}); });
} }
componentDidUpdate(prevProps) {
if (prevProps.repo !== this.props.repo) {
this.props.openDbcClient.list(this.props.repo).then((paths) => {
this.setState({ paths, selectedPath: null });
});
}
}
updatePathQuery(e) { updatePathQuery(e) {
this.setState({ this.setState({
pathQuery: e.target.value pathQuery: e.target.value

View File

@ -16,17 +16,14 @@ export default class HLS extends Component {
onRestart: PropTypes.func onRestart: PropTypes.func
}; };
componentWillReceiveProps(nextProps) { componentDidUpdate(prevProps) {
this.videoElement.playbackRate = nextProps.playbackSpeed; this.videoElement.playbackRate = this.props.playbackSpeed;
if (nextProps.source !== this.props.source) { if (prevProps.source !== this.props.source) {
this.loadSource(nextProps.source); this.loadSource(this.props.source);
} }
if (nextProps.playing) { if (this.props.playing) {
if ( if (this.videoElement && (this.videoElement.paused || this.videoElement.currentTime < 0.01)) {
this.videoElement
&& (this.videoElement.paused || this.videoElement.currentTime < 0.01)
) {
this.videoElement.play(); this.videoElement.play();
} }
} else { } else {

View File

@ -33,7 +33,7 @@ export default class LoadDbcModal extends Component {
this.renderActions = this.renderActions.bind(this); this.renderActions = this.renderActions.bind(this);
} }
componentWillMount() { componentDidMount() {
this.props.openDbcClient.getUserOpenDbcFork().then((userOpenDbcRepo) => { this.props.openDbcClient.getUserOpenDbcFork().then((userOpenDbcRepo) => {
this.setState({ userOpenDbcRepo }); this.setState({ userOpenDbcRepo });
}); });

View File

@ -1,35 +0,0 @@
import styled, { keyframes } from 'react-emotion';
const frames = keyframes`
0% {
transform: translateX(0)
}
to {
transform: translateX(-400px)
}
`;
const animationColor1 = 'rgba(74, 242, 161, 1.00)';
const animationColor2 = 'rgba(140, 169, 197, 1.00)';
export default styled('div')`
display: block;
animation-name: ${frames};
animation-duration: 2s;
animation-timing-function: linear;
animation-iteration-count: infinite;
background-color: ${animationColor1};
background-image: linear-gradient(
to right,
${animationColor2} 0,
${animationColor2} 50%,
${animationColor1} 50%,
${animationColor1} 100%
);
background-repeat: repeat-x;
background-size: 25pc 25pc;
width: 200%;
position: fixed;
top: 0;
left: 0;
height: 2;
`;

View File

@ -19,6 +19,7 @@ export default class MessageBytes extends Component {
this.onVisibilityChange = this.onVisibilityChange.bind(this); this.onVisibilityChange = this.onVisibilityChange.bind(this);
this.onCanvasRefAvailable = this.onCanvasRefAvailable.bind(this); this.onCanvasRefAvailable = this.onCanvasRefAvailable.bind(this);
this.updateCanvas = this.updateCanvas.bind(this);
} }
shouldComponentUpdate(nextProps, nextState) { shouldComponentUpdate(nextProps, nextState) {
@ -33,16 +34,11 @@ export default class MessageBytes extends Component {
return nextProps.seekTime !== this.props.seekTime; return nextProps.seekTime !== this.props.seekTime;
} }
componentWillReceiveProps(nextProps) { componentDidUpdate(prevProps) {
if ( if (prevProps.seekIndex !== this.props.seekIndex ||
this.props.seekIndex !== nextProps.seekIndex Math.floor(prevProps.seekTime * 60) !== Math.floor(this.props.seekTime * 60))
|| frameForTime(this.props.seekTime) !== frameForTime(nextProps.seekTime) {
) { this.updateCanvas();
this.updateCanvas(nextProps);
}
function frameForTime(t) {
return ~~(t * 60);
} }
} }
@ -77,8 +73,8 @@ export default class MessageBytes extends Component {
} }
} }
updateCanvas(props) { updateCanvas() {
const { message, live, seekTime } = props; const { message, live, seekTime } = this.props;
if (!this.canvas || message.entries.length === 0) return; if (!this.canvas || message.entries.length === 0) return;
let mostRecentMsg = message.entries[message.entries.length - 1]; let mostRecentMsg = message.entries[message.entries.length - 1];

View File

@ -66,32 +66,23 @@ export default class Meta extends Component {
window.clearInterval(this.lastSavedTimer); window.clearInterval(this.lastSavedTimer);
} }
componentWillReceiveProps(nextProps) { componentDidUpdate(prevProps) {
if ( if (prevProps.lastSaved !== this.props.lastSaved) {
nextProps.lastSaved !== this.props.lastSaved this.setState({ lastSaved: this.props.dbcLastSaved.fromNow() });
&& typeof nextProps === 'object'
) {
this.setState({ lastSaved: nextProps.dbcLastSaved.fromNow() });
} }
const nextMsgKeys = Object.keys(nextProps.messages); if (JSON.stringify(Object.keys(prevProps.messages)) !== JSON.stringify(Object.keys(this.props.messages))) {
if ( const orderedMessageKeys = this.sortMessages(this.props.messages);
JSON.stringify(nextMsgKeys)
!== JSON.stringify(Object.keys(this.props.messages))
) {
const orderedMessageKeys = this.sortMessages(nextProps.messages);
this.setState({ hoveredMessages: [], orderedMessageKeys }); this.setState({ hoveredMessages: [], orderedMessageKeys });
} else if ( } else if (this.state.orderedMessageKeys.length === 0 || (!this.props.live && prevProps.messages &&
this.state.orderedMessageKeys.length === 0 this.props.messages && this.byteCountsDidUpdate(prevProps.messages, this.props.messages)))
|| (!this.props.live {
&& this.props.messages const orderedMessageKeys = this.sortMessages(this.props.messages);
&& nextProps.messages if (orderedMessageKeys.length > 0) {
&& this.byteCountsDidUpdate(this.props.messages, nextProps.messages))
) {
const orderedMessageKeys = this.sortMessages(nextProps.messages);
this.setState({ orderedMessageKeys }); this.setState({ orderedMessageKeys });
} }
} }
}
byteCountsDidUpdate(prevMessages, nextMessages) { byteCountsDidUpdate(prevMessages, nextMessages) {
return Object.entries(nextMessages).some( return Object.entries(nextMessages).some(

View File

@ -51,36 +51,33 @@ export default class RouteSeeker extends Component {
this.executePlayTimer = this.executePlayTimer.bind(this); this.executePlayTimer = this.executePlayTimer.bind(this);
} }
componentWillReceiveProps(nextProps) { componentDidUpdate(prevProps) {
const { ratio } = this.state; if (JSON.stringify(prevProps.segmentIndices) !== JSON.stringify(this.props.segmentIndices)) {
if (
JSON.stringify(this.props.segmentIndices)
!== JSON.stringify(nextProps.segmentIndices)
) {
this.setState({ this.setState({
seekedBarStyle: RouteSeeker.zeroSeekedBarStyle, seekedBarStyle: RouteSeeker.zeroSeekedBarStyle,
markerStyle: RouteSeeker.hiddenMarkerStyle, markerStyle: RouteSeeker.hiddenMarkerStyle,
ratio: 0 ratio: 0
}); });
} else if (nextProps.videoLength !== this.props.videoLength) { } else if (this.props.videoLength && prevProps.videoLength !== this.props.videoLength) {
// adjust ratio in line with new videoLength // adjust ratio in line with new videoLength
const secondsSeeked = ratio * this.props.videoLength; const secondsSeeked = this.state.ratio * prevProps.videoLength;
const newRatio = secondsSeeked / nextProps.videoLength; const newRatio = secondsSeeked / this.props.videoLength;
this.updateSeekedBar(newRatio); this.updateSeekedBar(newRatio);
} }
if (this.props.nearestFrameTime !== nextProps.nearestFrameTime) { if (prevProps.nearestFrameTime !== this.props.nearestFrameTime) {
const newRatio = this.props.segmentProgress(nextProps.nearestFrameTime); const newRatio = this.props.segmentProgress(this.props.nearestFrameTime);
this.updateSeekedBar(newRatio); this.updateSeekedBar(newRatio);
} }
if (nextProps.playing && !this.state.isPlaying) { if (prevProps.playing !== this.props.isPlaying) {
if (this.props.playing && !this.state.isPlaying) {
this.onPlay(); this.onPlay();
} else if (!nextProps.playing && this.state.isPlaying) { } else if (!this.props.playing && this.state.isPlaying) {
this.onPause(); this.onPause();
} }
} }
}
componentWillUnmount() { componentWillUnmount() {
window.cancelAnimationFrame(this.playTimer); window.cancelAnimationFrame(this.playTimer);

View File

@ -62,7 +62,7 @@ export default class RouteVideoSync extends Component {
this.ratioTime = this.ratioTime.bind(this); this.ratioTime = this.ratioTime.bind(this);
} }
componentWillMount() { componentDidMount() {
let videoApi = VideoApi(this.props.url, process.env.REACT_APP_VIDEO_CDN); let videoApi = VideoApi(this.props.url, process.env.REACT_APP_VIDEO_CDN);
videoApi.getQcameraStreamIndex().then(() => { videoApi.getQcameraStreamIndex().then(() => {
this.setState({source: videoApi.getQcameraStreamIndexUrl()}); this.setState({source: videoApi.getQcameraStreamIndexUrl()});

View File

@ -37,7 +37,7 @@ export default class SaveDbcModal extends Component {
this.renderActions = this.renderActions.bind(this); this.renderActions = this.renderActions.bind(this);
} }
async componentWillMount() { async componentDidMount() {
const openDbcFork = await this.props.openDbcClient.getUserOpenDbcFork(); const openDbcFork = await this.props.openDbcClient.getUserOpenDbcFork();
this.setState({ openDbcFork }); this.setState({ openDbcFork });
} }

View File

@ -42,6 +42,13 @@
display: block; display: block;
} }
} }
&-colorbar {
display: block;
height: 100%;
left: 0;
position: absolute;
width: 1.5%;
}
&-header { &-header {
border-bottom: 1px solid transparent; border-bottom: 1px solid transparent;
cursor: pointer; cursor: pointer;

View File

@ -1,12 +0,0 @@
import styled from 'react-emotion';
// color bar on the left side of the signals legend
export default styled('div')`
display: block;
height: 100%;
left: 0;
position: absolute;
width: 1.5%;
opacity: ${({ isHighlighted }) => (isHighlighted ? 0.5 : 0.3)};
background-color: rgb(${({ rgb }) => rgb.join(',')});
`;

View File

@ -6,7 +6,6 @@ import cx from 'classnames';
import Signal from '../../models/can/signal'; import Signal from '../../models/can/signal';
import SignalForm from './SignalForm'; import SignalForm from './SignalForm';
import ColorBar from './ColorBar';
import FIELDS from './FIELDS'; import FIELDS from './FIELDS';
export default class SignalLegendEntry extends Component { export default class SignalLegendEntry extends Component {
@ -34,12 +33,12 @@ export default class SignalLegendEntry extends Component {
}; };
} }
componentWillReceiveProps(nextProps) { componentDidUpdate(prevProps) {
if (!nextProps.signal.equals(this.props.signal)) { if (!this.props.signal.equals(prevProps.signal)) {
this.setState({ this.setState({
signalEdited: Object.assign( signalEdited: Object.assign(
Object.create(nextProps.signal), Object.create(this.props.signal),
nextProps.signal this.props.signal
) )
}); });
} }
@ -115,13 +114,17 @@ export default class SignalLegendEntry extends Component {
} = this.props; } = this.props;
const expandedEntryClass = isExpanded ? 'is-expanded' : null; const expandedEntryClass = isExpanded ? 'is-expanded' : null;
const plottedButtonClass = isPlotted ? 'button' : 'button--alpha'; const plottedButtonClass = isPlotted ? 'button' : 'button--alpha';
const colorBarStyle = {
opacity: isHighlighted ? 0.5 : 0.3,
backgroundColor: `rgb(${color.join(',')})`,
};
return ( return (
<div <div
className={cx('signals-legend-entry', expandedEntryClass)} className={cx('signals-legend-entry', expandedEntryClass)}
onMouseEnter={() => this.props.onSignalHover(signal)} onMouseEnter={() => this.props.onSignalHover(signal)}
onMouseLeave={() => this.props.onSignalHoverEnd(signal)} onMouseLeave={() => this.props.onSignalHoverEnd(signal)}
> >
<ColorBar isHighlighted={isHighlighted} rgb={color} /> <div className="signals-legend-entry-colorbar" style={ colorBarStyle } />
<div className="signals-legend-entry-header"> <div className="signals-legend-entry-header">
<div <div
className="signals-legend-entry-header-name" className="signals-legend-entry-header-name"

View File

@ -11894,14 +11894,6 @@ react-dom@~16.14:
prop-types "^15.6.2" prop-types "^15.6.2"
scheduler "^0.19.1" scheduler "^0.19.1"
react-emotion@^8.0.12:
version "8.0.12"
resolved "https://registry.yarnpkg.com/react-emotion/-/react-emotion-8.0.12.tgz#3dd94c151197e2e3399e34e3e118df141b5ebb7b"
integrity sha512-shGa+uer+Ng1uRwqkdVIYW5zsxx4/kc5za8zRMhrTaGJCpU3uwQsdMpmX2kF4chJZvRsfxW+2cBue3EnJeX5zw==
dependencies:
babel-plugin-emotion "^8.0.12"
emotion-utils "^8.0.12"
react-error-overlay@^6.0.7: react-error-overlay@^6.0.7:
version "6.0.10" version "6.0.10"
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.10.tgz#0fe26db4fa85d9dbb8624729580e90e7159a59a6" resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.10.tgz#0fe26db4fa85d9dbb8624729580e90e7159a59a6"