From 201fb5e2b6f340360fa4a81a83b1e315e687dd79 Mon Sep 17 00:00:00 2001
From: Stefanie Grewenig <sgreweni@thoughtworks.com>
Date: Sat, 12 Jan 2019 15:44:02 +0100
Subject: [PATCH] move hard coded headers and explainers from bleeding into
 cycle day i18n

- issue: 127
- by: sg
---
 components/cycle-day/symptoms/bleeding.js | 18 +++++++++---------
 i18n/en/cycle-day.js                      | 13 ++++++++++++-
 2 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/components/cycle-day/symptoms/bleeding.js b/components/cycle-day/symptoms/bleeding.js
index a17046bf..3f7df981 100644
--- a/components/cycle-day/symptoms/bleeding.js
+++ b/components/cycle-day/symptoms/bleeding.js
@@ -6,7 +6,7 @@ import {
 } from 'react-native'
 import styles from '../../../styles'
 import { saveSymptom } from '../../../db'
-import { bleeding as labels } from '../../../i18n/en/cycle-day'
+import { bleeding } from '../../../i18n/en/cycle-day'
 import ActionButtonFooter from './action-button-footer'
 import SelectTabGroup from '../select-tab-group'
 import SymptomSection from './symptom-section'
@@ -25,17 +25,17 @@ export default class Bleeding extends Component {
 
   render() {
     const bleedingRadioProps = [
-      { label: labels[0], value: 0 },
-      { label: labels[1], value: 1 },
-      { label: labels[2], value: 2 },
-      { label: labels[3], value: 3 },
+      { label: bleeding.labels[0], value: 0 },
+      { label: bleeding.labels[1], value: 1 },
+      { label: bleeding.labels[2], value: 2 },
+      { label: bleeding.labels[3], value: 3 },
     ]
     return (
       <View style={{ flex: 1 }}>
         <ScrollView style={styles.page}>
           <SymptomSection
-            header="Heaviness"
-            explainer="How heavy is the bleeding?"
+            header={bleeding.heaviness.header}
+            explainer={bleeding.heaviness.explainer}
           >
             <SelectTabGroup
               buttons={bleedingRadioProps}
@@ -44,8 +44,8 @@ export default class Bleeding extends Component {
             />
           </SymptomSection>
           <SymptomSection
-            header="Exclude"
-            explainer="You can exclude this value if it's not menstrual bleeding"
+            header={bleeding.exclude.header}
+            explainer={bleeding.exclude.explainer}
             inline={true}
           >
             <Switch
diff --git a/i18n/en/cycle-day.js b/i18n/en/cycle-day.js
index 78cd4e24..2ad53ab9 100644
--- a/i18n/en/cycle-day.js
+++ b/i18n/en/cycle-day.js
@@ -1,7 +1,18 @@
-export const bleeding = ['spotting', 'light', 'medium', 'heavy']
 export const mucusNFP = ['t', 'Ø', 'f', 'S', 'S+']
 export const intensity = ['low', 'medium', 'high']
 
+export const bleeding = {
+    labels: ['spotting', 'light', 'medium', 'heavy'],
+    heaviness: {
+        header: "Heaviness",
+        explainer: "How heavy is the bleeding?",
+    },
+    exclude: {
+        header: "Exclude",
+        explainer: "You can exclude this value if it's not menstrual bleeding"
+    }
+}
+
 export const cervix = {
   opening: {
     categories: ['closed', 'medium', 'open'],
-- 
GitLab