@hedia/recommendation-screen 2.1.47 → 2.1.48-alpha.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.
- package/dist/src/RecommendationScreen.d.ts +8 -0
- package/dist/src/RecommendationScreen.js +42 -39
- package/dist/src/assets/fonts/Poppins-Bold.ttf +0 -0
- package/dist/src/assets/fonts/Poppins-SemiBold.ttf +0 -0
- package/dist/src/assets/icons/Edit.d.ts +4 -0
- package/dist/src/assets/icons/Edit.js +7 -0
- package/dist/src/assets/icons/Edit.tsx +22 -0
- package/dist/src/assets/icons/X.d.ts +4 -0
- package/dist/src/assets/icons/X.js +6 -0
- package/dist/src/assets/icons/X.tsx +14 -0
- package/dist/src/components/ForecastInfoBar.d.ts +117 -0
- package/dist/src/components/ForecastInfoBar.js +150 -0
- package/dist/src/components/Header.d.ts +3 -5
- package/dist/src/components/Header.js +38 -59
- package/dist/src/components/InfoBars.d.ts +3 -2
- package/dist/src/components/InfoBars.js +10 -8
- package/dist/src/components/RecentInsulin.d.ts +1 -1
- package/dist/src/components/RecentInsulin.js +34 -54
- package/dist/src/components/RecommendationModal.d.ts +1 -2
- package/dist/src/components/RecommendationModal.js +15 -10
- package/dist/src/components/RecommendedCarbs.js +21 -25
- package/dist/src/components/RecommendedInsulin.d.ts +2 -0
- package/dist/src/components/RecommendedInsulin.js +51 -41
- package/dist/src/components/Remeasure.js +4 -3
- package/dist/src/components/{TransferToLogbook.d.ts → SaveButton.d.ts} +1 -1
- package/dist/src/components/SaveButton.js +71 -0
- package/dist/src/components/TwoOptionModal.d.ts +1 -0
- package/dist/src/components/TwoOptionModal.js +10 -9
- package/dist/src/components/mood/Emotion.js +3 -1
- package/dist/src/components/mood/MoodIcon.js +3 -3
- package/dist/src/locale/da/messages.js +1 -1
- package/dist/src/locale/da/messages.po +81 -65
- package/dist/src/locale/de/messages.js +1 -1
- package/dist/src/locale/de/messages.po +81 -65
- package/dist/src/locale/en/messages.js +1 -1
- package/dist/src/locale/en/messages.po +81 -65
- package/dist/src/locale/es/messages.js +1 -1
- package/dist/src/locale/es/messages.po +81 -65
- package/dist/src/locale/fr/messages.js +1 -1
- package/dist/src/locale/fr/messages.po +81 -65
- package/dist/src/locale/it/messages.js +1 -1
- package/dist/src/locale/it/messages.po +81 -65
- package/dist/src/types/enum.d.ts +6 -3
- package/dist/src/types/enum.js +3 -0
- package/dist/src/utils/Constants.d.ts +12 -6
- package/dist/src/utils/Constants.js +12 -6
- package/package.json +5 -3
- package/dist/src/components/TransferToLogbook.js +0 -92
package/dist/src/types/enum.d.ts
CHANGED
|
@@ -57,17 +57,20 @@ export declare namespace Testing {
|
|
|
57
57
|
enum Value {
|
|
58
58
|
BloodKetone = "blood-ketone-value",
|
|
59
59
|
BloodGlucose = "blood-glucose-value",
|
|
60
|
-
ActiveInsulin = "active-insulin-value"
|
|
60
|
+
ActiveInsulin = "active-insulin-value",
|
|
61
|
+
ForecastedGlucose = "forecasted-glucose-value"
|
|
61
62
|
}
|
|
62
63
|
enum Label {
|
|
63
64
|
BloodKetone = "blood-ketone-label",
|
|
64
65
|
BloodGlucose = "blood-glucose-label",
|
|
65
|
-
ActiveInsulin = "active-insulin-label"
|
|
66
|
+
ActiveInsulin = "active-insulin-label",
|
|
67
|
+
ForecastedGlucose = "forecasted-glucose-label"
|
|
66
68
|
}
|
|
67
69
|
enum Unit {
|
|
68
70
|
BloodKetone = "blood-ketone-unit",
|
|
69
71
|
BloodGlucose = "blood-glucose-unit",
|
|
70
|
-
ActiveInsulin = "active-insulin-unit"
|
|
72
|
+
ActiveInsulin = "active-insulin-unit",
|
|
73
|
+
ForecastedGlucose = "forecasted-glucose-unit"
|
|
71
74
|
}
|
|
72
75
|
}
|
|
73
76
|
}
|
package/dist/src/types/enum.js
CHANGED
|
@@ -73,18 +73,21 @@ export var Testing;
|
|
|
73
73
|
Value["BloodKetone"] = "blood-ketone-value";
|
|
74
74
|
Value["BloodGlucose"] = "blood-glucose-value";
|
|
75
75
|
Value["ActiveInsulin"] = "active-insulin-value";
|
|
76
|
+
Value["ForecastedGlucose"] = "forecasted-glucose-value";
|
|
76
77
|
})(Value = InfoBarTestIds.Value || (InfoBarTestIds.Value = {}));
|
|
77
78
|
let Label;
|
|
78
79
|
(function (Label) {
|
|
79
80
|
Label["BloodKetone"] = "blood-ketone-label";
|
|
80
81
|
Label["BloodGlucose"] = "blood-glucose-label";
|
|
81
82
|
Label["ActiveInsulin"] = "active-insulin-label";
|
|
83
|
+
Label["ForecastedGlucose"] = "forecasted-glucose-label";
|
|
82
84
|
})(Label = InfoBarTestIds.Label || (InfoBarTestIds.Label = {}));
|
|
83
85
|
let Unit;
|
|
84
86
|
(function (Unit) {
|
|
85
87
|
Unit["BloodKetone"] = "blood-ketone-unit";
|
|
86
88
|
Unit["BloodGlucose"] = "blood-glucose-unit";
|
|
87
89
|
Unit["ActiveInsulin"] = "active-insulin-unit";
|
|
90
|
+
Unit["ForecastedGlucose"] = "forecasted-glucose-unit";
|
|
88
91
|
})(Unit = InfoBarTestIds.Unit || (InfoBarTestIds.Unit = {}));
|
|
89
92
|
})(InfoBarTestIds = Id.InfoBarTestIds || (Id.InfoBarTestIds = {}));
|
|
90
93
|
})(Id = Testing.Id || (Testing.Id = {}));
|
|
@@ -1,10 +1,16 @@
|
|
|
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
|
+
dustyBlue: string;
|
|
7
|
+
fadeBlue: string;
|
|
8
|
+
lightBlue: string;
|
|
9
|
+
mistBlue: string;
|
|
10
|
+
purple: string;
|
|
11
|
+
semiDarkBlue: string;
|
|
12
|
+
teal: string;
|
|
13
|
+
};
|
|
8
14
|
/** The threshold above which hyperglycemia is considered to be severe in mmol/L */
|
|
9
15
|
export declare const SEVERE_HYPERGLYCEMIA_START_MMOL = 15;
|
|
10
16
|
/** The number of seconds in four hours. */
|
|
@@ -1,10 +1,16 @@
|
|
|
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
|
+
dustyBlue: `#C5D0E7`,
|
|
7
|
+
fadeBlue: `#8388C8`,
|
|
8
|
+
lightBlue: `#C8CCFA`,
|
|
9
|
+
mistBlue: `#4A5B86`,
|
|
10
|
+
purple: `#a200ff`,
|
|
11
|
+
semiDarkBlue: `#1B1F48`,
|
|
12
|
+
teal: `#01FFFC`,
|
|
13
|
+
};
|
|
8
14
|
/** The threshold above which hyperglycemia is considered to be severe in mmol/L */
|
|
9
15
|
export const SEVERE_HYPERGLYCEMIA_START_MMOL = 15;
|
|
10
16
|
/** The number of seconds in four hours. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hedia/recommendation-screen",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.48-alpha.1",
|
|
4
4
|
"description": "Hedia Recommendation Screen for Bolus and Carbohydrates",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"react-native": "0.67.3",
|
|
73
73
|
"react-native-keyboard-aware-scroll-view": "0.9.5",
|
|
74
74
|
"react-native-linear-gradient": "2.5.6",
|
|
75
|
+
"react-native-svg": "12.4.4",
|
|
75
76
|
"react-native-testing-library": "2.1.0",
|
|
76
77
|
"react-native-vector-icons": "9.1.0",
|
|
77
78
|
"react-test-renderer": "17.0.2",
|
|
@@ -88,13 +89,14 @@
|
|
|
88
89
|
"@lingui/macro": "2.9.2",
|
|
89
90
|
"@lingui/react": "2.9.2",
|
|
90
91
|
"moment": "2.29.4",
|
|
91
|
-
"react-native-modal": "13.0.
|
|
92
|
+
"react-native-modal": "13.0.1"
|
|
92
93
|
},
|
|
93
94
|
"peerDependencies": {
|
|
94
95
|
"@hedia/recommendation-calculator": "2.0.15",
|
|
95
96
|
"@lingui/macro": "2.9.2",
|
|
96
97
|
"@react-native-community/slider": "3.0.0",
|
|
97
98
|
"react-native-linear-gradient": "2.5.6",
|
|
98
|
-
"react-native-
|
|
99
|
+
"react-native-svg": "12.4.4",
|
|
100
|
+
"react-native-vector-icons": "9.2.0"
|
|
99
101
|
}
|
|
100
102
|
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Dimensions, StyleSheet, TouchableOpacity, View } from "react-native";
|
|
3
|
-
import { t } from "@lingui/macro";
|
|
4
|
-
import { i18n } from "../locale/i18nUtils";
|
|
5
|
-
import { Testing } from "../types/enum";
|
|
6
|
-
import Icon from "./Icon";
|
|
7
|
-
import TextBold from "./text/TextBold";
|
|
8
|
-
/**
|
|
9
|
-
* Render a button for transferring the recommendation to a logbook entry.
|
|
10
|
-
* The button has a visually distinct pressed state to signal to the user that the button was actually activated before returning to the dashboard screen.
|
|
11
|
-
*/
|
|
12
|
-
export default class TransferToLogbook extends React.Component {
|
|
13
|
-
/** Initialise the state pressed variable with false */
|
|
14
|
-
state = {
|
|
15
|
-
pressed: false,
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Handle what happens when the button is pressed.
|
|
19
|
-
*
|
|
20
|
-
* Steps:
|
|
21
|
-
* 1. Toggle the pressed state to the opposite of its current value.
|
|
22
|
-
* 2. Call the transfer prop callback function.
|
|
23
|
-
*/
|
|
24
|
-
handlePress = () => {
|
|
25
|
-
this.setState({
|
|
26
|
-
pressed: !this.state.pressed,
|
|
27
|
-
});
|
|
28
|
-
this.props.transfer();
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Steps:
|
|
32
|
-
* 1. If the visible prop is false, display an empty space to keep the correct margins in the screen.
|
|
33
|
-
* 2. Return a JSX element to display a touchable button (that is disabled when the pressed state is true)
|
|
34
|
-
* @returns JSX element for displaying the transfer button
|
|
35
|
-
*/
|
|
36
|
-
render() {
|
|
37
|
-
if (!this.props.visible) {
|
|
38
|
-
return <View style={addToLogbookStyles.marginContainer}/>;
|
|
39
|
-
}
|
|
40
|
-
return (<TouchableOpacity testID={Testing.Id.TransferToLogbookTestIds.TransferButton} onPress={this.handlePress} disabled={this.state.pressed} style={addToLogbookStyles.container}>
|
|
41
|
-
{!this.state.pressed ? (<View style={addToLogbookStyles.textContainer}>
|
|
42
|
-
<TextBold style={addToLogbookStyles.transferText}>{i18n._(t `Transfer to logbook`)}</TextBold>
|
|
43
|
-
</View>) : (<View style={addToLogbookStyles.textContainerActive}>
|
|
44
|
-
<Icon style={addToLogbookStyles.icon} iconIdentifier={`Feather/check`}/>
|
|
45
|
-
<TextBold style={addToLogbookStyles.transferTextActive}>
|
|
46
|
-
{i18n._(t `Transferred to logbook`)}
|
|
47
|
-
</TextBold>
|
|
48
|
-
</View>)}
|
|
49
|
-
</TouchableOpacity>);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
const addToLogbookStyles = StyleSheet.create({
|
|
53
|
-
marginContainer: {
|
|
54
|
-
marginVertical: `3%`,
|
|
55
|
-
},
|
|
56
|
-
container: {
|
|
57
|
-
flex: 1,
|
|
58
|
-
margin: `5%`,
|
|
59
|
-
},
|
|
60
|
-
textContainer: {
|
|
61
|
-
flexDirection: `row`,
|
|
62
|
-
justifyContent: `center`,
|
|
63
|
-
borderWidth: 1,
|
|
64
|
-
borderRadius: 100,
|
|
65
|
-
marginHorizontal: `4%`,
|
|
66
|
-
paddingVertical: `4%`,
|
|
67
|
-
borderColor: `#01FFFC`,
|
|
68
|
-
},
|
|
69
|
-
transferText: {
|
|
70
|
-
color: `#01FFFC`,
|
|
71
|
-
fontSize: Dimensions.get(`screen`).width / 22,
|
|
72
|
-
},
|
|
73
|
-
textContainerActive: {
|
|
74
|
-
flexDirection: `row`,
|
|
75
|
-
backgroundColor: `#01FFFC`,
|
|
76
|
-
justifyContent: `center`,
|
|
77
|
-
borderWidth: 1,
|
|
78
|
-
borderRadius: 100,
|
|
79
|
-
marginHorizontal: `4%`,
|
|
80
|
-
paddingVertical: `4%`,
|
|
81
|
-
},
|
|
82
|
-
icon: {
|
|
83
|
-
paddingTop: `1.3%`,
|
|
84
|
-
color: `#1B1F48`,
|
|
85
|
-
fontSize: Dimensions.get(`screen`).width / 22,
|
|
86
|
-
marginRight: `1%`,
|
|
87
|
-
},
|
|
88
|
-
transferTextActive: {
|
|
89
|
-
color: `#1B1F48`,
|
|
90
|
-
fontSize: Dimensions.get(`screen`).width / 22,
|
|
91
|
-
},
|
|
92
|
-
});
|