@hedia/recommendation-screen 2.1.57 → 2.1.58-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 +3 -3
- package/dist/src/assets/IconsSVG/Close.js +1 -1
- package/dist/src/assets/IconsSVG/CloseOutlined.d.ts +4 -0
- package/dist/src/assets/IconsSVG/CloseOutlined.js +8 -0
- package/dist/src/components/InfoBars.d.ts +1 -1
- package/dist/src/components/InfoBars.js +4 -4
- package/dist/src/components/RecommendationModal.d.ts +0 -16
- package/dist/src/components/RecommendedCarbs.js +7 -7
- package/dist/src/components/RecommendedInsulin.js +1 -0
- package/dist/src/components/Remeasure.js +3 -2
- package/dist/src/components/activity/Activity.js +17 -5
- package/dist/src/components/styles/fonts.d.ts +5 -0
- package/dist/src/components/styles/fonts.js +5 -0
- package/package.json +1 -1
|
@@ -462,6 +462,7 @@ export default class RecommendationScreen extends React.Component {
|
|
|
462
462
|
const { ActiveInsulin: ActiveInsulinUnitTestID, BloodGlucose: BGUnitTestID, BloodKetone: BKUnitTestID, } = InfoBarTestIds.Unit;
|
|
463
463
|
const carbRecommendation = carbRecommendationProp !== null ? Math.round(carbRecommendationProp) : null;
|
|
464
464
|
const recommendedCarbs = enteredCarbs ?? carbRecommendation;
|
|
465
|
+
const borderColor = recommendedCarbs !== null ? colors.teal : colors.dustyDarkBlue;
|
|
465
466
|
const { calculatorParams, bloodGlucoseUnit, currentBKL, bloodKetoneUnit } = this.props;
|
|
466
467
|
const { currentBGL, carbohydrates: providedCarbs } = calculatorParams;
|
|
467
468
|
const displayedBGL = currentBGL ? Utils.displayedBGLValue(currentBGL, bloodGlucoseUnit) : null;
|
|
@@ -476,7 +477,7 @@ export default class RecommendationScreen extends React.Component {
|
|
|
476
477
|
<InfoBars label={i18n._(t `Active Insulin`)} value={activeInsulin ? `${activeInsulin.toFixed(1)}` : null} unit={i18n._(t `units`)} showNullAsDash={false} testID={{ unitID: ActiveInsulinUnitTestID, valueID: ActiveInsulinValueTestID }}/>
|
|
477
478
|
<InfoBars label={i18n._(t `Blood Glucose Level`)} value={displayedBGL} unit={this.props.bloodGlucoseUnit} showNullAsDash={true} testID={{ unitID: BGUnitTestID, valueID: BGValueTestID }}/>
|
|
478
479
|
<InfoBars label={i18n._(t `Blood Ketone Level`)} value={displayedBKL} unit={this.props.bloodKetoneUnit} showNullAsDash={true} testID={{ unitID: BKUnitTestID, valueID: BKValueTestID }}/>
|
|
479
|
-
<View style={styles.
|
|
480
|
+
<View style={[styles.carbsBorder, { borderColor }]}>
|
|
480
481
|
<RecommendedCarbs enteredCarbs={`${providedCarbs}`} changedRecommendedCarbs={this.updateCarbRecommendation} recommendedCarbs={`${recommendedCarbs}`} removeRecommendedCarbs={this.removeCarbRecommendation}/>
|
|
481
482
|
</View>
|
|
482
483
|
{this.props.calculatorParams.activity && this.props.activityDisplayProps && (<Activity activity={this.props.calculatorParams.activity} activityType={this.props.activityDisplayProps.activityType} activityTitle={this.props.activityDisplayProps.activityTitle} activityReduction={this.state.activityReduction}/>)}
|
|
@@ -504,9 +505,8 @@ const styles = StyleSheet.create({
|
|
|
504
505
|
justifyContent: `center`,
|
|
505
506
|
backgroundColor: colors.transparentBlack,
|
|
506
507
|
},
|
|
507
|
-
|
|
508
|
+
carbsBorder: {
|
|
508
509
|
borderWidth: 1,
|
|
509
|
-
borderColor: colors.dustyDarkBlue,
|
|
510
510
|
borderRadius: 5,
|
|
511
511
|
padding: 16,
|
|
512
512
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Path, Svg } from "react-native-svg";
|
|
3
|
-
const Close = (props) => (<Svg viewBox="0 0 28 28"
|
|
3
|
+
const Close = (props) => (<Svg viewBox="0 0 28 28" {...props}>
|
|
4
4
|
<Path d="M4.4753 23.4372C5.10827 24.0746 6.20854 24.0519 6.82281 23.4477L14.0546 16.2888L21.2957 23.4425C21.9208 24.0599 22.9955 24.072 23.6285 23.4346C24.2858 22.7973 24.2736 21.7355 23.6364 21.1181L16.4101 13.9618L23.6364 6.8228C24.2736 6.20277 24.2858 5.129 23.6285 4.50632C22.9955 3.86898 21.9208 3.88101 21.2957 4.49576L14.0546 11.6468L6.82281 4.49312C6.20854 3.88628 5.10827 3.86634 4.4753 4.50104C3.83282 5.12636 3.85301 6.21333 4.46728 6.82016L11.7139 13.9618L4.46728 21.1207C3.85301 21.7275 3.83282 22.7999 4.4753 23.4372Z" fill={props.color}/>
|
|
5
5
|
</Svg>);
|
|
6
6
|
export default Close;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Path, Svg } from "react-native-svg";
|
|
3
|
+
import { colors } from "../../utils/Constants";
|
|
4
|
+
const CloseOutlined = (props) => (<Svg viewBox="0 0 16 16" {...props}>
|
|
5
|
+
<Path fillRule="evenodd" clipRule="evenodd" d="M8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0ZM8.00003 14.9091C4.18425 14.9091 1.09094 11.8158 1.09094 8.00005C1.09094 4.18427 4.18425 1.09096 8.00003 1.09096C11.8158 1.09096 14.9091 4.18427 14.9091 8.00005C14.9091 9.83246 14.1812 11.5898 12.8855 12.8855C11.5898 14.1812 9.83244 14.9091 8.00003 14.9091Z" fill={colors.teal}/>
|
|
6
|
+
<Path fillRule="evenodd" clipRule="evenodd" d="M10.8261 4.99334C10.6131 4.78065 10.2681 4.78065 10.0552 4.99334L7.98608 7.14607L5.73517 4.96425C5.59618 4.82218 5.39091 4.76696 5.1994 4.82011C5.00789 4.87326 4.86045 5.02638 4.81456 5.21976C4.76867 5.41314 4.83159 5.61618 4.97881 5.74971L7.21517 7.90243L4.97881 10.0552C4.83159 10.1887 4.76867 10.3917 4.81456 10.5851C4.86045 10.7785 5.00789 10.9316 5.1994 10.9848C5.39091 11.0379 5.59618 10.9827 5.73517 10.8406L7.98608 8.6588L10.0552 10.8115C10.1887 10.9587 10.3917 11.0217 10.5851 10.9758C10.7785 10.9299 10.9316 10.7824 10.9848 10.5909C11.0379 10.3994 10.9827 10.1942 10.8406 10.0552L8.75699 7.87334L10.8406 5.69153C11.0049 5.48579 10.9988 5.19206 10.8261 4.99334Z" fill={colors.teal}/>
|
|
7
|
+
</Svg>);
|
|
8
|
+
export default CloseOutlined;
|
|
@@ -81,16 +81,16 @@ export const infoStyles = StyleSheet.create({
|
|
|
81
81
|
valueUnitContainer: {
|
|
82
82
|
flex: 6.5,
|
|
83
83
|
justifyContent: `flex-end`,
|
|
84
|
-
alignItems: `
|
|
84
|
+
alignItems: `baseline`,
|
|
85
85
|
flexDirection: `row`,
|
|
86
86
|
},
|
|
87
87
|
value: {
|
|
88
|
-
...FONTS.Poppins.
|
|
89
|
-
color: colors.
|
|
88
|
+
...FONTS.Poppins.medium_2XL,
|
|
89
|
+
color: colors.white,
|
|
90
90
|
},
|
|
91
91
|
units: {
|
|
92
92
|
...FONTS.Poppins.regular_XS,
|
|
93
|
-
color: colors.
|
|
93
|
+
color: colors.white,
|
|
94
94
|
paddingLeft: 4,
|
|
95
95
|
},
|
|
96
96
|
});
|
|
@@ -109,10 +109,6 @@ export declare const stylesModal: {
|
|
|
109
109
|
marginTop: number;
|
|
110
110
|
fontFamily: import("./styles/fonts").FontFamily;
|
|
111
111
|
fontSize: number;
|
|
112
|
-
/**
|
|
113
|
-
* Callback function taking no arguments and returning no value.
|
|
114
|
-
* Should be called if the user taps the “accept” button when they are recommended to eat additional carbohydrates.
|
|
115
|
-
*/
|
|
116
112
|
lineHeight: number;
|
|
117
113
|
};
|
|
118
114
|
buttonText: {
|
|
@@ -144,10 +140,6 @@ export declare const stylesModal: {
|
|
|
144
140
|
paddingHorizontal: number;
|
|
145
141
|
fontFamily: import("./styles/fonts").FontFamily;
|
|
146
142
|
fontSize: number;
|
|
147
|
-
/**
|
|
148
|
-
* Callback function taking no arguments and returning no value.
|
|
149
|
-
* Should be called if the user taps the “accept” button when they are recommended to eat additional carbohydrates.
|
|
150
|
-
*/
|
|
151
143
|
lineHeight: number;
|
|
152
144
|
};
|
|
153
145
|
recommendEatingText: {
|
|
@@ -157,10 +149,6 @@ export declare const stylesModal: {
|
|
|
157
149
|
marginBottom: number;
|
|
158
150
|
fontFamily: import("./styles/fonts").FontFamily;
|
|
159
151
|
fontSize: number;
|
|
160
|
-
/**
|
|
161
|
-
* Callback function taking no arguments and returning no value.
|
|
162
|
-
* Should be called if the user taps the “accept” button when they are recommended to eat additional carbohydrates.
|
|
163
|
-
*/
|
|
164
152
|
lineHeight: number;
|
|
165
153
|
};
|
|
166
154
|
carbohydrateText: {
|
|
@@ -176,10 +164,6 @@ export declare const stylesModal: {
|
|
|
176
164
|
marginHorizontal: number;
|
|
177
165
|
fontFamily: import("./styles/fonts").FontFamily;
|
|
178
166
|
fontSize: number;
|
|
179
|
-
/**
|
|
180
|
-
* Callback function taking no arguments and returning no value.
|
|
181
|
-
* Should be called if the user taps the “accept” button when they are recommended to eat additional carbohydrates.
|
|
182
|
-
*/
|
|
183
167
|
lineHeight: number;
|
|
184
168
|
};
|
|
185
169
|
recommendationButtonsContainer: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t } from "@lingui/macro";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Alert, StyleSheet, TouchableOpacity, View } from "react-native";
|
|
4
|
-
import
|
|
4
|
+
import CloseOutlined from "../assets/IconsSVG/CloseOutlined";
|
|
5
5
|
import Edit from "../assets/IconsSVG/Edit";
|
|
6
6
|
import { i18n } from "../locale/i18nUtils";
|
|
7
7
|
import { Testing } from "../types/enum";
|
|
@@ -94,14 +94,14 @@ export default class RecommendedCarbs extends React.Component {
|
|
|
94
94
|
<View style={[style.container, { marginBottom: 4 }]}>
|
|
95
95
|
<View style={style.recommendedContainer}>
|
|
96
96
|
<TouchableOpacity testID={RecommendedCarbsTestIds.RemoveRecommendation} style={style.removeRecommended} onPress={this.props.removeRecommendedCarbs}>
|
|
97
|
-
{
|
|
97
|
+
{CloseOutlined({ style: style.removeRecommendedIcon })}
|
|
98
98
|
</TouchableOpacity>
|
|
99
99
|
<Text style={style.recommendedLabel}>{i18n._(t `Recommended`)}</Text>
|
|
100
100
|
</View>
|
|
101
101
|
</View>
|
|
102
102
|
<View style={style.container}>
|
|
103
103
|
<View style={style.recommendedContainer}>
|
|
104
|
-
<Text style={{ ...style.recommendedLabel, color: colors.
|
|
104
|
+
<Text style={{ ...style.recommendedLabel, color: colors.teal }}>{i18n._(t `Additional`)}</Text>
|
|
105
105
|
</View>
|
|
106
106
|
<View style={style.valueUnitContainer}>
|
|
107
107
|
<TouchableOpacity testID={RecommendedCarbsTestIds.EditRecommendedCarbs} onPress={this.showTextInput} style={[style.valueUnitContainer]}>
|
|
@@ -193,17 +193,17 @@ const style = StyleSheet.create({
|
|
|
193
193
|
valueUnitContainer: {
|
|
194
194
|
flex: 6.5,
|
|
195
195
|
justifyContent: `flex-end`,
|
|
196
|
-
alignItems: `
|
|
196
|
+
alignItems: `baseline`,
|
|
197
197
|
flexDirection: `row`,
|
|
198
198
|
},
|
|
199
199
|
value: {
|
|
200
|
-
...FONTS.Poppins.
|
|
201
|
-
color: colors.
|
|
200
|
+
...FONTS.Poppins.medium_2XL,
|
|
201
|
+
color: colors.white,
|
|
202
202
|
textAlign: `right`,
|
|
203
203
|
},
|
|
204
204
|
units: {
|
|
205
205
|
...FONTS.Poppins.regular_XS,
|
|
206
|
-
color: colors.
|
|
206
|
+
color: colors.white,
|
|
207
207
|
textAlign: `left`,
|
|
208
208
|
paddingLeft: 4,
|
|
209
209
|
},
|
|
@@ -83,6 +83,7 @@ const styles = StyleSheet.create({
|
|
|
83
83
|
textContainer: {
|
|
84
84
|
flexDirection: `row`,
|
|
85
85
|
marginBottom: 18,
|
|
86
|
+
alignItems: `baseline`,
|
|
86
87
|
},
|
|
87
88
|
remeasureLabel: {
|
|
88
89
|
...FONTS.Poppins.regular_Base,
|
|
@@ -92,11 +93,11 @@ const styles = StyleSheet.create({
|
|
|
92
93
|
valueUnitContainer: {
|
|
93
94
|
flex: 3,
|
|
94
95
|
justifyContent: `flex-end`,
|
|
95
|
-
alignItems: `
|
|
96
|
+
alignItems: `baseline`,
|
|
96
97
|
flexDirection: `row`,
|
|
97
98
|
},
|
|
98
99
|
value: {
|
|
99
|
-
...FONTS.Poppins.
|
|
100
|
+
...FONTS.Poppins.medium_2XL,
|
|
100
101
|
textAlign: `right`,
|
|
101
102
|
color: colors.white,
|
|
102
103
|
},
|
|
@@ -44,9 +44,12 @@ export default class Activity extends React.Component {
|
|
|
44
44
|
<Text style={styles.infoText}>
|
|
45
45
|
{i18n._(t `Based on the selected activity your insulin recommendation is reduced by:`)}
|
|
46
46
|
</Text>
|
|
47
|
-
<
|
|
48
|
-
{reductionPercentage}
|
|
49
|
-
|
|
47
|
+
<View style={styles.reductionContainer}>
|
|
48
|
+
<Text style={styles.reductionPercentage} testID={Testing.Id.ActivityTestIds.ActivityReduction}>
|
|
49
|
+
{reductionPercentage}
|
|
50
|
+
</Text>
|
|
51
|
+
<Text style={styles.percentage}>{`%`}</Text>
|
|
52
|
+
</View>
|
|
50
53
|
</View>);
|
|
51
54
|
}
|
|
52
55
|
}
|
|
@@ -69,9 +72,18 @@ const styles = StyleSheet.create({
|
|
|
69
72
|
color: colors.lightBlue,
|
|
70
73
|
marginBottom: 4,
|
|
71
74
|
},
|
|
75
|
+
reductionContainer: {
|
|
76
|
+
flexDirection: `row`,
|
|
77
|
+
alignItems: `baseline`,
|
|
78
|
+
},
|
|
72
79
|
reductionPercentage: {
|
|
73
|
-
...FONTS.Poppins.
|
|
74
|
-
color: colors.
|
|
80
|
+
...FONTS.Poppins.medium_2XL,
|
|
81
|
+
color: colors.white,
|
|
82
|
+
},
|
|
83
|
+
percentage: {
|
|
84
|
+
...FONTS.Poppins.regular_XS,
|
|
85
|
+
color: colors.white,
|
|
86
|
+
marginLeft: 4,
|
|
75
87
|
},
|
|
76
88
|
label: {
|
|
77
89
|
...FONTS.Poppins.regular_Base,
|