Clean up markup

This commit is contained in:
Julia Friesel
2019-05-19 19:00:05 +02:00
parent 69d2517dd2
commit 472d793627
8 changed files with 99 additions and 129 deletions
+11 -16
View File
@@ -1,9 +1,7 @@
import React from 'react' import React from 'react'
import { import {
Switch, Switch,
ScrollView, ScrollView} from 'react-native'
View
} from 'react-native'
import { bleeding } from '../../../i18n/en/cycle-day' import { bleeding } from '../../../i18n/en/cycle-day'
import styles from '../../../styles' import styles from '../../../styles'
@@ -46,19 +44,16 @@ export default class Bleeding extends SymptomView {
] ]
return ( return (
<ScrollView style={styles.page}> <ScrollView style={styles.page}>
<View style={{ flexDirection: 'row' }}> <SymptomSection
<SymptomSection header={bleeding.heaviness.header}
header={bleeding.heaviness.header} explainer={bleeding.heaviness.explainer}
explainer={bleeding.heaviness.explainer} >
> <SelectTabGroup
<SelectTabGroup buttons={bleedingRadioProps}
buttons={bleedingRadioProps} active={this.state.currentValue}
active={this.state.currentValue} onSelect={val => this.setState({ currentValue: val })}
onSelect={val => this.setState({ currentValue: val })} />
/> </SymptomSection>
</SymptomSection>
<View style={{ flex: 1 }}></View>
</View>
<SymptomSection <SymptomSection
header={bleeding.exclude.header} header={bleeding.exclude.header}
explainer={bleeding.exclude.explainer} explainer={bleeding.exclude.explainer}
+11 -15
View File
@@ -1,8 +1,6 @@
import React from 'react' import React from 'react'
import { import {
ScrollView, ScrollView} from 'react-native'
View
} from 'react-native'
import { intensity, desire } from '../../../i18n/en/cycle-day' import { intensity, desire } from '../../../i18n/en/cycle-day'
import styles from '../../../styles' import styles from '../../../styles'
@@ -39,18 +37,16 @@ export default class Desire extends SymptomView {
] ]
return ( return (
<ScrollView style={styles.page}> <ScrollView style={styles.page}>
<View style={{ flexDirection: 'row' }}> <SymptomSection
<SymptomSection header={desire.header}
header={desire.header} explainer={desire.explainer}
explainer={desire.explainer} >
> <SelectTabGroup
<SelectTabGroup buttons={desireRadioProps}
buttons={desireRadioProps} active={this.state.currentValue}
active={this.state.currentValue} onSelect={val => this.setState({ currentValue: val })}
onSelect={val => this.setState({ currentValue: val })} />
/> </SymptomSection>
</SymptomSection>
</View>
</ScrollView> </ScrollView>
) )
} }
+12 -17
View File
@@ -1,15 +1,12 @@
import React from 'react' import React from 'react'
import { import {
ScrollView, ScrollView,
TextInput, TextInput} from 'react-native'
View
} from 'react-native'
import { mood as labels } from '../../../i18n/en/cycle-day' import { mood as labels } from '../../../i18n/en/cycle-day'
import styles from '../../../styles' import styles from '../../../styles'
import SelectBoxGroup from '../select-box-group' import SelectBoxGroup from '../select-box-group'
import SymptomSection from './symptom-section' import SymptomSection from './symptom-section'
import SymptomView from './symptom-view' import SymptomView from './symptom-view'
@@ -53,16 +50,15 @@ export default class Mood extends SymptomView {
renderContent() { renderContent() {
return ( return (
<ScrollView style={styles.page}> <ScrollView style={styles.page}>
<View style={{ flexDirection: 'row' }}> <SymptomSection
<SymptomSection explainer={labels.explainer}
explainer={labels.explainer} >
> <SelectBoxGroup
<SelectBoxGroup labels={labels.categories}
labels={labels.categories} onSelect={this.toggleState}
onSelect={this.toggleState} optionsState={this.state}
optionsState={this.state} />
/> { this.state.other &&
{ this.state.other &&
<TextInput <TextInput
autoFocus={this.state.focusTextArea} autoFocus={this.state.focusTextArea}
multiline={true} multiline={true}
@@ -72,9 +68,8 @@ export default class Mood extends SymptomView {
this.setState({note: val}) this.setState({note: val})
}} }}
/> />
} }
</SymptomSection> </SymptomSection>
</View>
</ScrollView> </ScrollView>
) )
} }
+11 -15
View File
@@ -1,9 +1,7 @@
import React from 'react' import React from 'react'
import { import {
Switch, Switch,
ScrollView, ScrollView} from 'react-native'
View
} from 'react-native'
import styles from '../../../styles' import styles from '../../../styles'
import { mucus as labels } from '../../../i18n/en/cycle-day' import { mucus as labels } from '../../../i18n/en/cycle-day'
@@ -57,18 +55,16 @@ export default class Mucus extends SymptomView {
// const mandatoryNotCompletedYet = typeof this.state.feeling != 'number' || typeof this.state.texture != 'number' // const mandatoryNotCompletedYet = typeof this.state.feeling != 'number' || typeof this.state.texture != 'number'
return ( return (
<ScrollView style={styles.page}> <ScrollView style={styles.page}>
<View style={{ flexDirection: 'row' }}> <SymptomSection
<SymptomSection header='Feeling'
header='Feeling' explainer={labels.feeling.explainer}
explainer={labels.feeling.explainer} >
> <SelectTabGroup
<SelectTabGroup buttons={mucusFeeling}
buttons={mucusFeeling} onSelect={val => this.setState({ feeling: val })}
onSelect={val => this.setState({ feeling: val })} active={this.state.feeling}
active={this.state.feeling} />
/> </SymptomSection>
</SymptomSection>
</View>
<SymptomSection <SymptomSection
header='Texture' header='Texture'
+14 -18
View File
@@ -1,9 +1,7 @@
import React from 'react' import React from 'react'
import { import {
ScrollView, ScrollView,
TextInput, TextInput} from 'react-native'
View
} from 'react-native'
import { noteExplainer } from '../../../i18n/en/cycle-day' import { noteExplainer } from '../../../i18n/en/cycle-day'
import { shared as sharedLabels } from '../../../i18n/en/labels' import { shared as sharedLabels } from '../../../i18n/en/labels'
@@ -38,21 +36,19 @@ export default class Note extends SymptomView {
renderContent() { renderContent() {
return ( return (
<ScrollView style={styles.page}> <ScrollView style={styles.page}>
<View style={{ flexDirection: 'row' }}> <SymptomSection
<SymptomSection explainer={noteExplainer}
explainer={noteExplainer} >
> <TextInput
<TextInput autoFocus={!this.state.currentValue}
autoFocus={!this.state.currentValue} multiline={true}
multiline={true} placeholder={sharedLabels.enter}
placeholder={sharedLabels.enter} onChangeText={(val) => {
onChangeText={(val) => { this.setState({ currentValue: val })
this.setState({ currentValue: val }) }}
}} value={this.state.currentValue}
value={this.state.currentValue} />
/> </SymptomSection>
</SymptomSection>
</View>
</ScrollView> </ScrollView>
) )
} }
+12 -16
View File
@@ -1,9 +1,7 @@
import React from 'react' import React from 'react'
import { import {
ScrollView, ScrollView,
TextInput, TextInput} from 'react-native'
View
} from 'react-native'
import { pain as labels } from '../../../i18n/en/cycle-day' import { pain as labels } from '../../../i18n/en/cycle-day'
import { shared as sharedLabels } from '../../../i18n/en/labels' import { shared as sharedLabels } from '../../../i18n/en/labels'
@@ -55,16 +53,15 @@ export default class Pain extends SymptomView {
renderContent() { renderContent() {
return ( return (
<ScrollView style={styles.page}> <ScrollView style={styles.page}>
<View style={{ flexDirection: 'row' }}> <SymptomSection
<SymptomSection explainer={labels.explainer}
explainer={labels.explainer} >
> <SelectBoxGroup
<SelectBoxGroup labels={labels.categories}
labels={labels.categories} onSelect={this.toggleState}
onSelect={this.toggleState} optionsState={this.state}
optionsState={this.state} />
/> { this.state.other &&
{ this.state.other &&
<TextInput <TextInput
autoFocus={this.state.focusTextArea} autoFocus={this.state.focusTextArea}
multiline={true} multiline={true}
@@ -74,9 +71,8 @@ export default class Pain extends SymptomView {
this.setState({note: val}) this.setState({note: val})
}} }}
/> />
} }
</SymptomSection> </SymptomSection>
</View>
</ScrollView>) </ScrollView>)
} }
} }
+11 -13
View File
@@ -55,19 +55,17 @@ export default class Sex extends SymptomView {
renderContent() { renderContent() {
return ( return (
<ScrollView style={styles.page}> <ScrollView style={styles.page}>
<View style={{ flexDirection: 'row' }}> <SymptomSection
<SymptomSection header={sexLabels.header}
header={sexLabels.header} explainer={sexLabels.explainer}
explainer={sexLabels.explainer} >
> <SelectBoxGroup
<SelectBoxGroup labels={sexLabels.categories}
labels={sexLabels.categories} onSelect={this.toggleState}
onSelect={this.toggleState} optionsState={this.state}
optionsState={this.state} />
/> </SymptomSection>
</SymptomSection> <View style={{ flex: 1 }}></View>
<View style={{ flex: 1 }}></View>
</View>
<SymptomSection <SymptomSection
header={contraceptivesLabels.header} header={contraceptivesLabels.header}
explainer={contraceptivesLabels.explainer} explainer={contraceptivesLabels.explainer}
+17 -19
View File
@@ -144,25 +144,23 @@ export default class Temp extends SymptomView {
} }
return ( return (
<ScrollView style={styles.page}> <ScrollView style={styles.page}>
<View style={{ flexDirection: 'row' }}> <SymptomSection
<SymptomSection header={labels.temperature.header}
header={labels.temperature.header} explainer={labels.temperature.explainer}
explainer={labels.temperature.explainer} >
> <View style={styles.framedSegmentInlineChildren}>
<View style={styles.framedSegmentInlineChildren}> <AppTextInput
<AppTextInput style={[inputStyle]}
style={[inputStyle]} autoFocus={true}
autoFocus={true} placeholder={this.state.temperature}
placeholder={this.state.temperature} value={this.state.temperature}
value={this.state.temperature} onChangeText={this.setTemperature}
onChangeText={this.setTemperature} keyboardType='numeric'
keyboardType='numeric' maxLength={5}
maxLength={5} />
/> <AppText style={{ marginLeft: 5 }}>°C</AppText>
<AppText style={{ marginLeft: 5 }}>°C</AppText> </View>
</View> </SymptomSection>
</SymptomSection>
</View>
<SymptomSection <SymptomSection
header={labels.time} header={labels.time}
> >