@hedia/recommendation-screen 1.1.2 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,12 +22,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.stylesModal = void 0;
25
26
  const macro_1 = require("@lingui/macro");
26
27
  const React = __importStar(require("react"));
27
28
  const react_native_1 = require("react-native");
28
29
  const react_native_modal_1 = __importDefault(require("react-native-modal"));
29
30
  const i18nUtils_1 = require("../locale/i18nUtils");
30
- class HediaRecommendationModal extends React.Component {
31
+ const Constants_1 = require("../utils/Constants");
32
+ class RecommendationModal extends React.Component {
31
33
  constructor(props) {
32
34
  super(props);
33
35
  this.onPressNextButton = () => {
@@ -36,67 +38,69 @@ class HediaRecommendationModal extends React.Component {
36
38
  return isPageVisible ? this.setState({ firstPageVisible: false }) : this.props.onClickOkButton();
37
39
  };
38
40
  this.recommendationButtons = () => {
39
- return (<react_native_1.View style={styles.recommendationButtonsContainer}>
40
- <react_native_1.TouchableOpacity accessibilityLabel="yesButtonModal" style={styles.affirmativeCarbsButton} onPress={this.props.onAcceptCarbohydrates}>
41
- <react_native_1.Text style={styles.affirmativeCarbsText}>{i18nUtils_1.i18n._(macro_1.t `OK`)}</react_native_1.Text>
41
+ return (<react_native_1.View style={exports.stylesModal.recommendationButtonsContainer}>
42
+ <react_native_1.TouchableOpacity accessibilityLabel="yesButtonModal" style={exports.stylesModal.affirmativeCarbsButton} onPress={this.props.onAcceptCarbohydrates}>
43
+ <react_native_1.Text style={exports.stylesModal.affirmativeCarbsText}>{i18nUtils_1.i18n._(macro_1.t `OK`)}</react_native_1.Text>
42
44
  </react_native_1.TouchableOpacity>
43
- <react_native_1.TouchableOpacity accessibilityLabel="noButtonModal" style={styles.negativeCarbsButton} onPress={this.props.onDeclineCarbohydrates}>
44
- <react_native_1.Text style={styles.negativeCarbsText}>{i18nUtils_1.i18n._(macro_1.t `NO`)}</react_native_1.Text>
45
+ <react_native_1.TouchableOpacity accessibilityLabel="noButtonModal" style={exports.stylesModal.negativeCarbsButton} onPress={this.props.onDeclineCarbohydrates}>
46
+ <react_native_1.Text style={exports.stylesModal.negativeCarbsText}>{i18nUtils_1.i18n._(macro_1.t `NO`)}</react_native_1.Text>
45
47
  </react_native_1.TouchableOpacity>
46
48
  </react_native_1.View>);
47
49
  };
48
50
  this.recommendCarbohydrates = () => {
49
51
  const { suggestedCarbohydrates } = this.props;
50
- return (<react_native_1.View style={styles.flex1}>
51
- <react_native_1.View style={styles.innerView}>
52
- <react_native_1.View style={styles.recommendationRow}>
53
- <react_native_1.Text style={styles.recommendEatingText}>{i18nUtils_1.i18n._(macro_1.t `We recommend eating an additional:`)}</react_native_1.Text>
52
+ return (<react_native_1.View style={exports.stylesModal.flex1}>
53
+ <react_native_1.View style={exports.stylesModal.innerView}>
54
+ <react_native_1.View style={exports.stylesModal.recommendationRow}>
55
+ <react_native_1.Text style={exports.stylesModal.recommendEatingText}>
56
+ {i18nUtils_1.i18n._(macro_1.t `We recommend eating an additional:`)}
57
+ </react_native_1.Text>
54
58
  </react_native_1.View>
55
- <react_native_1.View style={styles.center}>
56
- <react_native_1.View style={styles.suggestedView}>
57
- <react_native_1.Text style={styles.suggestedCarbs}>{`${Math.ceil(suggestedCarbohydrates)} `}</react_native_1.Text>
58
- <react_native_1.Text style={styles.carbohydrateText}>{i18nUtils_1.i18n._(macro_1.t `grams of carbohydrates`)}</react_native_1.Text>
59
+ <react_native_1.View style={exports.stylesModal.center}>
60
+ <react_native_1.View style={exports.stylesModal.suggestedView}>
61
+ <react_native_1.Text style={exports.stylesModal.suggestedCarbs}>{`${Math.round(suggestedCarbohydrates)} `}</react_native_1.Text>
62
+ <react_native_1.Text style={exports.stylesModal.carbohydrateText}>{i18nUtils_1.i18n._(macro_1.t `grams of carbohydrates`)}</react_native_1.Text>
59
63
  </react_native_1.View>
60
64
  </react_native_1.View>
61
- <react_native_1.View style={styles.recommendationRow}>
62
- <react_native_1.Text style={styles.recommendEatingText}>{i18nUtils_1.i18n._(macro_1.t `Instead of taking insulin`)}</react_native_1.Text>
65
+ <react_native_1.View style={exports.stylesModal.recommendationRow}>
66
+ <react_native_1.Text style={exports.stylesModal.recommendEatingText}>{i18nUtils_1.i18n._(macro_1.t `Instead of taking insulin`)}</react_native_1.Text>
63
67
  </react_native_1.View>
64
68
  </react_native_1.View>
65
- <react_native_1.View style={styles.addToCalculationContainer}>
66
- <react_native_1.View style={styles.center}>
67
- <react_native_1.Text style={styles.addToCalculation}>
69
+ <react_native_1.View style={exports.stylesModal.addToCalculationContainer}>
70
+ <react_native_1.View style={exports.stylesModal.center}>
71
+ <react_native_1.Text style={exports.stylesModal.addToCalculation}>
68
72
  {i18nUtils_1.i18n._(macro_1.t `Would you like to add this to your current calculation?`)}
69
73
  </react_native_1.Text>
70
74
  </react_native_1.View>
71
- <react_native_1.View style={{ ...styles.flexStart, flex: 2 }}>{this.recommendationButtons()}</react_native_1.View>
75
+ <react_native_1.View style={{ ...exports.stylesModal.flexStart, flex: 2 }}>{this.recommendationButtons()}</react_native_1.View>
72
76
  </react_native_1.View>
73
77
  </react_native_1.View>);
74
78
  };
75
79
  this.secondPage = () => {
76
80
  const { attentionMessage, suggestedCarbohydrates } = this.props;
77
81
  const areCarbs = suggestedCarbohydrates && suggestedCarbohydrates > 0;
78
- return (<react_native_1.View style={styles.container}>
79
- <react_native_1.View style={areCarbs ? styles.textContainerIfCarbs : styles.textContainer}>
80
- <react_native_1.View style={styles.marginVertical}>
81
- <react_native_1.Text style={styles.textTittleMessage}>{i18nUtils_1.i18n._(macro_1.t `Attention`)}</react_native_1.Text>
82
+ return (<react_native_1.View style={exports.stylesModal.container}>
83
+ <react_native_1.View style={areCarbs ? exports.stylesModal.textContainerIfCarbs : exports.stylesModal.textContainer}>
84
+ <react_native_1.View style={exports.stylesModal.marginVertical}>
85
+ <react_native_1.Text style={exports.stylesModal.textTittleMessage}>{i18nUtils_1.i18n._(macro_1.t `Attention`)}</react_native_1.Text>
82
86
  </react_native_1.View>
83
- <react_native_1.Text style={styles.textMessage}>{attentionMessage}</react_native_1.Text>
87
+ <react_native_1.Text style={exports.stylesModal.textMessage}>{attentionMessage}</react_native_1.Text>
84
88
  </react_native_1.View>
85
- <react_native_1.View style={areCarbs ? styles.recommendationContainer : styles.flexStart}>
89
+ <react_native_1.View style={areCarbs ? exports.stylesModal.recommendationContainer : exports.stylesModal.flexStart}>
86
90
  {areCarbs ? this.recommendCarbohydrates() : this.okayButton()}
87
91
  </react_native_1.View>
88
92
  </react_native_1.View>);
89
93
  };
90
94
  this.firstPage = () => {
91
95
  const { limitationMessage } = this.props;
92
- return (<react_native_1.View style={styles.container}>
93
- <react_native_1.View style={styles.textContainer}>
94
- <react_native_1.View style={styles.marginVertical}>
95
- <react_native_1.Text style={styles.textTittleMessage}>{i18nUtils_1.i18n._(macro_1.t `Attention`)}</react_native_1.Text>
96
+ return (<react_native_1.View style={exports.stylesModal.container}>
97
+ <react_native_1.View style={exports.stylesModal.textContainer}>
98
+ <react_native_1.View style={exports.stylesModal.marginVertical}>
99
+ <react_native_1.Text style={exports.stylesModal.textTittleMessage}>{i18nUtils_1.i18n._(macro_1.t `Attention`)}</react_native_1.Text>
96
100
  </react_native_1.View>
97
- <react_native_1.Text style={styles.textMessage}>{limitationMessage}</react_native_1.Text>
101
+ <react_native_1.Text style={exports.stylesModal.textMessage}>{limitationMessage}</react_native_1.Text>
98
102
  </react_native_1.View>
99
- <react_native_1.View style={styles.flexStart}>{this.nextButton()}</react_native_1.View>
103
+ <react_native_1.View style={exports.stylesModal.flexStart}>{this.nextButton()}</react_native_1.View>
100
104
  </react_native_1.View>);
101
105
  };
102
106
  this.state = {
@@ -104,40 +108,39 @@ class HediaRecommendationModal extends React.Component {
104
108
  };
105
109
  }
106
110
  okayButton() {
107
- return (<react_native_1.View style={styles.okayButtonContainer}>
108
- <react_native_1.TouchableOpacity accessibilityLabel="okayButtonModal" style={styles.okButton} onPress={this.props.onClickOkButton}>
109
- <react_native_1.Text style={styles.buttonText}>{i18nUtils_1.i18n._(macro_1.t `OK`)}</react_native_1.Text>
111
+ return (<react_native_1.View style={exports.stylesModal.okayButtonContainer}>
112
+ <react_native_1.TouchableOpacity accessibilityLabel="okayButtonModal" style={exports.stylesModal.okButton} onPress={this.props.onClickOkButton}>
113
+ <react_native_1.Text style={exports.stylesModal.buttonText}>{i18nUtils_1.i18n._(macro_1.t `OK`)}</react_native_1.Text>
110
114
  </react_native_1.TouchableOpacity>
111
115
  </react_native_1.View>);
112
116
  }
113
117
  nextButton() {
114
- return (<react_native_1.View style={styles.okayButtonContainer}>
115
- <react_native_1.TouchableOpacity accessibilityLabel="nextButtonModal" style={styles.okButton} onPress={this.onPressNextButton}>
116
- <react_native_1.Text style={styles.buttonText}>{i18nUtils_1.i18n._(macro_1.t `OK`)}</react_native_1.Text>
118
+ return (<react_native_1.View style={exports.stylesModal.okayButtonContainer}>
119
+ <react_native_1.TouchableOpacity accessibilityLabel="nextButtonModal" style={exports.stylesModal.okButton} onPress={this.onPressNextButton}>
120
+ <react_native_1.Text style={exports.stylesModal.buttonText}>{i18nUtils_1.i18n._(macro_1.t `OK`)}</react_native_1.Text>
117
121
  </react_native_1.TouchableOpacity>
118
122
  </react_native_1.View>);
119
123
  }
120
124
  render() {
121
125
  const { isVisible } = this.props;
122
126
  const { firstPageVisible } = this.state;
123
- return (<react_native_modal_1.default isVisible={isVisible} style={styles.modalStyle}>
127
+ return (<react_native_modal_1.default isVisible={isVisible} style={exports.stylesModal.modalStyle}>
124
128
  {firstPageVisible ? this.firstPage() : this.secondPage()}
125
129
  </react_native_modal_1.default>);
126
130
  }
127
131
  }
128
- exports.default = HediaRecommendationModal;
132
+ exports.default = RecommendationModal;
129
133
  const { height, width } = react_native_1.Dimensions.get(`screen`);
130
134
  const buttonHeight = height / 20;
131
135
  const buttonWidth = width / 2.5;
132
136
  const buttonFontSize = height / 45;
133
137
  const buttonBorderRadius = height / 30;
134
138
  const buttonBorderWidth = height / 500;
135
- const tealColor = `rgba(73, 255, 252, 1)`;
136
139
  const sugestionFontSize = height / 35;
137
140
  const recommendEatingFontSize = height / 45;
138
141
  const textFontSize = height / 42;
139
142
  const titleFontSize = height / 30;
140
- const styles = react_native_1.StyleSheet.create({
143
+ exports.stylesModal = react_native_1.StyleSheet.create({
141
144
  modalStyle: { margin: 0 },
142
145
  flex1: { flex: 1 },
143
146
  container: { flex: 1, backgroundColor: `rgba(30, 35, 87, 0.9)` },
@@ -150,7 +153,7 @@ const styles = react_native_1.StyleSheet.create({
150
153
  textContainerIfCarbs: { flex: 3, justifyContent: `flex-end`, marginHorizontal: `6%` },
151
154
  textTittleMessage: { color: `white`, fontSize: titleFontSize, textAlign: `center` },
152
155
  textMessage: { color: `white`, fontSize: textFontSize, textAlign: `center` },
153
- buttonText: { color: tealColor, fontSize: buttonFontSize, textAlign: `center` },
156
+ buttonText: { color: Constants_1.BORDER_COLOUR_TEAL, fontSize: buttonFontSize, textAlign: `center` },
154
157
  okayButtonContainer: { justifyContent: `center`, alignSelf: `center`, flexDirection: `row`, marginTop: `2%` },
155
158
  recommendationContainer: { flex: 6, justifyContent: `flex-start`, marginHorizontal: `5%` },
156
159
  addToCalculationContainer: { flex: 2, justifyContent: `flex-start`, marginVertical: `10%` },
@@ -162,7 +165,7 @@ const styles = react_native_1.StyleSheet.create({
162
165
  marginVertical: `8%`,
163
166
  borderRadius: height / 80,
164
167
  borderWidth: height / 300,
165
- borderColor: tealColor,
168
+ borderColor: Constants_1.BORDER_COLOUR_TEAL,
166
169
  },
167
170
  suggestedView: { flexDirection: `row`, justifyContent: `center` },
168
171
  suggestedCarbs: { color: `white`, fontSize: sugestionFontSize, fontWeight: `bold`, textAlign: `center` },
@@ -170,13 +173,13 @@ const styles = react_native_1.StyleSheet.create({
170
173
  carbohydrateText: { color: `white`, fontSize: sugestionFontSize, textAlign: `center` },
171
174
  addToCalculation: { color: `white`, fontSize: textFontSize, textAlign: `center` },
172
175
  recommendationButtonsContainer: { justifyContent: `center`, flexDirection: `row`, marginTop: `3%` },
173
- affirmativeCarbsText: { color: tealColor, fontSize: buttonFontSize, textAlign: `center` },
176
+ affirmativeCarbsText: { color: Constants_1.BORDER_COLOUR_TEAL, fontSize: buttonFontSize, textAlign: `center` },
174
177
  negativeCarbsText: { color: `white`, fontSize: buttonFontSize, textAlign: `center` },
175
178
  affirmativeCarbsButton: {
176
179
  marginTop: `2%`,
177
180
  borderRadius: buttonBorderRadius,
178
181
  borderWidth: buttonBorderWidth,
179
- borderColor: tealColor,
182
+ borderColor: Constants_1.BORDER_COLOUR_TEAL,
180
183
  width: buttonWidth,
181
184
  height: buttonHeight,
182
185
  alignSelf: `center`,
@@ -198,7 +201,7 @@ const styles = react_native_1.StyleSheet.create({
198
201
  marginTop: `6%`,
199
202
  borderRadius: buttonBorderRadius,
200
203
  borderWidth: buttonBorderWidth,
201
- borderColor: tealColor,
204
+ borderColor: Constants_1.BORDER_COLOUR_TEAL,
202
205
  width: buttonWidth,
203
206
  height: buttonHeight,
204
207
  alignSelf: `center`,
@@ -4,6 +4,7 @@ import { Dimensions, StyleSheet, Text, TouchableOpacity, View } from "react-nati
4
4
  import ReactNativeModal from "react-native-modal";
5
5
  import { i18n } from "../locale/i18nUtils";
6
6
  import { AttentionMessage } from "../utils/AttentionMessages";
7
+ import { BORDER_COLOUR_TEAL } from "../utils/Constants";
7
8
 
8
9
  interface IModalProps {
9
10
  isVisible: boolean;
@@ -17,7 +18,7 @@ interface IModalProps {
17
18
  interface IModalState {
18
19
  firstPageVisible: boolean;
19
20
  }
20
- export default class HediaRecommendationModal extends React.Component<IModalProps, IModalState> {
21
+ export default class RecommendationModal extends React.Component<IModalProps, IModalState> {
21
22
  constructor(props: IModalProps) {
22
23
  super(props);
23
24
  this.state = {
@@ -26,26 +27,26 @@ export default class HediaRecommendationModal extends React.Component<IModalProp
26
27
  }
27
28
  public okayButton(): JSX.Element {
28
29
  return (
29
- <View style={styles.okayButtonContainer}>
30
+ <View style={stylesModal.okayButtonContainer}>
30
31
  <TouchableOpacity
31
32
  accessibilityLabel="okayButtonModal"
32
- style={styles.okButton}
33
+ style={stylesModal.okButton}
33
34
  onPress={this.props.onClickOkButton}
34
35
  >
35
- <Text style={styles.buttonText}>{i18n._(t`OK`)}</Text>
36
+ <Text style={stylesModal.buttonText}>{i18n._(t`OK`)}</Text>
36
37
  </TouchableOpacity>
37
38
  </View>
38
39
  );
39
40
  }
40
41
  public nextButton(): JSX.Element {
41
42
  return (
42
- <View style={styles.okayButtonContainer}>
43
+ <View style={stylesModal.okayButtonContainer}>
43
44
  <TouchableOpacity
44
45
  accessibilityLabel="nextButtonModal"
45
- style={styles.okButton}
46
+ style={stylesModal.okButton}
46
47
  onPress={this.onPressNextButton}
47
48
  >
48
- <Text style={styles.buttonText}>{i18n._(t`OK`)}</Text>
49
+ <Text style={stylesModal.buttonText}>{i18n._(t`OK`)}</Text>
49
50
  </TouchableOpacity>
50
51
  </View>
51
52
  );
@@ -57,20 +58,20 @@ export default class HediaRecommendationModal extends React.Component<IModalProp
57
58
  };
58
59
  public recommendationButtons = (): JSX.Element => {
59
60
  return (
60
- <View style={styles.recommendationButtonsContainer}>
61
+ <View style={stylesModal.recommendationButtonsContainer}>
61
62
  <TouchableOpacity
62
63
  accessibilityLabel="yesButtonModal"
63
- style={styles.affirmativeCarbsButton}
64
+ style={stylesModal.affirmativeCarbsButton}
64
65
  onPress={this.props.onAcceptCarbohydrates}
65
66
  >
66
- <Text style={styles.affirmativeCarbsText}>{i18n._(t`OK`)}</Text>
67
+ <Text style={stylesModal.affirmativeCarbsText}>{i18n._(t`OK`)}</Text>
67
68
  </TouchableOpacity>
68
69
  <TouchableOpacity
69
70
  accessibilityLabel="noButtonModal"
70
- style={styles.negativeCarbsButton}
71
+ style={stylesModal.negativeCarbsButton}
71
72
  onPress={this.props.onDeclineCarbohydrates}
72
73
  >
73
- <Text style={styles.negativeCarbsText}>{i18n._(t`NO`)}</Text>
74
+ <Text style={stylesModal.negativeCarbsText}>{i18n._(t`NO`)}</Text>
74
75
  </TouchableOpacity>
75
76
  </View>
76
77
  );
@@ -79,28 +80,30 @@ export default class HediaRecommendationModal extends React.Component<IModalProp
79
80
  public recommendCarbohydrates = (): JSX.Element => {
80
81
  const { suggestedCarbohydrates } = this.props;
81
82
  return (
82
- <View style={styles.flex1}>
83
- <View style={styles.innerView}>
84
- <View style={styles.recommendationRow}>
85
- <Text style={styles.recommendEatingText}>{i18n._(t`We recommend eating an additional:`)}</Text>
83
+ <View style={stylesModal.flex1}>
84
+ <View style={stylesModal.innerView}>
85
+ <View style={stylesModal.recommendationRow}>
86
+ <Text style={stylesModal.recommendEatingText}>
87
+ {i18n._(t`We recommend eating an additional:`)}
88
+ </Text>
86
89
  </View>
87
- <View style={styles.center}>
88
- <View style={styles.suggestedView}>
89
- <Text style={styles.suggestedCarbs}>{`${Math.ceil(suggestedCarbohydrates)} `}</Text>
90
- <Text style={styles.carbohydrateText}>{i18n._(t`grams of carbohydrates`)}</Text>
90
+ <View style={stylesModal.center}>
91
+ <View style={stylesModal.suggestedView}>
92
+ <Text style={stylesModal.suggestedCarbs}>{`${Math.round(suggestedCarbohydrates)} `}</Text>
93
+ <Text style={stylesModal.carbohydrateText}>{i18n._(t`grams of carbohydrates`)}</Text>
91
94
  </View>
92
95
  </View>
93
- <View style={styles.recommendationRow}>
94
- <Text style={styles.recommendEatingText}>{i18n._(t`Instead of taking insulin`)}</Text>
96
+ <View style={stylesModal.recommendationRow}>
97
+ <Text style={stylesModal.recommendEatingText}>{i18n._(t`Instead of taking insulin`)}</Text>
95
98
  </View>
96
99
  </View>
97
- <View style={styles.addToCalculationContainer}>
98
- <View style={styles.center}>
99
- <Text style={styles.addToCalculation}>
100
+ <View style={stylesModal.addToCalculationContainer}>
101
+ <View style={stylesModal.center}>
102
+ <Text style={stylesModal.addToCalculation}>
100
103
  {i18n._(t`Would you like to add this to your current calculation?`)}
101
104
  </Text>
102
105
  </View>
103
- <View style={{ ...styles.flexStart, flex: 2 }}>{this.recommendationButtons()}</View>
106
+ <View style={{ ...stylesModal.flexStart, flex: 2 }}>{this.recommendationButtons()}</View>
104
107
  </View>
105
108
  </View>
106
109
  );
@@ -110,14 +113,14 @@ export default class HediaRecommendationModal extends React.Component<IModalProp
110
113
  const { attentionMessage, suggestedCarbohydrates } = this.props;
111
114
  const areCarbs = suggestedCarbohydrates && suggestedCarbohydrates > 0;
112
115
  return (
113
- <View style={styles.container}>
114
- <View style={areCarbs ? styles.textContainerIfCarbs : styles.textContainer}>
115
- <View style={styles.marginVertical}>
116
- <Text style={styles.textTittleMessage}>{i18n._(t`Attention`)}</Text>
116
+ <View style={stylesModal.container}>
117
+ <View style={areCarbs ? stylesModal.textContainerIfCarbs : stylesModal.textContainer}>
118
+ <View style={stylesModal.marginVertical}>
119
+ <Text style={stylesModal.textTittleMessage}>{i18n._(t`Attention`)}</Text>
117
120
  </View>
118
- <Text style={styles.textMessage}>{attentionMessage}</Text>
121
+ <Text style={stylesModal.textMessage}>{attentionMessage}</Text>
119
122
  </View>
120
- <View style={areCarbs ? styles.recommendationContainer : styles.flexStart}>
123
+ <View style={areCarbs ? stylesModal.recommendationContainer : stylesModal.flexStart}>
121
124
  {areCarbs ? this.recommendCarbohydrates() : this.okayButton()}
122
125
  </View>
123
126
  </View>
@@ -126,14 +129,14 @@ export default class HediaRecommendationModal extends React.Component<IModalProp
126
129
  public firstPage = (): JSX.Element => {
127
130
  const { limitationMessage } = this.props;
128
131
  return (
129
- <View style={styles.container}>
130
- <View style={styles.textContainer}>
131
- <View style={styles.marginVertical}>
132
- <Text style={styles.textTittleMessage}>{i18n._(t`Attention`)}</Text>
132
+ <View style={stylesModal.container}>
133
+ <View style={stylesModal.textContainer}>
134
+ <View style={stylesModal.marginVertical}>
135
+ <Text style={stylesModal.textTittleMessage}>{i18n._(t`Attention`)}</Text>
133
136
  </View>
134
- <Text style={styles.textMessage}>{limitationMessage}</Text>
137
+ <Text style={stylesModal.textMessage}>{limitationMessage}</Text>
135
138
  </View>
136
- <View style={styles.flexStart}>{this.nextButton()}</View>
139
+ <View style={stylesModal.flexStart}>{this.nextButton()}</View>
137
140
  </View>
138
141
  );
139
142
  };
@@ -142,7 +145,7 @@ export default class HediaRecommendationModal extends React.Component<IModalProp
142
145
  const { isVisible } = this.props;
143
146
  const { firstPageVisible } = this.state;
144
147
  return (
145
- <ReactNativeModal isVisible={isVisible} style={styles.modalStyle}>
148
+ <ReactNativeModal isVisible={isVisible} style={stylesModal.modalStyle}>
146
149
  {firstPageVisible ? this.firstPage() : this.secondPage()}
147
150
  </ReactNativeModal>
148
151
  );
@@ -155,13 +158,12 @@ const buttonWidth = width / 2.5;
155
158
  const buttonFontSize = height / 45;
156
159
  const buttonBorderRadius = height / 30;
157
160
  const buttonBorderWidth = height / 500;
158
- const tealColor = `rgba(73, 255, 252, 1)`;
159
161
  const sugestionFontSize = height / 35;
160
162
  const recommendEatingFontSize = height / 45;
161
163
  const textFontSize = height / 42;
162
164
  const titleFontSize = height / 30;
163
165
 
164
- const styles = StyleSheet.create({
166
+ export const stylesModal = StyleSheet.create({
165
167
  modalStyle: { margin: 0 },
166
168
  flex1: { flex: 1 },
167
169
  container: { flex: 1, backgroundColor: `rgba(30, 35, 87, 0.9)` },
@@ -174,7 +176,7 @@ const styles = StyleSheet.create({
174
176
  textContainerIfCarbs: { flex: 3, justifyContent: `flex-end`, marginHorizontal: `6%` },
175
177
  textTittleMessage: { color: `white`, fontSize: titleFontSize, textAlign: `center` },
176
178
  textMessage: { color: `white`, fontSize: textFontSize, textAlign: `center` },
177
- buttonText: { color: tealColor, fontSize: buttonFontSize, textAlign: `center` },
179
+ buttonText: { color: BORDER_COLOUR_TEAL, fontSize: buttonFontSize, textAlign: `center` },
178
180
  okayButtonContainer: { justifyContent: `center`, alignSelf: `center`, flexDirection: `row`, marginTop: `2%` },
179
181
  recommendationContainer: { flex: 6, justifyContent: `flex-start`, marginHorizontal: `5%` },
180
182
  addToCalculationContainer: { flex: 2, justifyContent: `flex-start`, marginVertical: `10%` },
@@ -186,7 +188,7 @@ const styles = StyleSheet.create({
186
188
  marginVertical: `8%`,
187
189
  borderRadius: height / 80,
188
190
  borderWidth: height / 300,
189
- borderColor: tealColor,
191
+ borderColor: BORDER_COLOUR_TEAL,
190
192
  },
191
193
  suggestedView: { flexDirection: `row`, justifyContent: `center` },
192
194
  suggestedCarbs: { color: `white`, fontSize: sugestionFontSize, fontWeight: `bold`, textAlign: `center` },
@@ -194,13 +196,13 @@ const styles = StyleSheet.create({
194
196
  carbohydrateText: { color: `white`, fontSize: sugestionFontSize, textAlign: `center` },
195
197
  addToCalculation: { color: `white`, fontSize: textFontSize, textAlign: `center` },
196
198
  recommendationButtonsContainer: { justifyContent: `center`, flexDirection: `row`, marginTop: `3%` },
197
- affirmativeCarbsText: { color: tealColor, fontSize: buttonFontSize, textAlign: `center` },
199
+ affirmativeCarbsText: { color: BORDER_COLOUR_TEAL, fontSize: buttonFontSize, textAlign: `center` },
198
200
  negativeCarbsText: { color: `white`, fontSize: buttonFontSize, textAlign: `center` },
199
201
  affirmativeCarbsButton: {
200
202
  marginTop: `2%`,
201
203
  borderRadius: buttonBorderRadius,
202
204
  borderWidth: buttonBorderWidth,
203
- borderColor: tealColor,
205
+ borderColor: BORDER_COLOUR_TEAL,
204
206
  width: buttonWidth,
205
207
  height: buttonHeight,
206
208
  alignSelf: `center`,
@@ -222,7 +224,7 @@ const styles = StyleSheet.create({
222
224
  marginTop: `6%`,
223
225
  borderRadius: buttonBorderRadius,
224
226
  borderWidth: buttonBorderWidth,
225
- borderColor: tealColor,
227
+ borderColor: BORDER_COLOUR_TEAL,
226
228
  width: buttonWidth,
227
229
  height: buttonHeight,
228
230
  alignSelf: `center`,
@@ -1 +1 @@
1
- /* eslint-disable */module.exports={languageData:{"plurals":function(n,ord){var s=String(n).split("."),i=s[0],t0=Number(s[0])==n;if(ord)return"other";return n==1||!t0&&(i==0||i==1)?"one":"other"}},messages:{"Active Insulin":"Aktiv Insulin","Activity":"Aktivitet","Additional":"Supplerende","Based on the selected activity your insulin recommendation is reduced by:":"Baseret p\xE5 din valgte aktivitet er din insulin anbefaling reduceret med:","Blood Glucose Level":"Blodsukkerniveau","Entered":"Indtastet","Error. Hedia Calculator does not support an insulin dosis greater that 50 units":"Error. Hedia Calculator does not support an insulin dosis greater that 50 units","Error. Hedia Calculator does not support insulin recommendations with boluses older than 4 hours":"Error. Hedia Calculator does not support insulin recommendations with boluses older than 4 hours","Error. Hedia Calculator does not support your activity intensity value":"Error. Hedia Calculator does not support your activity intensity value","Error. Hedia Calculator does not support your current blood glucose level.":"Error. Hedia Calculator does not support your current blood glucose level.","Error. Hedia Calculator does not support your current blood glucose unit.":"Error. Hedia Calculator does not support your current blood glucose unit.","Error. Hedia Calculator does not support your current language.":"Error. Hedia Calculator does not support your current language.","Error. Hedia Calculator does not support your injection method.":"Error. Hedia Calculator does not support your injection method.","Error. Hedia Calculator only supports activities with a duration of maximum 60 minutes.":"Error. Hedia Calculator only supports activities with a duration of maximum 60 minutes.","Error. Please verify that your activity settings are set up correctly.":"Error. Please verify that your activity settings are set up correctly.","Error. Please verify that your activity target blood glucose value is correct.":"Error. Please verify that your activity target blood glucose value is correct.","Error. Please verify that your insulin sensitivity value is correct.":"Error. Please verify that your insulin sensitivity value is correct.","Error. Please verify that your insulin to carb ratio value is correct.":"Error. Please verify that your insulin to carb ratio value is correct.","Error. Please verify that your target blood glucose value is correct.":"Error. Please verify that your target blood glucose value is correct.","Error. Please verify your notifications settings.":"Error. Please verify your notifications settings.","Food":"Mad","Hard":"H\xE5rd","Have you taken insulin within the last 4 hours?":"Har du taget insulin inden for de sidste 4 timer?","Hedia Calculator does not support activities that finished more than 4 hours ago.":"Hedia Calculator does not support activities that finished more than 4 hours ago.","Hedia Calculator does not support insulin recommendations with more than 300 grams of carbohydrates present.":"Hedia Calculator does not support insulin recommendations with more than 300 grams of carbohydrates present.","Hedia doesn't support more than {0} units of insulin per log, but because of the physical activity you entered it has been further reduced by {1}% to {2} units for this log.":function(a){return["Hedia doesn't support more than ",a("0")," units of insulin per log, but because of the physical activity you entered it has been further reduced by ",a("1"),"% to ",a("2")," units for this log."]},"How are you feeling?":"Hvordan har du det?","INSULIN{0}RECOMMENDATION":function(a){return["INSULIN",a("0"),"ANBEFALING"]},"If it is possible, postpone your planned exercise.":"If it is possible, postpone your planned exercise.","Instead of taking insulin":"Instead of taking insulin","Insulin limit reached, for your safety Hedia will not recommend more than this.":"Insulingr\xE6nsen i Hedia er n\xE5et, for din sikkerhed vil der ikke blive anbefalet mere end dette.","Light":"Let","Moderate":"Moderat","More than 15 minutes has passed since this calculation was started.{0}Please go through the calculation steps with new measurements to ensure a safe recommendation.":function(a){return["Der er g\xE5et mere end 15 minutter siden udregningen blev startet.",a("0"),"G\xE5 venligst gennem udregningstrinnene igen med nye m\xE5linger for at sikre en sikker anbefaling."]},"NO":"NO","No":"Nej","OFF":"OFF","OK":"OK","OKAY":"OKAY","Post":"Efter","Recommended":"Anbefalet","Recommended amount of insulin":"Anbefalet enhed(er) af insulin","Remind me to remeasure in":"P\xE5mind mig at genm\xE5le om","Total":"Sum","Transfer to logbook":"Overf\xF8r til logbog","Transferred to logbook":"Overf\xF8rt til logbog","Units":"Enheder","Untitled Activity":"Unavngivet aktivitet","We recommend eating an additional:":"Vi anbefaler at spise yderligere:","Would you like to add this to your current calculation?":"Would you like to add this to your current calculation?","Yes":"Ja","You have a high blood glucose level.":"You have a high blood glucose level.","You should take rapid-acting insulin and measure ketones.":"You should take rapid-acting insulin and measure ketones.","You will be reminded to measure your blood glucose level in 15 min.":"You will be reminded to measure your blood glucose level in 15 min.","Your blood glucose level is very low.":"Your blood glucose level is very low.","Your blood glucose level is very low. Take glucagon or eat carbohydrates if possible. Seek medical attention.":"Your blood glucose level is very low. Take glucagon or eat carbohydrates if possible. Seek medical attention.","Your recommendation would have been higher than {0} units of insulin, but it has been limited for safety reasons.":function(a){return["Your recommendation would have been higher than ",a("0")," units of insulin, but it has been limited for safety reasons."]},"Your recommendation would have been higher than {0} units of insulin, but it has been limited for safety reasons.{1} Hedia never recommends more than {2} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {3}% to {4}.":function(a){return["Your recommendation would have been higher than ",a("0")," units of insulin, but it has been limited for safety reasons.",a("1")," Hedia never recommends more than ",a("2")," units of insulin per calculation, but because of the physical activity you entered it has been further reduced by ",a("3"),"% to ",a("4"),"."]},"g carbs":"g carbs","grams of carbohydrates":"grams of carbohydrates","hours":"timer","min":"min","units":"enheder"}};
1
+ /* eslint-disable */module.exports={languageData:{"plurals":function(n,ord){var s=String(n).split("."),i=s[0],t0=Number(s[0])==n;if(ord)return"other";return n==1||!t0&&(i==0||i==1)?"one":"other"}},messages:{"Active Insulin":"Aktiv Insulin","Activity":"Aktivitet","Additional":"Supplerende","Attention":"OBS","Based on the selected activity your insulin recommendation is reduced by:":"Baseret p\xE5 din valgte aktivitet er din insulin anbefaling reduceret med:","Blood Glucose Level":"Blodsukkerniveau","Close calculation":"Luk beregning","Entered":"Indtastet","Error. Hedia Calculator does not support an insulin dosis greater than {0} units":function(a){return["Error. Hedia Calculator does not support an insulin dosis greater than ",a("0")," units"]},"Error. Hedia Calculator does not support insulin recommendations with boluses older than 4 hours":"Error. Hedia Calculator does not support insulin recommendations with boluses older than 4 hours","Error. Hedia Calculator does not support your activity intensity value":"Error. Hedia Calculator does not support your activity intensity value","Error. Hedia Calculator does not support your current blood glucose level.":"Error. Hedia Calculator does not support your current blood glucose level.","Error. Hedia Calculator does not support your current blood glucose unit.":"Error. Hedia Calculator does not support your current blood glucose unit.","Error. Hedia Calculator does not support your current language.":"Error. Hedia Calculator does not support your current language.","Error. Hedia Calculator does not support your injection method.":"Error. Hedia Calculator does not support your injection method.","Error. Hedia Calculator only supports activities with a duration of maximum 60 minutes.":"Error. Hedia Calculator only supports activities with a duration of maximum 60 minutes.","Error. Please verify that your activity settings are set up correctly.":"Error. Please verify that your activity settings are set up correctly.","Error. Please verify that your activity target blood glucose value is correct.":"Error. Please verify that your activity target blood glucose value is correct.","Error. Please verify that your insulin sensitivity value is correct.":"Error. Please verify that your insulin sensitivity value is correct.","Error. Please verify that your insulin to carb ratio value is correct.":"Error. Please verify that your insulin to carb ratio value is correct.","Error. Please verify that your target blood glucose value is correct.":"Error. Please verify that your target blood glucose value is correct.","Error. Please verify your notifications settings.":"Error. Please verify your notifications settings.","Food":"Mad","Hard":"H\xE5rd","Have you taken insulin within the last 4 hours?":"Har du taget insulin inden for de sidste 4 timer?","Hedia Calculator does not support activities that finished more than 4 hours ago.":"Hedia Calculator does not support activities that finished more than 4 hours ago.","Hedia Calculator does not support insulin recommendations with more than 300 grams of carbohydrates present.":"Hedia Calculator does not support insulin recommendations with more than 300 grams of carbohydrates present.","Hedia does not support more than {0} units of insulin per calculation.":function(a){return["Hedia underst\xF8tter maksimalt ",a("0")," units af insulin per beregning"]},"Hedia doesn't support more than {0} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {1}% to {2} units for this calculation.":function(a){return["Hedia underst\xF8tter maksimalt ",a("0")," units af insulin per beregning, men p\xE5 grund af den fysiske aktivitet du har indtastet er gr\xE6nsen reduceret med yderligere ",a("1"),"% til ",a("2")," for denne beregning."]},"How are you feeling?":"Hvordan har du det?","INSULIN{0}RECOMMENDATION":function(a){return["INSULIN",a("0"),"ANBEFALING"]},"If it is possible, postpone your planned exercise.":"Hvis det er muligt, uds\xE6t din planlagte tr\xE6ning.","Instead of taking insulin":"I stedet for at tage insulin","Light":"Let","Moderate":"Moderat","More than 15 minutes has passed since this calculation was started.{0}Please go through the calculation steps with new measurements to ensure a safe recommendation.":function(a){return["Der er g\xE5et mere end 15 minutter siden udregningen blev startet.",a("0"),"G\xE5 venligst gennem udregningstrinnene igen med nye m\xE5linger for at sikre en sikker anbefaling."]},"NO":"NEJ","No":"Nej","OFF":"OFF","OK":"OK","Post":"Efter","Recommended":"Anbefalet","Recommended amount of insulin":"Anbefalet enhed(er) af insulin","Remind me to remeasure in":"P\xE5mind mig at genm\xE5le om","Save data before closing?":"Vil du gemme din indtastning?","Save to logbook":"Gem i logbog","Total":"Sum","Transfer to logbook":"Overf\xF8r til logbog","Transferred to logbook":"Overf\xF8rt til logbog","Units":"Enheder","Untitled Activity":"Unavngivet aktivitet","We recommend eating an additional:":"Vi anbefaler at spise yderligere:","Would you like to add this to your current calculation?":"Would you like to add this to your current calculation?","Yes":"Ja","You have a high blood glucose level.":"Du har et h\xF8jt blodsukkerniveau.","You should take rapid-acting insulin and measure ketones.":"Du burde tage hurtigtvirkende insulin og m\xE5le ketoner.","You will be reminded to measure your blood glucose level in 15 min.":"Du vil f\xE5 p\xE5mindelser om at m\xE5le dit blodsukkerniveau om 15 minutter.","Your blood glucose level is very low.":"Dit blodsukkerniveau er meget lavt.","Your blood glucose level is very low. Take glucagon or eat carbohydrates if possible. Seek medical attention.":"Dit blodsukkerniveau er meget lavt. Tag glukagon eller spis kulhydrater, hvis det er muligt. S\xF8g l\xE6gehj\xE6lp.","Your recommendation would have been higher than {0} units of insulin, but it has been limited for safety reasons. Hedia never recommends more than {1} units of insulin per calculation.":function(a){return["Your recommendation would have been higher than ",a("0")," units of insulin, but it has been limited for safety reasons. Hedia never recommends more than ",a("1")," units of insulin per calculation."]},"Your recommendation would have been higher than {0} units of insulin, but it has been limited for safety reasons.{1} Hedia never recommends more than {2} units of insulin per calculation, but because of the physical activity you entered it has been further reduced by {3}% to {4}.":function(a){return["Din anbefaling ville have v\xE6ret h\xF8jere end ",a("0")," units af insulin, men den er blevet begr\xE6nset af sikkerhedshensyn.",a("1"),"Hedia anbefaler aldrig mere end ",a("2")," units af insulin per beregning, men p\xE5 grund af den fysiske aktivitet du har indtastet er gr\xE6nsen reduceret med yderligere ",a("3"),"% til ",a("4"),"."]},"Your saved data will be used for future calculations.":"Dine gemte indtastninger vil blive brugt til fremtidige beregninger.","g carbs":"g kulhydrater","grams of carbohydrates":"grams of carbohydrates","hours":"timer","min":"min","units":"enheder"}};