Pass active state to icon
This commit is contained in:
@@ -82,9 +82,7 @@ export default class CycleDayOverView extends Component {
|
|||||||
data={getLabel('mucus', cycleDay.mucus)}
|
data={getLabel('mucus', cycleDay.mucus)}
|
||||||
disabled={dateInFuture}
|
disabled={dateInFuture}
|
||||||
>
|
>
|
||||||
<Svg width={100} height={50} viewBox='0 0 450 450'>
|
<MucusIcon viewBox='0 0 450 450' />
|
||||||
<MucusIcon />
|
|
||||||
</Svg>
|
|
||||||
</SymptomBox>
|
</SymptomBox>
|
||||||
<SymptomBox
|
<SymptomBox
|
||||||
title='Cervix'
|
title='Cervix'
|
||||||
@@ -238,7 +236,13 @@ class SymptomBox extends Component {
|
|||||||
<View style={[styles.symptomBox, boxActive, disabledStyle]}>
|
<View style={[styles.symptomBox, boxActive, disabledStyle]}>
|
||||||
|
|
||||||
{this.props.children ?
|
{this.props.children ?
|
||||||
React.cloneElement(this.props.children, {active: true})
|
React.Children.map(this.props.children, child => {
|
||||||
|
return (
|
||||||
|
<Svg width={100} height={50} viewBox={child.props.viewBox}>
|
||||||
|
{React.cloneElement(child, { active: !!d })}
|
||||||
|
</Svg>
|
||||||
|
)
|
||||||
|
})
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user