Changed svg nodes to use contrastMode state

This commit is contained in:
jpellizzari
2017-02-13 09:49:55 -08:00
parent 63dc4e1b3e
commit 4e4848f3c4
4 changed files with 31 additions and 16 deletions
+11 -3
View File
@@ -1,10 +1,10 @@
import React from 'react';
import { connect } from 'react-redux';
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;
function NodeShapeStack(props) {
const shift = props.contrastMode ? 0.15 : 0.1;
const highlightScale = [1, 1 + shift];
const dy = NODE_BASE_SIZE * shift;
@@ -26,3 +26,11 @@ export default function NodeShapeStack(props) {
</g>
);
}
function mapStateToProps(state) {
return {
contrastMode: state.get('contrastMode')
};
}
export default connect(mapStateToProps)(NodeShapeStack);