@hedia/recommendation-screen 2.1.49 → 2.1.50-alpha.0
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.
- package/dist/src/RecommendationScreen.js +4 -4
- package/dist/src/components/Header.js +4 -4
- package/dist/src/components/InfoBars.js +5 -5
- package/dist/src/components/RecentInsulin.js +4 -3
- package/dist/src/components/RecommendationModal.js +16 -16
- package/dist/src/components/RecommendedCarbs.js +11 -11
- package/dist/src/components/RecommendedInsulin.js +5 -4
- package/dist/src/components/Remeasure.js +3 -3
- package/dist/src/components/TransferToLogbook.js +3 -2
- package/dist/src/components/TwoOptionModal.js +14 -14
- package/dist/src/components/activity/Activity.js +3 -2
- package/dist/src/components/activity/ActivityIcon.js +2 -1
- package/dist/src/components/activity/ActivityIntensity.js +4 -3
- package/dist/src/components/mood/Emotion.js +2 -1
- package/dist/src/utils/Constants.d.ts +24 -6
- package/dist/src/utils/Constants.js +24 -6
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { AppState, BackHandler, LogBox, StyleSheet, View } from "react-native";
|
|
3
3
|
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
|
|
4
|
-
import { BACKGROUND_COLOUR_PURPLE, BORDER_COLOUR_GREY, BORDER_COLOUR_TEAL } from "./utils/Constants";
|
|
5
4
|
import Header from "./components/Header";
|
|
6
5
|
import InfoBars, { infoStyles } from "./components/InfoBars";
|
|
7
6
|
import RecentInsulin from "./components/RecentInsulin";
|
|
@@ -13,6 +12,7 @@ import { Milliseconds, } from "@hedia/types";
|
|
|
13
12
|
import { I18nProvider } from "@lingui/react";
|
|
14
13
|
import Emotion from "./components/mood/Emotion";
|
|
15
14
|
import TransferToLogbook from "./components/TransferToLogbook";
|
|
15
|
+
import { colors } from "./utils/Constants";
|
|
16
16
|
import { t } from "@lingui/macro";
|
|
17
17
|
import Activity from "./components/activity/Activity";
|
|
18
18
|
import LimitationMessage from "./components/LimitationMessage";
|
|
@@ -477,7 +477,7 @@ export default class RecommendationScreen extends React.Component {
|
|
|
477
477
|
<View style={[
|
|
478
478
|
containerStyles.calcBorder,
|
|
479
479
|
{
|
|
480
|
-
borderColor: recommendedCarbs ?
|
|
480
|
+
borderColor: recommendedCarbs ? colors.teal : colors.mistBlue,
|
|
481
481
|
},
|
|
482
482
|
]}>
|
|
483
483
|
<RecommendedCarbs enteredCarbs={`${providedCarbs}`} changedRecommendedCarbs={this.updateCarbRecommendation} recommendedCarbs={`${recommendedCarbs}`} removeRecommendedCarbs={this.removeCarbRecommendation}/>
|
|
@@ -502,7 +502,7 @@ export default class RecommendationScreen extends React.Component {
|
|
|
502
502
|
const containerStyles = StyleSheet.create({
|
|
503
503
|
container: {
|
|
504
504
|
flex: 1,
|
|
505
|
-
backgroundColor:
|
|
505
|
+
backgroundColor: colors.darkBlue,
|
|
506
506
|
},
|
|
507
507
|
calcContainer: {
|
|
508
508
|
flex: 1,
|
|
@@ -514,6 +514,6 @@ const containerStyles = StyleSheet.create({
|
|
|
514
514
|
},
|
|
515
515
|
calcBorder: {
|
|
516
516
|
...infoStyles.border,
|
|
517
|
-
borderColor:
|
|
517
|
+
borderColor: colors.teal,
|
|
518
518
|
},
|
|
519
519
|
});
|
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { Dimensions, SafeAreaView, StyleSheet, TouchableOpacity, View } from "react-native";
|
|
4
4
|
import { i18n } from "../locale/i18nUtils";
|
|
5
5
|
import { Testing } from "../types/enum";
|
|
6
|
-
import {
|
|
6
|
+
import { colors } from "../utils/Constants";
|
|
7
7
|
import Icon from "./Icon";
|
|
8
8
|
import TextBold from "./text/TextBold";
|
|
9
9
|
/** Component to display a header text along with a cancel-button that triggers a callback function. */
|
|
@@ -35,7 +35,7 @@ export default class Header extends React.Component {
|
|
|
35
35
|
}
|
|
36
36
|
const headerStyles = StyleSheet.create({
|
|
37
37
|
backgroundColour: {
|
|
38
|
-
backgroundColor:
|
|
38
|
+
backgroundColor: colors.darkBlue,
|
|
39
39
|
},
|
|
40
40
|
margin: {
|
|
41
41
|
margin: `1%`,
|
|
@@ -56,7 +56,7 @@ const headerStyles = StyleSheet.create({
|
|
|
56
56
|
},
|
|
57
57
|
iconStyle: {
|
|
58
58
|
fontSize: Dimensions.get(`screen`).width / 12,
|
|
59
|
-
color:
|
|
59
|
+
color: colors.mistBlue,
|
|
60
60
|
},
|
|
61
61
|
headerTextContainer: {
|
|
62
62
|
flex: 6,
|
|
@@ -67,7 +67,7 @@ const headerStyles = StyleSheet.create({
|
|
|
67
67
|
headerText: {
|
|
68
68
|
fontSize: Dimensions.get(`screen`).width / 18,
|
|
69
69
|
textAlign: `center`,
|
|
70
|
-
color:
|
|
70
|
+
color: colors.white,
|
|
71
71
|
},
|
|
72
72
|
headerFiller: {
|
|
73
73
|
flex: 1,
|
|
@@ -3,7 +3,7 @@ import { t } from "@lingui/macro";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Dimensions, StyleSheet, View } from "react-native";
|
|
5
5
|
import { i18n } from "../locale/i18nUtils";
|
|
6
|
-
import {
|
|
6
|
+
import { colors } from "../utils/Constants";
|
|
7
7
|
import { Utils } from "../utils/Utils";
|
|
8
8
|
import TextBold from "./text/TextBold";
|
|
9
9
|
import TextRegular from "./text/TextRegular";
|
|
@@ -80,7 +80,7 @@ export const infoStyles = StyleSheet.create({
|
|
|
80
80
|
},
|
|
81
81
|
border: {
|
|
82
82
|
borderWidth: 2,
|
|
83
|
-
borderColor:
|
|
83
|
+
borderColor: colors.mistBlue,
|
|
84
84
|
borderRadius: 5,
|
|
85
85
|
paddingVertical: `1%`,
|
|
86
86
|
},
|
|
@@ -95,7 +95,7 @@ export const infoStyles = StyleSheet.create({
|
|
|
95
95
|
justifyContent: `center`,
|
|
96
96
|
},
|
|
97
97
|
label: {
|
|
98
|
-
color:
|
|
98
|
+
color: colors.white,
|
|
99
99
|
fontSize: Dimensions.get(`screen`).width / 22,
|
|
100
100
|
},
|
|
101
101
|
valueUnitContainer: {
|
|
@@ -108,7 +108,7 @@ export const infoStyles = StyleSheet.create({
|
|
|
108
108
|
justifyContent: `flex-end`,
|
|
109
109
|
},
|
|
110
110
|
value: {
|
|
111
|
-
color:
|
|
111
|
+
color: colors.white,
|
|
112
112
|
fontSize: Dimensions.get(`screen`).width / 15,
|
|
113
113
|
textAlign: `right`,
|
|
114
114
|
},
|
|
@@ -118,7 +118,7 @@ export const infoStyles = StyleSheet.create({
|
|
|
118
118
|
paddingBottom: `3%`,
|
|
119
119
|
},
|
|
120
120
|
units: {
|
|
121
|
-
color:
|
|
121
|
+
color: colors.white,
|
|
122
122
|
fontSize: Dimensions.get(`screen`).width / 30,
|
|
123
123
|
textAlign: `left`,
|
|
124
124
|
paddingLeft: `5%`,
|
|
@@ -3,6 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { Dimensions, StyleSheet, TouchableOpacity, View } from "react-native";
|
|
4
4
|
import { i18n } from "../locale/i18nUtils";
|
|
5
5
|
import { Testing } from "../types/enum";
|
|
6
|
+
import { colors } from "../utils/Constants";
|
|
6
7
|
import { infoStyles } from "./InfoBars";
|
|
7
8
|
import TextBold from "./text/TextBold";
|
|
8
9
|
/** Display a card that prompts the user to recall if they injected insulin recently. */
|
|
@@ -41,7 +42,7 @@ export default class RecentInsulin extends React.Component {
|
|
|
41
42
|
const recentInsulinStyles = StyleSheet.create({
|
|
42
43
|
container: {
|
|
43
44
|
...infoStyles.margin,
|
|
44
|
-
backgroundColor:
|
|
45
|
+
backgroundColor: colors.purple,
|
|
45
46
|
borderRadius: 5,
|
|
46
47
|
},
|
|
47
48
|
titleContainer: {
|
|
@@ -74,7 +75,7 @@ const recentInsulinStyles = StyleSheet.create({
|
|
|
74
75
|
},
|
|
75
76
|
yesNoContainer: {
|
|
76
77
|
flex: 1,
|
|
77
|
-
borderColor:
|
|
78
|
+
borderColor: colors.white,
|
|
78
79
|
borderRadius: 100,
|
|
79
80
|
borderWidth: 2,
|
|
80
81
|
paddingHorizontal: `2%`,
|
|
@@ -84,7 +85,7 @@ const recentInsulinStyles = StyleSheet.create({
|
|
|
84
85
|
textAlign: `center`,
|
|
85
86
|
paddingTop: `1%`,
|
|
86
87
|
paddingBottom: `1%`,
|
|
87
|
-
color:
|
|
88
|
+
color: colors.white,
|
|
88
89
|
fontSize: Dimensions.get(`screen`).width / 25,
|
|
89
90
|
},
|
|
90
91
|
filler: {
|
|
@@ -4,7 +4,7 @@ import { Dimensions, StyleSheet, TouchableOpacity, View } from "react-native";
|
|
|
4
4
|
import ReactNativeModal from "react-native-modal";
|
|
5
5
|
import { i18n } from "../locale/i18nUtils";
|
|
6
6
|
import { Testing } from "../types/enum";
|
|
7
|
-
import {
|
|
7
|
+
import { colors } from "../utils/Constants";
|
|
8
8
|
import LimitationMessage from "./LimitationMessage";
|
|
9
9
|
import TextBold from "./text/TextBold";
|
|
10
10
|
import TextRegular from "./text/TextRegular";
|
|
@@ -153,20 +153,20 @@ export const stylesModal = StyleSheet.create({
|
|
|
153
153
|
modalStyle: { margin: 0 },
|
|
154
154
|
container: {
|
|
155
155
|
flex: 4,
|
|
156
|
-
backgroundColor:
|
|
156
|
+
backgroundColor: colors.semiDarkBlue,
|
|
157
157
|
justifyContent: `center`,
|
|
158
158
|
paddingHorizontal: `4%`,
|
|
159
159
|
},
|
|
160
160
|
containerAcceptButton: {
|
|
161
161
|
flex: 1,
|
|
162
|
-
backgroundColor:
|
|
162
|
+
backgroundColor: colors.semiDarkBlue,
|
|
163
163
|
justifyContent: `flex-start`,
|
|
164
164
|
},
|
|
165
165
|
titleContainer: { marginBottom: `5%` },
|
|
166
166
|
recommendationRow: { justifyContent: `center`, alignContent: `center`, marginBottom: `3%` },
|
|
167
|
-
textTittleMessage: { color:
|
|
168
|
-
textMessage: { color:
|
|
169
|
-
buttonText: { color:
|
|
167
|
+
textTittleMessage: { color: colors.white, fontSize: titleFontSize, textAlign: `center` },
|
|
168
|
+
textMessage: { color: colors.white, fontSize: textFontSize, textAlign: `center` },
|
|
169
|
+
buttonText: { color: colors.teal, fontSize: buttonFontSize, textAlign: `center` },
|
|
170
170
|
addToCalculationContainer: { justifyContent: `flex-start`, marginVertical: `5%` },
|
|
171
171
|
innerView: {
|
|
172
172
|
alignContent: `center`,
|
|
@@ -175,22 +175,22 @@ export const stylesModal = StyleSheet.create({
|
|
|
175
175
|
marginTop: `5%`,
|
|
176
176
|
borderRadius: height / 80,
|
|
177
177
|
borderWidth: height / 300,
|
|
178
|
-
borderColor:
|
|
178
|
+
borderColor: colors.teal,
|
|
179
179
|
},
|
|
180
180
|
suggestedContainer: { justifyContent: `center`, flexDirection: `row`, marginBottom: `3%` },
|
|
181
|
-
suggestedCarbs: { color:
|
|
181
|
+
suggestedCarbs: { color: colors.white, fontSize: sugestionFontSize },
|
|
182
182
|
textCenter: { textAlign: `center` },
|
|
183
|
-
recommendEatingText: { color:
|
|
184
|
-
carbohydrateText: { color:
|
|
185
|
-
addToCalculation: { color:
|
|
183
|
+
recommendEatingText: { color: colors.dustyBlue, fontSize: recommendEatingFontSize, textAlign: `center` },
|
|
184
|
+
carbohydrateText: { color: colors.white, fontSize: sugestionFontSize },
|
|
185
|
+
addToCalculation: { color: colors.white, fontSize: textFontSize, textAlign: `center` },
|
|
186
186
|
recommendationButtonsContainer: { justifyContent: `center`, flexDirection: `row`, margin: `3%` },
|
|
187
|
-
affirmativeCarbsText: { color:
|
|
188
|
-
negativeCarbsText: { color:
|
|
187
|
+
affirmativeCarbsText: { color: colors.teal, fontSize: buttonFontSize, textAlign: `center` },
|
|
188
|
+
negativeCarbsText: { color: colors.white, fontSize: buttonFontSize, textAlign: `center` },
|
|
189
189
|
affirmativeCarbsButton: {
|
|
190
190
|
marginTop: `2%`,
|
|
191
191
|
borderRadius: buttonBorderRadius,
|
|
192
192
|
borderWidth: buttonBorderWidth,
|
|
193
|
-
borderColor:
|
|
193
|
+
borderColor: colors.teal,
|
|
194
194
|
width: buttonWidth,
|
|
195
195
|
height: buttonHeight,
|
|
196
196
|
alignSelf: `center`,
|
|
@@ -201,7 +201,7 @@ export const stylesModal = StyleSheet.create({
|
|
|
201
201
|
marginTop: `2%`,
|
|
202
202
|
borderRadius: buttonBorderRadius,
|
|
203
203
|
borderWidth: buttonBorderWidth,
|
|
204
|
-
borderColor:
|
|
204
|
+
borderColor: colors.white,
|
|
205
205
|
width: buttonWidth,
|
|
206
206
|
height: buttonHeight,
|
|
207
207
|
alignSelf: `center`,
|
|
@@ -212,7 +212,7 @@ export const stylesModal = StyleSheet.create({
|
|
|
212
212
|
marginTop: `6%`,
|
|
213
213
|
borderRadius: buttonBorderRadius,
|
|
214
214
|
borderWidth: buttonBorderWidth,
|
|
215
|
-
borderColor:
|
|
215
|
+
borderColor: colors.teal,
|
|
216
216
|
width: buttonWidth,
|
|
217
217
|
height: buttonHeight,
|
|
218
218
|
alignSelf: `center`,
|
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { Alert, Dimensions, StyleSheet, TouchableOpacity, View } from "react-native";
|
|
4
4
|
import { i18n } from "../locale/i18nUtils";
|
|
5
5
|
import { Testing } from "../types/enum";
|
|
6
|
-
import {
|
|
6
|
+
import { colors } from "../utils/Constants";
|
|
7
7
|
import { CarbohydrateLimitError } from "../utils/RecommendationError";
|
|
8
8
|
import Icon from "./Icon";
|
|
9
9
|
import { infoStyles } from "./InfoBars";
|
|
@@ -90,7 +90,7 @@ export default class RecommendedCarbs extends React.Component {
|
|
|
90
90
|
const shownCarbs = this.state.partialInput ?? Math.round(Number(this.props.recommendedCarbs));
|
|
91
91
|
const totalCarbs = Math.round(parseFloat(this.props.enteredCarbs) + Number(shownCarbs));
|
|
92
92
|
return (<React.Fragment>
|
|
93
|
-
<LineSeparator color={
|
|
93
|
+
<LineSeparator color={colors.mistBlue}/>
|
|
94
94
|
<View style={calculationStyles.borderContainer}>
|
|
95
95
|
<View style={calculationStyles.recommendedContainer}>
|
|
96
96
|
<TouchableOpacity testID={RecommendedCarbsTestIds.RemoveRecommendation} style={calculationStyles.removeRecommended} onPress={this.props.removeRecommendedCarbs}>
|
|
@@ -106,7 +106,7 @@ export default class RecommendedCarbs extends React.Component {
|
|
|
106
106
|
<View style={calculationStyles.valueUnitContainer}>
|
|
107
107
|
<TouchableOpacity testID={RecommendedCarbsTestIds.EditRecommendedCarbs} onPress={this.showTextInput} style={[calculationStyles.valueUnitContainer]}>
|
|
108
108
|
<View style={calculationStyles.valueContainer}>
|
|
109
|
-
<TextBold testID={RecommendedCarbsTestIds.RecommendedCarbs} style={{ ...calculationStyles.value, color:
|
|
109
|
+
<TextBold testID={RecommendedCarbsTestIds.RecommendedCarbs} style={{ ...calculationStyles.value, color: colors.teal }}>
|
|
110
110
|
{shownCarbs}
|
|
111
111
|
</TextBold>
|
|
112
112
|
</View>
|
|
@@ -114,14 +114,14 @@ export default class RecommendedCarbs extends React.Component {
|
|
|
114
114
|
<View style={calculationStyles.editIconContainer}>
|
|
115
115
|
<Icon style={calculationStyles.editIcon} iconIdentifier={`Feather/edit`}/>
|
|
116
116
|
</View>
|
|
117
|
-
<TextRegular style={{ ...calculationStyles.units, color:
|
|
117
|
+
<TextRegular style={{ ...calculationStyles.units, color: colors.teal }}>
|
|
118
118
|
{i18n._(t `grams`)}
|
|
119
119
|
</TextRegular>
|
|
120
120
|
</View>
|
|
121
121
|
</TouchableOpacity>
|
|
122
122
|
</View>
|
|
123
123
|
</View>
|
|
124
|
-
<LineSeparator color={
|
|
124
|
+
<LineSeparator color={colors.teal}/>
|
|
125
125
|
{this.renderRow({
|
|
126
126
|
label: i18n._(t `Total`),
|
|
127
127
|
value: totalCarbs.toString(),
|
|
@@ -191,14 +191,14 @@ const calculationStyles = StyleSheet.create({
|
|
|
191
191
|
},
|
|
192
192
|
foodUnitsLabel: {
|
|
193
193
|
...infoStyles.units,
|
|
194
|
-
color:
|
|
194
|
+
color: colors.lightBlue,
|
|
195
195
|
paddingLeft: `1%`,
|
|
196
196
|
},
|
|
197
197
|
rowContainer: {
|
|
198
198
|
flex: 7,
|
|
199
199
|
},
|
|
200
200
|
rowLabel: {
|
|
201
|
-
color:
|
|
201
|
+
color: colors.white,
|
|
202
202
|
fontSize: Dimensions.get(`screen`).width / 25,
|
|
203
203
|
},
|
|
204
204
|
enteredContainer: {
|
|
@@ -206,7 +206,7 @@ const calculationStyles = StyleSheet.create({
|
|
|
206
206
|
alignItems: `flex-end`,
|
|
207
207
|
},
|
|
208
208
|
entered: {
|
|
209
|
-
color:
|
|
209
|
+
color: colors.white,
|
|
210
210
|
fontSize: Dimensions.get(`screen`).width / 23,
|
|
211
211
|
},
|
|
212
212
|
valueUnitContainer: {
|
|
@@ -230,7 +230,7 @@ const calculationStyles = StyleSheet.create({
|
|
|
230
230
|
flexDirection: `row`,
|
|
231
231
|
},
|
|
232
232
|
editIcon: {
|
|
233
|
-
color:
|
|
233
|
+
color: colors.teal,
|
|
234
234
|
fontSize: Dimensions.get(`screen`).width / 30,
|
|
235
235
|
},
|
|
236
236
|
recommendedContainer: {
|
|
@@ -238,7 +238,7 @@ const calculationStyles = StyleSheet.create({
|
|
|
238
238
|
flexDirection: `row`,
|
|
239
239
|
},
|
|
240
240
|
recommendedLabel: {
|
|
241
|
-
color:
|
|
241
|
+
color: colors.teal,
|
|
242
242
|
fontSize: Dimensions.get(`screen`).width / 25,
|
|
243
243
|
alignSelf: `center`,
|
|
244
244
|
},
|
|
@@ -248,7 +248,7 @@ const calculationStyles = StyleSheet.create({
|
|
|
248
248
|
marginTop: `1%`,
|
|
249
249
|
},
|
|
250
250
|
removeRecommendedIcon: {
|
|
251
|
-
color:
|
|
251
|
+
color: colors.teal,
|
|
252
252
|
fontSize: Dimensions.get(`screen`).width / 20,
|
|
253
253
|
paddingBottom: `0.5%`,
|
|
254
254
|
},
|
|
@@ -6,6 +6,7 @@ import LinearGradient from "react-native-linear-gradient";
|
|
|
6
6
|
import { i18n } from "../locale/i18nUtils";
|
|
7
7
|
import { Testing } from "../types/enum";
|
|
8
8
|
import { Messages } from "../utils/AttentionMessages";
|
|
9
|
+
import { colors } from "../utils/Constants";
|
|
9
10
|
import { Utils } from "../utils/Utils";
|
|
10
11
|
import Icon from "./Icon";
|
|
11
12
|
import { infoStyles } from "./InfoBars";
|
|
@@ -106,7 +107,7 @@ export default class RecommendedInsulin extends React.Component {
|
|
|
106
107
|
const shownInsulin = this.state.partialInput ?? this.props.insulinRecommendation ?? `0`;
|
|
107
108
|
return (<React.Fragment>
|
|
108
109
|
<TouchableOpacity testID={RecommendedInsulinTestIds.EditRecommendedInsulin} onPress={this.handleOnPress}>
|
|
109
|
-
<LinearGradient style={recommendedInsulinStyles.container} colors={[
|
|
110
|
+
<LinearGradient style={recommendedInsulinStyles.container} colors={[colors.purple, colors.blue]} useAngle={true} angle={135}>
|
|
110
111
|
<View style={recommendedInsulinStyles.recommendedTextContainer}>
|
|
111
112
|
<TextBold style={recommendedInsulinStyles.recommendedText}>
|
|
112
113
|
{i18n._(t `Recommended amount of insulin`)}
|
|
@@ -154,17 +155,17 @@ const recommendedInsulinStyles = StyleSheet.create({
|
|
|
154
155
|
minHeight: Dimensions.get(`screen`).width / 4,
|
|
155
156
|
},
|
|
156
157
|
value: {
|
|
157
|
-
color:
|
|
158
|
+
color: colors.white,
|
|
158
159
|
fontSize: Dimensions.get(`screen`).width / 5,
|
|
159
160
|
},
|
|
160
161
|
units: {
|
|
161
162
|
alignSelf: `flex-end`,
|
|
162
|
-
color:
|
|
163
|
+
color: colors.white,
|
|
163
164
|
fontSize: Dimensions.get(`screen`).width / 28,
|
|
164
165
|
paddingBottom: `6%`,
|
|
165
166
|
},
|
|
166
167
|
editIcon: {
|
|
167
|
-
color:
|
|
168
|
+
color: colors.white,
|
|
168
169
|
fontSize: Dimensions.get(`screen`).width / 28,
|
|
169
170
|
textAlignVertical: `center`,
|
|
170
171
|
paddingBottom: `10%`,
|
|
@@ -4,7 +4,7 @@ import React from "react";
|
|
|
4
4
|
import { Dimensions, Platform, StyleSheet, View } from "react-native";
|
|
5
5
|
import { i18n } from "../locale/i18nUtils";
|
|
6
6
|
import { Testing } from "../types/enum";
|
|
7
|
-
import {
|
|
7
|
+
import { colors } from "../utils/Constants";
|
|
8
8
|
import { infoStyles } from "./InfoBars";
|
|
9
9
|
import TextBold from "./text/TextBold";
|
|
10
10
|
import TextRegular from "./text/TextRegular";
|
|
@@ -81,7 +81,7 @@ export default class Remeasure extends React.Component {
|
|
|
81
81
|
if (slider !== null) {
|
|
82
82
|
this.slider = slider;
|
|
83
83
|
}
|
|
84
|
-
}} testID={Testing.Id.RemeasureTestIds.RemeasureSlider} maximumTrackTintColor={
|
|
84
|
+
}} testID={Testing.Id.RemeasureTestIds.RemeasureSlider} maximumTrackTintColor={colors.mistBlue} minimumTrackTintColor={colors.teal} thumbTintColor={colors.teal} maximumValue={6} minimumValue={0} step={0.5} style={[remeasureStyles.sliderStyle, { marginHorizontal }]} onValueChange={this.handleSliderChange}/>
|
|
85
85
|
</View>);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -98,7 +98,7 @@ const remeasureStyles = StyleSheet.create({
|
|
|
98
98
|
flex: 7,
|
|
99
99
|
},
|
|
100
100
|
remeasureLabel: {
|
|
101
|
-
color:
|
|
101
|
+
color: colors.white,
|
|
102
102
|
fontSize: Dimensions.get(`screen`).width / 25,
|
|
103
103
|
},
|
|
104
104
|
valueUnitContainer: {
|
|
@@ -3,6 +3,7 @@ import { Dimensions, StyleSheet, TouchableOpacity, View } from "react-native";
|
|
|
3
3
|
import { t } from "@lingui/macro";
|
|
4
4
|
import { i18n } from "../locale/i18nUtils";
|
|
5
5
|
import { Testing } from "../types/enum";
|
|
6
|
+
import { colors } from "../utils/Constants";
|
|
6
7
|
import TextBold from "./text/TextBold";
|
|
7
8
|
/**
|
|
8
9
|
* Render a button for transferring the recommendation to a logbook entry.
|
|
@@ -58,10 +59,10 @@ const addToLogbookStyles = StyleSheet.create({
|
|
|
58
59
|
borderRadius: 100,
|
|
59
60
|
marginHorizontal: `4%`,
|
|
60
61
|
paddingVertical: `4%`,
|
|
61
|
-
borderColor:
|
|
62
|
+
borderColor: colors.teal,
|
|
62
63
|
},
|
|
63
64
|
transferText: {
|
|
64
|
-
color:
|
|
65
|
+
color: colors.teal,
|
|
65
66
|
fontSize: Dimensions.get(`screen`).width / 22,
|
|
66
67
|
},
|
|
67
68
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Dimensions, StatusBar, StyleSheet, TouchableOpacity, View } from "react-native";
|
|
3
3
|
import { Testing } from "../types/enum";
|
|
4
|
-
import {
|
|
4
|
+
import { colors } from "../utils/Constants";
|
|
5
5
|
import Icon from "./Icon";
|
|
6
6
|
import { stylesModal } from "./RecommendationModal";
|
|
7
7
|
import TextBold from "./text/TextBold";
|
|
@@ -13,11 +13,11 @@ export default class TwoOptionModal extends React.Component {
|
|
|
13
13
|
render() {
|
|
14
14
|
const { rowAsButtonLayout, isCancelable } = this.props;
|
|
15
15
|
return (<View style={modalStyle.container}>
|
|
16
|
-
<StatusBar backgroundColor={
|
|
16
|
+
<StatusBar backgroundColor={colors.transparentLightBlue}/>
|
|
17
17
|
<View style={modalStyle.modalContainer}>
|
|
18
|
-
{isCancelable
|
|
18
|
+
{isCancelable && (<TouchableOpacity onPress={this.props.onClose} testID={TwoOptionModalTestIds.ExitButton} style={modalStyle.iconWrapper}>
|
|
19
19
|
<Icon iconIdentifier={`Ionicons/ios-close-circle-outline`} style={modalStyle.icon}/>
|
|
20
|
-
</TouchableOpacity>)
|
|
20
|
+
</TouchableOpacity>)}
|
|
21
21
|
|
|
22
22
|
<View style={isCancelable ? modalStyle.textContainer : modalStyle.textContainerNotCancelable}>
|
|
23
23
|
<TextBold style={rowAsButtonLayout ? modalStyle.titleRowLayout : modalStyle.titleColumnLayout}>
|
|
@@ -47,11 +47,11 @@ export const modalStyle = StyleSheet.create({
|
|
|
47
47
|
container: {
|
|
48
48
|
...StyleSheet.absoluteFillObject,
|
|
49
49
|
justifyContent: `center`,
|
|
50
|
-
backgroundColor:
|
|
50
|
+
backgroundColor: colors.transparentBlack,
|
|
51
51
|
},
|
|
52
52
|
modalContainer: {
|
|
53
53
|
margin: `4%`,
|
|
54
|
-
backgroundColor:
|
|
54
|
+
backgroundColor: colors.semiDarkBlue,
|
|
55
55
|
borderRadius: width / 25,
|
|
56
56
|
},
|
|
57
57
|
iconWrapper: {
|
|
@@ -60,7 +60,7 @@ export const modalStyle = StyleSheet.create({
|
|
|
60
60
|
marginTop: `3%`,
|
|
61
61
|
},
|
|
62
62
|
icon: {
|
|
63
|
-
color:
|
|
63
|
+
color: colors.fadeBlue,
|
|
64
64
|
fontSize: width / 12,
|
|
65
65
|
},
|
|
66
66
|
textContainer: {
|
|
@@ -75,19 +75,19 @@ export const modalStyle = StyleSheet.create({
|
|
|
75
75
|
alignSelf: `flex-start`,
|
|
76
76
|
},
|
|
77
77
|
titleRowLayout: {
|
|
78
|
-
color:
|
|
78
|
+
color: colors.white,
|
|
79
79
|
fontSize: width / 17,
|
|
80
80
|
textAlign: `center`,
|
|
81
81
|
marginBottom: `10%`,
|
|
82
82
|
},
|
|
83
83
|
titleColumnLayout: {
|
|
84
|
-
color:
|
|
84
|
+
color: colors.white,
|
|
85
85
|
fontSize: width / 17,
|
|
86
86
|
textAlign: `center`,
|
|
87
87
|
marginBottom: `5%`,
|
|
88
88
|
},
|
|
89
89
|
message: {
|
|
90
|
-
color:
|
|
90
|
+
color: colors.lightBlue,
|
|
91
91
|
fontSize: width / 22,
|
|
92
92
|
textAlign: `center`,
|
|
93
93
|
},
|
|
@@ -112,7 +112,7 @@ export const modalStyle = StyleSheet.create({
|
|
|
112
112
|
height: height / 18,
|
|
113
113
|
width: width / 1.5,
|
|
114
114
|
marginTop: 0,
|
|
115
|
-
backgroundColor:
|
|
115
|
+
backgroundColor: colors.teal,
|
|
116
116
|
},
|
|
117
117
|
secondButtonColumn: {
|
|
118
118
|
alignSelf: `center`,
|
|
@@ -124,17 +124,17 @@ export const modalStyle = StyleSheet.create({
|
|
|
124
124
|
textButtonRow: {
|
|
125
125
|
textAlign: `center`,
|
|
126
126
|
fontSize: width / 24,
|
|
127
|
-
color:
|
|
127
|
+
color: colors.teal,
|
|
128
128
|
},
|
|
129
129
|
textFirstButtonColumn: {
|
|
130
130
|
textAlign: `center`,
|
|
131
131
|
fontSize: width / 22,
|
|
132
132
|
paddingHorizontal: 15,
|
|
133
|
-
color:
|
|
133
|
+
color: colors.darkBlue,
|
|
134
134
|
},
|
|
135
135
|
textSecondButtonColumn: {
|
|
136
136
|
textAlign: `center`,
|
|
137
137
|
fontSize: width / 26,
|
|
138
|
-
color:
|
|
138
|
+
color: colors.teal,
|
|
139
139
|
},
|
|
140
140
|
});
|
|
@@ -3,6 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { Dimensions, StyleSheet, View } from "react-native";
|
|
4
4
|
import { i18n } from "../../locale/i18nUtils";
|
|
5
5
|
import { Testing } from "../../types/enum";
|
|
6
|
+
import { colors } from "../../utils/Constants";
|
|
6
7
|
import { infoStyles } from "../InfoBars";
|
|
7
8
|
import TextBold from "../text/TextBold";
|
|
8
9
|
import TextRegular from "../text/TextRegular";
|
|
@@ -73,11 +74,11 @@ const activityStyles = StyleSheet.create({
|
|
|
73
74
|
marginBottom: `2%`,
|
|
74
75
|
},
|
|
75
76
|
infoText: {
|
|
76
|
-
color:
|
|
77
|
+
color: colors.lightBlue,
|
|
77
78
|
fontSize: width / 24,
|
|
78
79
|
},
|
|
79
80
|
reductionPercentage: {
|
|
80
|
-
color:
|
|
81
|
+
color: colors.white,
|
|
81
82
|
marginTop: `2%`,
|
|
82
83
|
fontSize: width / 18,
|
|
83
84
|
},
|
|
@@ -3,6 +3,7 @@ import { t } from "@lingui/macro";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Dimensions, Image, StyleSheet, View } from "react-native";
|
|
5
5
|
import { i18n } from "../../locale/i18nUtils";
|
|
6
|
+
import { colors } from "../../utils/Constants";
|
|
6
7
|
import TextRegular from "../text/TextRegular";
|
|
7
8
|
const { Other } = Activity.Enums.ActivityEnum;
|
|
8
9
|
/** Mapping from ActivityEnums to corresponding image resource. */
|
|
@@ -52,7 +53,7 @@ const activityIconStyles = StyleSheet.create({
|
|
|
52
53
|
height: Dimensions.get(`screen`).width / 16,
|
|
53
54
|
},
|
|
54
55
|
activityTitle: {
|
|
55
|
-
color:
|
|
56
|
+
color: colors.white,
|
|
56
57
|
fontSize: Dimensions.get(`screen`).width / 25,
|
|
57
58
|
},
|
|
58
59
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Activity } from "@hedia/types";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Dimensions, StyleSheet, View } from "react-native";
|
|
4
|
+
import { colors } from "../../utils/Constants";
|
|
4
5
|
import { ActivityIntensityTranslations } from "../../utils/Translations";
|
|
5
6
|
import { infoStyles } from "../InfoBars";
|
|
6
7
|
import TextBold from "../text/TextBold";
|
|
@@ -38,13 +39,13 @@ const activityIntensityStyles = StyleSheet.create({
|
|
|
38
39
|
borderRadius: 5,
|
|
39
40
|
},
|
|
40
41
|
[Activity.Enums.ActivityIntensity.light]: {
|
|
41
|
-
backgroundColor:
|
|
42
|
+
backgroundColor: colors.activityGreen,
|
|
42
43
|
},
|
|
43
44
|
[Activity.Enums.ActivityIntensity.moderate]: {
|
|
44
|
-
backgroundColor:
|
|
45
|
+
backgroundColor: colors.activityOrange,
|
|
45
46
|
},
|
|
46
47
|
[Activity.Enums.ActivityIntensity.hard]: {
|
|
47
|
-
backgroundColor:
|
|
48
|
+
backgroundColor: colors.activityRed,
|
|
48
49
|
},
|
|
49
50
|
intensityContainer: {
|
|
50
51
|
flex: 5,
|
|
@@ -3,6 +3,7 @@ import { t } from "@lingui/macro";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Dimensions, StyleSheet, View } from "react-native";
|
|
5
5
|
import { i18n } from "../../locale/i18nUtils";
|
|
6
|
+
import { colors } from "../../utils/Constants";
|
|
6
7
|
import TextBold from "../text/TextBold";
|
|
7
8
|
import MoodIcon from "./MoodIcon";
|
|
8
9
|
const MoodEnum = Logbook.Enums.MoodEnum;
|
|
@@ -55,7 +56,7 @@ const emotionStyles = StyleSheet.create({
|
|
|
55
56
|
},
|
|
56
57
|
feelingText: {
|
|
57
58
|
textAlign: `center`,
|
|
58
|
-
color:
|
|
59
|
+
color: colors.white,
|
|
59
60
|
fontSize: Dimensions.get(`screen`).width / 26,
|
|
60
61
|
},
|
|
61
62
|
moodIconContainer: { flex: 1, flexDirection: `row`, justifyContent: `center` },
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
import { IInterval } from "../types/types";
|
|
2
|
-
/** Reusable color
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
/** Reusable color definitions. */
|
|
3
|
+
export declare const colors: {
|
|
4
|
+
blue: string;
|
|
5
|
+
darkBlue: string;
|
|
6
|
+
darkBlueX: string;
|
|
7
|
+
semiDarkBlue: string;
|
|
8
|
+
dustyBlue: string;
|
|
9
|
+
fadeBlue: string;
|
|
10
|
+
lightBlue: string;
|
|
11
|
+
mistBlue: string;
|
|
12
|
+
purple: string;
|
|
13
|
+
teal: string;
|
|
14
|
+
gradientMain: string[];
|
|
15
|
+
gradientPurple: string[];
|
|
16
|
+
white: string;
|
|
17
|
+
black: string;
|
|
18
|
+
transparentWhite: string;
|
|
19
|
+
transparentBlack: string;
|
|
20
|
+
transparentDarkBlue: string;
|
|
21
|
+
transparentLightBlue: string;
|
|
22
|
+
activityGreen: string;
|
|
23
|
+
activityOrange: string;
|
|
24
|
+
activityRed: string;
|
|
25
|
+
};
|
|
8
26
|
/** The threshold above which hyperglycemia is considered to be severe in mmol/L */
|
|
9
27
|
export declare const SEVERE_HYPERGLYCEMIA_START_MMOL = 15;
|
|
10
28
|
/** The number of seconds in four hours. */
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
import { BolusCalculator } from "@hedia/types";
|
|
2
|
-
/** Reusable color
|
|
3
|
-
export const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
/** Reusable color definitions. */
|
|
3
|
+
export const colors = {
|
|
4
|
+
blue: `#578aff`,
|
|
5
|
+
darkBlue: `#0F1231`,
|
|
6
|
+
darkBlueX: `#1B1F48`,
|
|
7
|
+
semiDarkBlue: `#1B1F48`,
|
|
8
|
+
dustyBlue: `#C5D0E7`,
|
|
9
|
+
fadeBlue: `#8388C8`,
|
|
10
|
+
lightBlue: `#C8CCFA`,
|
|
11
|
+
mistBlue: `#4A5B86`,
|
|
12
|
+
purple: `#a200ff`,
|
|
13
|
+
teal: `#01FFFC`,
|
|
14
|
+
gradientMain: [`#8B38F5`, `#D593E5`],
|
|
15
|
+
gradientPurple: [`#a200ff`, `#578aff`],
|
|
16
|
+
white: `#FFFFFF`,
|
|
17
|
+
black: `#000000`,
|
|
18
|
+
transparentWhite: `#FFFFFF00`,
|
|
19
|
+
transparentBlack: `#000000E6`,
|
|
20
|
+
transparentDarkBlue: `#0F123120`,
|
|
21
|
+
transparentLightBlue: `#578AFF1A`,
|
|
22
|
+
activityGreen: `#A5D871`,
|
|
23
|
+
activityOrange: `#F9BD5A`,
|
|
24
|
+
activityRed: `#EC5466`,
|
|
25
|
+
};
|
|
8
26
|
/** The threshold above which hyperglycemia is considered to be severe in mmol/L */
|
|
9
27
|
export const SEVERE_HYPERGLYCEMIA_START_MMOL = 15;
|
|
10
28
|
/** The number of seconds in four hours. */
|