diff --git a/components/bleeding.js b/components/bleeding.js
deleted file mode 100644
index 0472c3c..0000000
--- a/components/bleeding.js
+++ /dev/null
@@ -1,102 +0,0 @@
-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}
- />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )
- }
-}
\ No newline at end of file
diff --git a/components/cycle-day/action-buttons.js b/components/cycle-day/action-buttons.js
new file mode 100644
index 0000000..0008552
--- /dev/null
+++ b/components/cycle-day/action-buttons.js
@@ -0,0 +1,46 @@
+import React from 'react'
+import {
+ View,
+ Button,
+} from 'react-native'
+import { saveSymptom } from '../../db'
+
+export default function (showView) {
+ return function ({ symptom, cycleDay, saveAction, saveDisabled}) {
+ const buttons = [
+ {
+ title: 'Cancel',
+ action: () => showView('dayView')
+ },
+ {
+ title: 'Delete',
+ action: () => {
+ saveSymptom(symptom, cycleDay)
+ showView('dayView')
+ }
+ }, {
+ title: 'Save',
+ action: () => {
+ saveAction()
+ showView('dayView')
+ },
+ disabled: saveDisabled
+ }
+ ]
+
+ return buttons.map(({ title, action, disabledCondition }, i) => {
+ const style = { flex: 1, marginHorizontal: 10 }
+ if (i === 0) style.marginLeft = 0
+ if (i === buttons.length - 1) style.marginRight = 0
+ return (
+
+
+
+ )
+ })
+ }
+}
\ No newline at end of file
diff --git a/components/cycle-day-overview.js b/components/cycle-day/cycle-day-overview.js
similarity index 67%
rename from components/cycle-day-overview.js
rename to components/cycle-day/cycle-day-overview.js
index cc780da..6741598 100644
--- a/components/cycle-day-overview.js
+++ b/components/cycle-day/cycle-day-overview.js
@@ -4,10 +4,10 @@ import {
Button,
Text
} from 'react-native'
-import styles from '../styles/index'
-import { bleeding as labels} from '../labels/labels'
-import cycleDayModule from '../lib/get-cycle-day-number'
-import { bleedingDaysSortedByDate } from '../db'
+import styles from '../../styles'
+import { bleeding as labels} from './labels/labels'
+import cycleDayModule from '../../lib/get-cycle-day-number'
+import { bleedingDaysSortedByDate } from '../../db'
const getCycleDayNumber = cycleDayModule()
@@ -47,30 +47,28 @@ export default class DayView extends Component {
const temperatureValue = this.cycleDay.temperature && this.cycleDay.temperature.value
let temperatureLabel
if (typeof temperatureValue === 'number') {
- temperatureLabel = `${temperatureValue} °C`
- if (this.cycleDay.temperature.exclude) temperatureLabel = "( " + temperatureLabel + " )"
+ temperatureLabel = `${temperatureValue} °C - ${this.cycleDay.temperature.time}`
+ if (this.cycleDay.temperature.exclude) {
+ temperatureLabel = "( " + temperatureLabel + " )"
+ }
} else {
temperatureLabel = 'edit'
}
return (
-
-
-
- Bleeding
-
-
+
+
+ Bleeding
+
-
-
- Temperature
-
-
+
+ Temperature
+