Simplify active state

This commit is contained in:
Julia Friesel
2018-09-26 14:51:10 +02:00
parent a95f9c05cc
commit e8c38efbc5
9 changed files with 20 additions and 18 deletions
+4 -2
View File
@@ -6,7 +6,7 @@ import {
Dimensions
} from 'react-native'
import { LocalDate } from 'js-joda'
import Svg from 'react-native-svg'
import Svg, { G } from 'react-native-svg'
import Header from '../header'
import { getOrCreateCycleDay } from '../../db'
import cycleModule from '../../lib/cycle'
@@ -260,7 +260,9 @@ class SymptomBox extends Component {
React.Children.map(this.props.children, child => {
return (
<Svg width={100} height={50} viewBox={child.props.viewBox}>
{React.cloneElement(child, { active: !!d })}
<G fill={d ? 'white' : 'black'}>
{child}
</G>
</Svg>
)
})