Skip to content

Commit

Permalink
Show medical condition in toolbar
Browse files Browse the repository at this point in the history
Once a medical condition is selected in the first screen, show the
selected condition's name in subsequent screens
  • Loading branch information
vikynandha committed Feb 7, 2016
1 parent 3a314be commit 2f7be23
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/components/common/ToolBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class ToolBar extends Component {
render() {
return (
<ToolbarAndroid
title='Chiron'
title={this.props.title || 'Chiron'}
titleColor='rgba(255,255,255,0.87)'
style={style}
/>
Expand Down
5 changes: 4 additions & 1 deletion app/components/scheduleVisit.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@ export default class ScheduleVisit extends Component {
}

render() {
const conditionId = this.props.store.selected_condition;
const selectedCondition = this.props.store.conditions.entities[conditionId];

return (
<ScrollView>
<ToolBar />
<ToolBar title={selectedCondition.title} />
<AppBody>
<Heading1>
When is your next visit?
Expand Down
10 changes: 7 additions & 3 deletions app/components/scheduleVisitSuccess.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ export default class ScheduleVisitSuccess extends Component {
}

render() {
const headingStyle = {color: '#43A047', fontWeight: 'bold'};
const conditionId = this.props.store.selected_condition;
const selectedCondition = this.props.store.conditions.entities[conditionId];

const headingStyle = {color: '#43A047', fontWeight: 'bold'};
const nextVisit = this.props.store.nextVisit;
return (

return (
<ScrollView>
<ToolBar />
<ToolBar title={selectedCondition.title} />
<AppBody>
<Heading1 style={headingStyle}>
Success!
Expand Down
4 changes: 3 additions & 1 deletion app/components/setupCondition.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ export default class SetupCondition extends Component {
}

render() {
const conditionId = this.props.store.selected_condition;
const selectedCondition = this.props.store.conditions.entities[conditionId];
return (
<ScrollView>
<ToolBar />
<ToolBar title={selectedCondition.title} />
<AppBody>
<Heading1>
Your current reading & dosage
Expand Down
2 changes: 1 addition & 1 deletion app/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ActionTypes from '../actions/actionTypes';
const conditions = {
1: {
id: 1,
title: 'DVT (Deep Vein Thrombosis)'
title: 'Deep Vein Thrombosis'
},
2: {
id: 2,
Expand Down

0 comments on commit 2f7be23

Please sign in to comment.