import React, { Component } from 'react' import { View, Button, Text, Picker, Switch } from 'react-native' import styles from './styles' import { saveBleeding } from './db' import { formatDateForViewHeader } from './format' import { bleeding as labels } from './labels' import getCycleDay from './get-cycle-day' export default class Bleeding extends Component { constructor(props) { super(props) const cycleDay = props.navigation.state.params.cycleDay this.state = { cycleDay, currentValue: Number((cycleDay.bleeding && cycleDay.bleeding.value) || 0).toString(), exclude: cycleDay.bleeding ? cycleDay.bleeding.exclude : false } } // TODO display cycle day render() { const navigate = this.props.navigation.navigate const day = this.state.cycleDay return ( {formatDateForViewHeader(day.date)} Cycle day {getCycleDay()} Bleeding { this.setState({ currentValue: itemValue }) }}> Exclude { this.setState({ exclude: val }) }} value={this.state.exclude} /> ) } }