import React, { Component } from 'react' import { View, Button, Text, Switch } from 'react-native' import RadioForm from 'react-native-simple-radio-button' import styles from '../styles/index' import { saveBleeding } from '../db' import { bleeding as labels } from '../labels/labels' export default class Bleeding extends Component { constructor(props) { super(props) this.cycleDay = props.cycleDay this.showView = props.showView let bleedingValue = this.cycleDay.bleeding && this.cycleDay.bleeding.value if (! (typeof bleedingValue === 'number') ){ bleedingValue = -1 } this.state = { currentValue: bleedingValue, exclude: this.cycleDay.bleeding ? this.cycleDay.bleeding.exclude : false } } render() { const bleedingRadioProps = [ {label: labels[0], value: 0 }, {label: labels[1], value: 1 }, {label: labels[2], value: 2 }, {label: labels[3], value: 3 }, ] return ( Bleeding { this.setState({currentValue: itemValue}) }} /> Exclude { this.setState({exclude: val}) }} value={this.state.exclude} /> ) } }