@hedia/recommendation-screen 2.1.3-beta.6 → 2.1.3-beta.7
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/coverage/clover.xml +2 -2
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/src/RecommendationScreen.tsx.html +1 -1
- package/coverage/lcov-report/src/__tests__/index.html +1 -1
- package/coverage/lcov-report/src/__tests__/utils.tsx.html +1 -1
- package/coverage/lcov-report/src/components/Header.tsx.html +1 -1
- package/coverage/lcov-report/src/components/InfoBars.tsx.html +1 -1
- package/coverage/lcov-report/src/components/InvisibleNumberInput.tsx.html +1 -1
- package/coverage/lcov-report/src/components/LimitationMessage.tsx.html +1 -1
- package/coverage/lcov-report/src/components/LineSeparator.tsx.html +1 -1
- package/coverage/lcov-report/src/components/RecentInsulin.tsx.html +1 -1
- package/coverage/lcov-report/src/components/RecommendationModal.tsx.html +1 -1
- package/coverage/lcov-report/src/components/RecommendedCarbs.tsx.html +1 -1
- package/coverage/lcov-report/src/components/RecommendedInsulin.tsx.html +1 -1
- package/coverage/lcov-report/src/components/Remeasure.tsx.html +1 -1
- package/coverage/lcov-report/src/components/TransferToLogbook.tsx.html +1 -1
- package/coverage/lcov-report/src/components/TwoOptionModal.tsx.html +1 -1
- package/coverage/lcov-report/src/components/activity/Activity.tsx.html +1 -1
- package/coverage/lcov-report/src/components/activity/ActivityIcon.tsx.html +1 -1
- package/coverage/lcov-report/src/components/activity/ActivityIntensity.tsx.html +1 -1
- package/coverage/lcov-report/src/components/activity/index.html +1 -1
- package/coverage/lcov-report/src/components/index.html +1 -1
- package/coverage/lcov-report/src/components/mood/Emotion.tsx.html +1 -1
- package/coverage/lcov-report/src/components/mood/MoodIcon.tsx.html +1 -1
- package/coverage/lcov-report/src/components/mood/index.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/locale/i18nUtils.ts.html +1 -1
- package/coverage/lcov-report/src/locale/index.html +1 -1
- package/coverage/lcov-report/src/utils/AttentionMessages.tsx.html +1 -1
- package/coverage/lcov-report/src/utils/Constants.ts.html +1 -1
- package/coverage/lcov-report/src/utils/RecommendationError.tsx.html +1 -1
- package/coverage/lcov-report/src/utils/RecommendationUtils.ts.html +1 -1
- package/coverage/lcov-report/src/utils/Translations.ts.html +1 -1
- package/coverage/lcov-report/src/utils/Utils.ts.html +1 -1
- package/coverage/lcov-report/src/utils/Validations.ts.html +1 -1
- package/coverage/lcov-report/src/utils/index.html +1 -1
- package/index.js +5 -31
- package/package.json +2 -1
- package/src/RecommendationScreen.js +76 -101
- package/src/__tests__/RecommendationScreen.test.js +404 -409
- package/src/__tests__/RecommendationUtils.test.js +117 -119
- package/src/__tests__/Translate.test.js +14 -16
- package/src/__tests__/Utils.test.js +16 -18
- package/src/__tests__/Validations.test.js +30 -51
- package/src/__tests__/components/Activity.test.js +51 -56
- package/src/__tests__/components/Emotion.test.js +28 -33
- package/src/__tests__/components/Header.test.js +24 -29
- package/src/__tests__/components/InfoBars.test.js +59 -64
- package/src/__tests__/components/InvisibleNumberInput.test.js +22 -27
- package/src/__tests__/components/LimitationMessage.test.js +28 -33
- package/src/__tests__/components/MoodIcon.test.js +9 -14
- package/src/__tests__/components/RecommendationModal.test.js +56 -61
- package/src/__tests__/components/RecommendedCarbs.test.js +58 -63
- package/src/__tests__/components/RecommendedInsulin.test.js +60 -65
- package/src/__tests__/components/Remeasure.test.js +32 -37
- package/src/__tests__/components/TransferToLogbook.test.js +15 -20
- package/src/__tests__/components/TwoOptionModal.test.js +22 -27
- package/src/__tests__/utils.js +22 -38
- package/src/components/Header.js +34 -41
- package/src/components/Icon.js +2 -8
- package/src/components/InfoBars.js +36 -43
- package/src/components/InvisibleNumberInput.js +5 -11
- package/src/components/LimitationMessage.js +18 -40
- package/src/components/LineSeparator.js +7 -13
- package/src/components/RecentInsulin.js +33 -39
- package/src/components/RecommendationModal.js +59 -85
- package/src/components/RecommendedCarbs.js +93 -99
- package/src/components/RecommendedInsulin.js +46 -52
- package/src/components/Remeasure.js +36 -42
- package/src/components/TransferToLogbook.js +20 -26
- package/src/components/TwoOptionModal.js +39 -65
- package/src/components/activity/Activity.js +42 -48
- package/src/components/activity/ActivityIcon.js +15 -21
- package/src/components/activity/ActivityIntensity.js +19 -25
- package/src/components/mood/Emotion.js +17 -23
- package/src/components/mood/MoodIcon.js +11 -17
- package/src/locale/i18nUtils.js +17 -24
- package/src/types/enum.js +28 -31
- package/src/types/types.js +1 -2
- package/src/utils/AttentionMessages.js +24 -32
- package/src/utils/Constants.js +23 -26
- package/src/utils/RecommendationError.js +28 -54
- package/src/utils/RecommendationUtils.js +60 -72
- package/src/utils/Translations.js +6 -9
- package/src/utils/Utils.js +8 -12
- package/src/utils/Validations.js +77 -107
- package/tsconfig.json +3 -3
package/src/components/Header.js
CHANGED
|
@@ -1,45 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const react_native_1 = require("react-native");
|
|
10
|
-
const i18nUtils_1 = require("../locale/i18nUtils");
|
|
11
|
-
const enum_1 = require("../types/enum");
|
|
12
|
-
const Constants_1 = require("../utils/Constants");
|
|
13
|
-
const Icon_1 = __importDefault(require("./Icon"));
|
|
14
|
-
class Header extends react_1.default.Component {
|
|
1
|
+
import { t } from "@lingui/macro";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Dimensions, SafeAreaView, StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
4
|
+
import { i18n } from "../locale/i18nUtils";
|
|
5
|
+
import { HeaderTestIds } from "../types/enum";
|
|
6
|
+
import { BACKGROUND_COLOUR_PURPLE, BORDER_COLOUR_GREY } from "../utils/Constants";
|
|
7
|
+
import Icon from "./Icon";
|
|
8
|
+
export default class Header extends React.Component {
|
|
15
9
|
render() {
|
|
16
|
-
return (<
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
</
|
|
25
|
-
<
|
|
26
|
-
</
|
|
27
|
-
</
|
|
28
|
-
<
|
|
29
|
-
<
|
|
30
|
-
{
|
|
31
|
-
</
|
|
32
|
-
</
|
|
33
|
-
<
|
|
34
|
-
</
|
|
35
|
-
</
|
|
36
|
-
</
|
|
10
|
+
return (<React.Fragment>
|
|
11
|
+
<SafeAreaView style={headerStyles.backgroundColour}/>
|
|
12
|
+
<View style={headerStyles.headerContainer}>
|
|
13
|
+
<View style={headerStyles.margin}>
|
|
14
|
+
<View style={headerStyles.exitButtonContainer}>
|
|
15
|
+
<View style={headerStyles.exitButton}>
|
|
16
|
+
<TouchableOpacity testID={HeaderTestIds.ExitCalculation} accessibilityLabel="exitButton" style={headerStyles.exitButton} onPress={this.props.exitCallback}>
|
|
17
|
+
<Icon iconIdentifier={`Ionicons/ios-close-circle-outline`} style={headerStyles.iconStyle}/>
|
|
18
|
+
</TouchableOpacity>
|
|
19
|
+
<View style={headerStyles.headerFiller}/>
|
|
20
|
+
</View>
|
|
21
|
+
</View>
|
|
22
|
+
<View style={headerStyles.headerTextContainer}>
|
|
23
|
+
<Text style={headerStyles.headerText} testID="headerText">
|
|
24
|
+
{i18n._(t `INSULIN${`\n`}RECOMMENDATION`)}
|
|
25
|
+
</Text>
|
|
26
|
+
</View>
|
|
27
|
+
<View style={headerStyles.headerFiller}/>
|
|
28
|
+
</View>
|
|
29
|
+
</View>
|
|
30
|
+
</React.Fragment>);
|
|
37
31
|
}
|
|
38
32
|
}
|
|
39
|
-
|
|
40
|
-
exports.headerStyles = react_native_1.StyleSheet.create({
|
|
33
|
+
export const headerStyles = StyleSheet.create({
|
|
41
34
|
backgroundColour: {
|
|
42
|
-
backgroundColor:
|
|
35
|
+
backgroundColor: BACKGROUND_COLOUR_PURPLE,
|
|
43
36
|
},
|
|
44
37
|
margin: {
|
|
45
38
|
margin: `1%`,
|
|
@@ -59,8 +52,8 @@ exports.headerStyles = react_native_1.StyleSheet.create({
|
|
|
59
52
|
flex: 1,
|
|
60
53
|
},
|
|
61
54
|
iconStyle: {
|
|
62
|
-
fontSize:
|
|
63
|
-
color:
|
|
55
|
+
fontSize: Dimensions.get(`screen`).width / 12,
|
|
56
|
+
color: BORDER_COLOUR_GREY,
|
|
64
57
|
},
|
|
65
58
|
headerTextContainer: {
|
|
66
59
|
flex: 6,
|
|
@@ -69,7 +62,7 @@ exports.headerStyles = react_native_1.StyleSheet.create({
|
|
|
69
62
|
marginTop: `5%`,
|
|
70
63
|
},
|
|
71
64
|
headerText: {
|
|
72
|
-
fontSize:
|
|
65
|
+
fontSize: Dimensions.get(`screen`).width / 18,
|
|
73
66
|
fontWeight: `bold`,
|
|
74
67
|
textAlign: `center`,
|
|
75
68
|
color: `white`,
|
package/src/components/Icon.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
1
|
// @ts-nocheck
|
|
7
2
|
/* tslint:disable */
|
|
8
|
-
|
|
3
|
+
import React from "react";
|
|
9
4
|
const IconSets = {
|
|
10
5
|
AntDesign: require(`react-native-vector-icons/AntDesign`),
|
|
11
6
|
Feather: require(`react-native-vector-icons/Feather`),
|
|
@@ -14,7 +9,7 @@ const IconSets = {
|
|
|
14
9
|
FontAwesome: require(`react-native-vector-icons/FontAwesome`),
|
|
15
10
|
Entypo: require(`react-native-vector-icons/Entypo`),
|
|
16
11
|
};
|
|
17
|
-
class Icon extends
|
|
12
|
+
export default class Icon extends React.Component {
|
|
18
13
|
setNativeProps(nativeProps) {
|
|
19
14
|
this._root.setNativeProps(nativeProps);
|
|
20
15
|
}
|
|
@@ -36,7 +31,6 @@ class Icon extends react_1.default.Component {
|
|
|
36
31
|
return <IconClass {...clonedProps}/>;
|
|
37
32
|
}
|
|
38
33
|
}
|
|
39
|
-
exports.default = Icon;
|
|
40
34
|
Icon.defaultProps = {
|
|
41
35
|
iconIdentifier: `FontAwesome/question`,
|
|
42
36
|
};
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const react_1 = __importDefault(require("react"));
|
|
10
|
-
const react_native_1 = require("react-native");
|
|
11
|
-
const i18nUtils_1 = require("../locale/i18nUtils");
|
|
12
|
-
const Constants_1 = require("../utils/Constants");
|
|
13
|
-
const Utils_1 = require("../utils/Utils");
|
|
14
|
-
class InfoBars extends react_1.default.Component {
|
|
1
|
+
import { BloodGlucoseUnit, BloodKetonesUnit } from "@hedia/types";
|
|
2
|
+
import { t } from "@lingui/macro";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Dimensions, StyleSheet, Text, View } from "react-native";
|
|
5
|
+
import { i18n } from "../locale/i18nUtils";
|
|
6
|
+
import { BORDER_COLOUR_GREY } from "../utils/Constants";
|
|
7
|
+
import { Utils } from "../utils/Utils";
|
|
8
|
+
export default class InfoBars extends React.Component {
|
|
15
9
|
constructor() {
|
|
16
10
|
super(...arguments);
|
|
17
11
|
this.displayValue = () => {
|
|
18
12
|
const { showNullAsDash, unit, value } = this.props;
|
|
19
|
-
const noDecimal = unit ===
|
|
13
|
+
const noDecimal = unit === BloodGlucoseUnit.MG_DL || unit === BloodKetonesUnit.MG_DL;
|
|
20
14
|
const nullPlaceholder = noDecimal || !unit ? `-` : `-.-`;
|
|
21
15
|
return value ?? (showNullAsDash ? nullPlaceholder : `0`);
|
|
22
16
|
};
|
|
@@ -25,38 +19,37 @@ class InfoBars extends react_1.default.Component {
|
|
|
25
19
|
if (!unit) {
|
|
26
20
|
return null;
|
|
27
21
|
}
|
|
28
|
-
return unit ===
|
|
22
|
+
return unit === i18n._(t `units`) ? unit : Utils.formatUnit(unit);
|
|
29
23
|
};
|
|
30
24
|
}
|
|
31
25
|
render() {
|
|
32
26
|
const { testID } = this.props;
|
|
33
|
-
return (<
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
<
|
|
39
|
-
</
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
<
|
|
27
|
+
return (<View style={infoStyles.container}>
|
|
28
|
+
<View style={infoStyles.margin}>
|
|
29
|
+
<View style={infoStyles.border}>
|
|
30
|
+
<View style={infoStyles.borderContainer}>
|
|
31
|
+
<View style={infoStyles.labelContainer}>
|
|
32
|
+
<Text style={infoStyles.label}>{this.props.label}</Text>
|
|
33
|
+
</View>
|
|
34
|
+
<View style={infoStyles.valueUnitContainer}>
|
|
35
|
+
<View style={infoStyles.valueContainer}>
|
|
36
|
+
<Text style={infoStyles.value} testID={testID?.valueID}>
|
|
43
37
|
{this.displayValue()}
|
|
44
|
-
</
|
|
45
|
-
</
|
|
46
|
-
<
|
|
47
|
-
<
|
|
38
|
+
</Text>
|
|
39
|
+
</View>
|
|
40
|
+
<View style={infoStyles.unitContainer}>
|
|
41
|
+
<Text style={infoStyles.units} testID={testID?.unitID}>
|
|
48
42
|
{this.displayUnit()}
|
|
49
|
-
</
|
|
50
|
-
</
|
|
51
|
-
</
|
|
52
|
-
</
|
|
53
|
-
</
|
|
54
|
-
</
|
|
55
|
-
</
|
|
43
|
+
</Text>
|
|
44
|
+
</View>
|
|
45
|
+
</View>
|
|
46
|
+
</View>
|
|
47
|
+
</View>
|
|
48
|
+
</View>
|
|
49
|
+
</View>);
|
|
56
50
|
}
|
|
57
51
|
}
|
|
58
|
-
|
|
59
|
-
exports.infoStyles = react_native_1.StyleSheet.create({
|
|
52
|
+
export const infoStyles = StyleSheet.create({
|
|
60
53
|
container: { flex: 1 },
|
|
61
54
|
margin: {
|
|
62
55
|
flex: 1,
|
|
@@ -65,7 +58,7 @@ exports.infoStyles = react_native_1.StyleSheet.create({
|
|
|
65
58
|
},
|
|
66
59
|
border: {
|
|
67
60
|
borderWidth: 2,
|
|
68
|
-
borderColor:
|
|
61
|
+
borderColor: BORDER_COLOUR_GREY,
|
|
69
62
|
borderRadius: 5,
|
|
70
63
|
paddingVertical: `1%`,
|
|
71
64
|
},
|
|
@@ -81,7 +74,7 @@ exports.infoStyles = react_native_1.StyleSheet.create({
|
|
|
81
74
|
},
|
|
82
75
|
label: {
|
|
83
76
|
color: `white`,
|
|
84
|
-
fontSize:
|
|
77
|
+
fontSize: Dimensions.get(`screen`).width / 22,
|
|
85
78
|
fontWeight: `bold`,
|
|
86
79
|
},
|
|
87
80
|
valueUnitContainer: {
|
|
@@ -95,7 +88,7 @@ exports.infoStyles = react_native_1.StyleSheet.create({
|
|
|
95
88
|
},
|
|
96
89
|
value: {
|
|
97
90
|
color: `white`,
|
|
98
|
-
fontSize:
|
|
91
|
+
fontSize: Dimensions.get(`screen`).width / 15,
|
|
99
92
|
fontWeight: `bold`,
|
|
100
93
|
textAlign: `right`,
|
|
101
94
|
},
|
|
@@ -106,7 +99,7 @@ exports.infoStyles = react_native_1.StyleSheet.create({
|
|
|
106
99
|
},
|
|
107
100
|
units: {
|
|
108
101
|
color: `white`,
|
|
109
|
-
fontSize:
|
|
102
|
+
fontSize: Dimensions.get(`screen`).width / 30,
|
|
110
103
|
textAlign: `left`,
|
|
111
104
|
paddingLeft: `5%`,
|
|
112
105
|
},
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const react_native_1 = require("react-native");
|
|
8
|
-
class InvisibleNumberInput extends react_1.default.Component {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StyleSheet, TextInput } from "react-native";
|
|
3
|
+
export default class InvisibleNumberInput extends React.Component {
|
|
9
4
|
constructor() {
|
|
10
5
|
super(...arguments);
|
|
11
6
|
this.state = {
|
|
@@ -52,15 +47,14 @@ class InvisibleNumberInput extends react_1.default.Component {
|
|
|
52
47
|
}
|
|
53
48
|
render() {
|
|
54
49
|
const { testID } = this.props;
|
|
55
|
-
return (<
|
|
50
|
+
return (<TextInput testID={testID} accessibilityLabel="InvisibleNumberInput" value={`${this.state.value}`} ref={(textInput) => {
|
|
56
51
|
if (textInput !== null) {
|
|
57
52
|
this.textInput = textInput;
|
|
58
53
|
}
|
|
59
54
|
}} style={inputStyles.textInput} keyboardType="numeric" onChangeText={this.handleOnChangeText} onEndEditing={this.onEndEdit} maxLength={this.props.maxLength} selectTextOnFocus/>);
|
|
60
55
|
}
|
|
61
56
|
}
|
|
62
|
-
|
|
63
|
-
const inputStyles = react_native_1.StyleSheet.create({
|
|
57
|
+
const inputStyles = StyleSheet.create({
|
|
64
58
|
textInput: {
|
|
65
59
|
width: 0,
|
|
66
60
|
height: 0,
|
|
@@ -1,49 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
const macro_1 = require("@lingui/macro");
|
|
23
|
-
const React = __importStar(require("react"));
|
|
24
|
-
const react_native_1 = require("react-native");
|
|
25
|
-
const i18nUtils_1 = require("../locale/i18nUtils");
|
|
26
|
-
const enum_1 = require("../types/enum");
|
|
27
|
-
const RecommendationModal_1 = require("./RecommendationModal");
|
|
28
|
-
class LimitationMessage extends React.Component {
|
|
1
|
+
import { t } from "@lingui/macro";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Text, TouchableOpacity, View } from "react-native";
|
|
4
|
+
import { i18n } from "../locale/i18nUtils";
|
|
5
|
+
import { LimitationMessageTestIds } from "../types/enum";
|
|
6
|
+
import { stylesModal } from "./RecommendationModal";
|
|
7
|
+
export default class LimitationMessage extends React.Component {
|
|
29
8
|
constructor() {
|
|
30
9
|
super(...arguments);
|
|
31
10
|
this.render = () => {
|
|
32
11
|
const { limitationMessage } = this.props;
|
|
33
12
|
return (<React.Fragment>
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
<
|
|
37
|
-
</
|
|
38
|
-
<
|
|
39
|
-
</
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
<
|
|
43
|
-
</
|
|
44
|
-
</
|
|
13
|
+
<View style={stylesModal.container}>
|
|
14
|
+
<View style={stylesModal.titleContainer}>
|
|
15
|
+
<Text style={stylesModal.textTittleMessage}>{i18n._(t `Attention`)}</Text>
|
|
16
|
+
</View>
|
|
17
|
+
<Text style={stylesModal.textMessage}>{limitationMessage}</Text>
|
|
18
|
+
</View>
|
|
19
|
+
<View style={stylesModal.containerAcceptButton}>
|
|
20
|
+
<TouchableOpacity testID={LimitationMessageTestIds.OkButton} accessibilityLabel="nextButtonModal" style={stylesModal.okButton} onPress={this.props.onPressNextButton}>
|
|
21
|
+
<Text style={stylesModal.buttonText}>{i18n._(t `OK`)}</Text>
|
|
22
|
+
</TouchableOpacity>
|
|
23
|
+
</View>
|
|
45
24
|
</React.Fragment>);
|
|
46
25
|
};
|
|
47
26
|
}
|
|
48
27
|
}
|
|
49
|
-
exports.default = LimitationMessage;
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const react_native_1 = require("react-native");
|
|
8
|
-
class LineSeparator extends react_1.default.Component {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StyleSheet, View } from "react-native";
|
|
3
|
+
export default class LineSeparator extends React.Component {
|
|
9
4
|
render() {
|
|
10
|
-
return (<
|
|
11
|
-
<
|
|
12
|
-
</
|
|
5
|
+
return (<React.Fragment>
|
|
6
|
+
<View style={[lineSeparatorStyles.lineStyle, { borderBottomColor: this.props.color }]}/>
|
|
7
|
+
</React.Fragment>);
|
|
13
8
|
}
|
|
14
9
|
}
|
|
15
|
-
|
|
16
|
-
const lineSeparatorStyles = react_native_1.StyleSheet.create({
|
|
10
|
+
const lineSeparatorStyles = StyleSheet.create({
|
|
17
11
|
lineStyle: {
|
|
18
12
|
marginHorizontal: `3%`,
|
|
19
13
|
marginVertical: `2%`,
|
|
@@ -1,45 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const react_native_1 = require("react-native");
|
|
9
|
-
const i18nUtils_1 = require("../locale/i18nUtils");
|
|
10
|
-
const enum_1 = require("../types/enum");
|
|
11
|
-
const InfoBars_1 = require("./InfoBars");
|
|
12
|
-
class RecentInsulin extends react_1.default.Component {
|
|
1
|
+
import { t } from "@lingui/macro";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Dimensions, StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
4
|
+
import { i18n } from "../locale/i18nUtils";
|
|
5
|
+
import { RecentInsulinTestIds } from "../types/enum";
|
|
6
|
+
import { infoStyles } from "./InfoBars";
|
|
7
|
+
export default class RecentInsulin extends React.Component {
|
|
13
8
|
constructor() {
|
|
14
9
|
super(...arguments);
|
|
15
10
|
this.render = () => {
|
|
16
|
-
return (<
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
</
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
{
|
|
23
|
-
</
|
|
24
|
-
</
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
</
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
</
|
|
33
|
-
<
|
|
34
|
-
</
|
|
35
|
-
</
|
|
11
|
+
return (<View style={recentInsulinStyles.container}>
|
|
12
|
+
<View style={recentInsulinStyles.titleContainer}>
|
|
13
|
+
<Text style={recentInsulinStyles.recommended}>{i18n._(t `Recommended amount of insulin`)}</Text>
|
|
14
|
+
</View>
|
|
15
|
+
<View style={recentInsulinStyles.takenInsulinContainer}>
|
|
16
|
+
<Text style={recentInsulinStyles.takenInsulin}>
|
|
17
|
+
{i18n._(t `Have you taken insulin within the last 4 hours?`)}
|
|
18
|
+
</Text>
|
|
19
|
+
</View>
|
|
20
|
+
<View style={recentInsulinStyles.buttonContainer}>
|
|
21
|
+
<View style={recentInsulinStyles.filler}/>
|
|
22
|
+
<TouchableOpacity testID={RecentInsulinTestIds.Yes} onPress={this.props.onRecentInsulinYes} style={[recentInsulinStyles.yesNoContainer, { marginRight: `2%` }]}>
|
|
23
|
+
<Text style={recentInsulinStyles.yesNoText}>{i18n._(t `Yes`)}</Text>
|
|
24
|
+
</TouchableOpacity>
|
|
25
|
+
<TouchableOpacity testID={RecentInsulinTestIds.No} onPress={this.props.onRecentInsulinNo} style={[recentInsulinStyles.yesNoContainer, { marginLeft: `2%` }]}>
|
|
26
|
+
<Text style={recentInsulinStyles.yesNoText}>{i18n._(t `No`)}</Text>
|
|
27
|
+
</TouchableOpacity>
|
|
28
|
+
<View style={recentInsulinStyles.filler}/>
|
|
29
|
+
</View>
|
|
30
|
+
</View>);
|
|
36
31
|
};
|
|
37
32
|
}
|
|
38
33
|
}
|
|
39
|
-
|
|
40
|
-
const recentInsulinStyles = react_native_1.StyleSheet.create({
|
|
34
|
+
const recentInsulinStyles = StyleSheet.create({
|
|
41
35
|
container: {
|
|
42
|
-
...
|
|
36
|
+
...infoStyles.margin,
|
|
43
37
|
backgroundColor: `rgba(118, 82, 255, 0.5)`,
|
|
44
38
|
borderRadius: 5,
|
|
45
39
|
},
|
|
@@ -51,7 +45,7 @@ const recentInsulinStyles = react_native_1.StyleSheet.create({
|
|
|
51
45
|
marginBottom: `4%`,
|
|
52
46
|
},
|
|
53
47
|
recommended: {
|
|
54
|
-
...
|
|
48
|
+
...infoStyles.label,
|
|
55
49
|
},
|
|
56
50
|
takenInsulinContainer: {
|
|
57
51
|
flex: 1,
|
|
@@ -60,8 +54,8 @@ const recentInsulinStyles = react_native_1.StyleSheet.create({
|
|
|
60
54
|
marginTop: `2%`,
|
|
61
55
|
},
|
|
62
56
|
takenInsulin: {
|
|
63
|
-
...
|
|
64
|
-
fontSize:
|
|
57
|
+
...infoStyles.label,
|
|
58
|
+
fontSize: Dimensions.get(`screen`).width / 27,
|
|
65
59
|
textAlign: `center`,
|
|
66
60
|
},
|
|
67
61
|
buttonContainer: {
|
|
@@ -84,7 +78,7 @@ const recentInsulinStyles = react_native_1.StyleSheet.create({
|
|
|
84
78
|
paddingTop: `1%`,
|
|
85
79
|
paddingBottom: `1%`,
|
|
86
80
|
color: `white`,
|
|
87
|
-
fontSize:
|
|
81
|
+
fontSize: Dimensions.get(`screen`).width / 25,
|
|
88
82
|
fontWeight: `bold`,
|
|
89
83
|
},
|
|
90
84
|
filler: {
|