Skip to content

Commit

Permalink
PR comment - Adjust export, relates to recompose
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffon committed Aug 21, 2017
1 parent 42736e0 commit d16097b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/components/TracePage/TraceTimelineViewer/SpanBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function toPercent(value) {
return `${value * 100}%`;
}

function SpanBarImpl(props) {
function SpanBar(props) {
const { viewEnd, viewStart, color, label, hintSide, onClick, onMouseOver, onMouseOut, rpc } = props;

return (
Expand All @@ -55,7 +55,7 @@ function SpanBarImpl(props) {
);
}

SpanBarImpl.propTypes = {
SpanBar.propTypes = {
rpc: PropTypes.shape({
viewStart: PropTypes.number,
viewEnd: PropTypes.number,
Expand All @@ -71,20 +71,18 @@ SpanBarImpl.propTypes = {
onMouseOut: PropTypes.func,
};

SpanBarImpl.defaultProps = {
SpanBar.defaultProps = {
rpc: null,
onClick: null,
onMouseOver: null,
onMouseOut: null,
};

const SpanBar = compose(
export default compose(
withState('label', 'setLabel', props => props.shortLabel),
withProps(({ setLabel, shortLabel, longLabel }) => ({
onMouseOver: () => setLabel(longLabel),
onMouseOut: () => setLabel(shortLabel),
})),
onlyUpdateForKeys(['viewStart', 'viewEnd', 'label', 'rpc'])
)(SpanBarImpl);

export default SpanBar;
)(SpanBar);

0 comments on commit d16097b

Please sign in to comment.