Files
weave-scope/client/app/scripts/charts/node-shape-stack.js
jpellizzari c9048d8661 Revert "Merge pull request #2204 from weaveworks/contrast-as-component"
This reverts commit 68e8cbf4f6, reversing
changes made to 00408b84e8.

Reverts bug where contrast mode is showing by default
2017-02-14 10:59:34 -08:00

29 lines
820 B
JavaScript

import React from 'react';
import { NODE_BASE_SIZE } from '../constants/styles';
import { isContrastMode } from '../utils/contrast-utils';
export default function NodeShapeStack(props) {
const shift = isContrastMode() ? 0.15 : 0.1;
const highlightScale = [1, 1 + shift];
const dy = NODE_BASE_SIZE * shift;
const Shape = props.shape;
return (
<g transform={`translate(0, ${dy * -2.5})`} className="stack">
<g transform={`scale(${highlightScale}) translate(0, ${dy})`} className="highlight">
<Shape {...props} />
</g>
<g transform={`translate(0, ${dy * 2})`}>
<Shape {...props} />
</g>
<g transform={`translate(0, ${dy * 1})`}>
<Shape {...props} />
</g>
<g className="only-metrics">
<Shape {...props} />
</g>
</g>
);
}