@hedia/recommendation-screen 1.0.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/.prettierignore +2 -0
- package/Changelog.md +5 -0
- package/README.md +3 -0
- package/android/app/BUCK +55 -0
- package/android/app/build.gradle +226 -0
- package/android/app/build_defs.bzl +19 -0
- package/android/app/debug.keystore +0 -0
- package/android/app/proguard-rules.pro +10 -0
- package/android/app/src/debug/AndroidManifest.xml +8 -0
- package/android/app/src/debug/java/com/hediarecommendationscreen/ReactNativeFlipper.java +72 -0
- package/android/app/src/main/AndroidManifest.xml +27 -0
- package/android/app/src/main/java/com/hediarecommendationscreen/MainActivity.java +15 -0
- package/android/app/src/main/java/com/hediarecommendationscreen/MainApplication.java +80 -0
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/values/strings.xml +3 -0
- package/android/app/src/main/res/values/styles.xml +9 -0
- package/android/build.gradle +38 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +28 -0
- package/android/gradlew +188 -0
- package/android/gradlew.bat +100 -0
- package/android/settings.gradle +3 -0
- package/index-git.sh +5 -0
- package/index.d.ts +5 -0
- package/index.js +16 -0
- package/index.ts +19 -0
- package/ios/HediaRecommendationScreen/AppDelegate.h +8 -0
- package/ios/HediaRecommendationScreen/AppDelegate.m +58 -0
- package/ios/HediaRecommendationScreen/Base.lproj/LaunchScreen.xib +42 -0
- package/ios/HediaRecommendationScreen/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
- package/ios/HediaRecommendationScreen/Images.xcassets/Contents.json +6 -0
- package/ios/HediaRecommendationScreen/Info.plist +57 -0
- package/ios/HediaRecommendationScreen/main.m +9 -0
- package/ios/HediaRecommendationScreen-tvOS/Info.plist +53 -0
- package/ios/HediaRecommendationScreen-tvOSTests/Info.plist +24 -0
- package/ios/HediaRecommendationScreen.xcodeproj/project.pbxproj +807 -0
- package/ios/HediaRecommendationScreen.xcodeproj/xcshareddata/xcschemes/HediaRecommendationScreen-tvOS.xcscheme +88 -0
- package/ios/HediaRecommendationScreen.xcodeproj/xcshareddata/xcschemes/HediaRecommendationScreen.xcscheme +88 -0
- package/ios/HediaRecommendationScreenTests/HediaRecommendationScreenTests.m +65 -0
- package/ios/HediaRecommendationScreenTests/Info.plist +24 -0
- package/ios/Podfile +104 -0
- package/package.json +75 -0
- package/src/RecommendationScreen.d.ts +42 -0
- package/src/RecommendationScreen.js +142 -0
- package/src/RecommendationScreen.tsx +210 -0
- package/src/assets/happy.png +0 -0
- package/src/assets/happy_active.png +0 -0
- package/src/assets/neutral.png +0 -0
- package/src/assets/neutral_active.png +0 -0
- package/src/assets/sad.png +0 -0
- package/src/assets/sad_active.png +0 -0
- package/src/assets/semi_happy.png +0 -0
- package/src/assets/semi_happy_active.png +0 -0
- package/src/assets/semi_sad.png +0 -0
- package/src/assets/semi_sad_active.png +0 -0
- package/src/components/Emotion.d.ts +14 -0
- package/src/components/Emotion.js +55 -0
- package/src/components/Emotion.tsx +71 -0
- package/src/components/Header.d.ts +52 -0
- package/src/components/Header.js +83 -0
- package/src/components/Header.tsx +94 -0
- package/src/components/Icon.js +41 -0
- package/src/components/InfoBars.d.ts +67 -0
- package/src/components/InfoBars.js +89 -0
- package/src/components/InfoBars.tsx +93 -0
- package/src/components/InvisibleNumberInput.d.ts +24 -0
- package/src/components/InvisibleNumberInput.js +64 -0
- package/src/components/InvisibleNumberInput.tsx +88 -0
- package/src/components/MoodIcon.d.ts +14 -0
- package/src/components/MoodIcon.js +53 -0
- package/src/components/MoodIcon.tsx +58 -0
- package/src/components/RecentInsulin.d.ts +9 -0
- package/src/components/RecentInsulin.js +91 -0
- package/src/components/RecentInsulin.tsx +97 -0
- package/src/components/RecommendedCarbs.d.ts +30 -0
- package/src/components/RecommendedCarbs.js +193 -0
- package/src/components/RecommendedCarbs.tsx +242 -0
- package/src/components/RecommendedInsulin.d.ts +22 -0
- package/src/components/RecommendedInsulin.js +110 -0
- package/src/components/RecommendedInsulin.tsx +147 -0
- package/src/components/Remeasure.d.ts +13 -0
- package/src/components/Remeasure.js +89 -0
- package/src/components/Remeasure.tsx +105 -0
- package/src/components/TransferToLogbook.d.ts +14 -0
- package/src/components/TransferToLogbook.js +81 -0
- package/src/components/TransferToLogbook.tsx +97 -0
- package/src/locale/da/messages.js +1 -0
- package/src/locale/da/messages.po +119 -0
- package/src/locale/en/messages.js +1 -0
- package/src/locale/en/messages.po +119 -0
- package/src/locale/i18nUtils.d.ts +5 -0
- package/src/locale/i18nUtils.js +22 -0
- package/src/locale/i18nUtils.ts +21 -0
- package/src/types/enum.d.ts +26 -0
- package/src/types/enum.js +34 -0
- package/src/types/enum.ts +30 -0
- package/src/types/types.d.ts +21 -0
- package/src/types/types.js +2 -0
- package/src/types/types.ts +23 -0
- package/src/utils/Constants.d.ts +3 -0
- package/src/utils/Constants.js +6 -0
- package/src/utils/Constants.ts +3 -0
- package/src/utils/RecommendationError.d.ts +9 -0
- package/src/utils/RecommendationError.js +17 -0
- package/src/utils/RecommendationError.ts +30 -0
- package/src/utils/Utils.d.ts +5 -0
- package/src/utils/Utils.js +24 -0
- package/src/utils/Utils.ts +26 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { t } from "@lingui/macro";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Dimensions, StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
4
|
+
import LinearGradient from "react-native-linear-gradient";
|
|
5
|
+
import { i18n } from "../locale/i18nUtils";
|
|
6
|
+
import { InjectionMethod } from "../types/enum";
|
|
7
|
+
import { InsulinLimitError, RecommendationError } from "../utils/RecommendationError";
|
|
8
|
+
import { Utils } from "../utils/Utils";
|
|
9
|
+
import Icon from "./Icon";
|
|
10
|
+
import { infoStyles } from "./InfoBars";
|
|
11
|
+
import InvisibleNumberInput from "./InvisibleNumberInput";
|
|
12
|
+
|
|
13
|
+
interface IProps {
|
|
14
|
+
insulinRecommendation?: number;
|
|
15
|
+
activityReduction?: number;
|
|
16
|
+
|
|
17
|
+
injectionMethod: InjectionMethod;
|
|
18
|
+
|
|
19
|
+
updateRecommendedInsulin(value: number): void;
|
|
20
|
+
onError(error: RecommendationError): void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface IState {
|
|
24
|
+
insulin: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default class RecommendedInsulin extends React.Component<IProps, IState> {
|
|
28
|
+
public callbackInput: () => void;
|
|
29
|
+
|
|
30
|
+
constructor(props: IProps) {
|
|
31
|
+
super(props);
|
|
32
|
+
|
|
33
|
+
this.state = {
|
|
34
|
+
insulin: `${props.insulinRecommendation ?? 0}`,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public handleOnPress = () => {
|
|
39
|
+
this.callbackInput?.();
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
public updatePartially = (insulin: string) => {
|
|
43
|
+
const replacedZero =
|
|
44
|
+
insulin.length > 1 && insulin.startsWith(`0`) && !insulin.startsWith(`0.`) ? insulin.substring(1) : insulin;
|
|
45
|
+
this.setState({
|
|
46
|
+
insulin: replacedZero,
|
|
47
|
+
});
|
|
48
|
+
return replacedZero;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
public handleUpdatedInsulin = (value: number) => {
|
|
52
|
+
const rounded = Utils.roundValue(value, this.props.injectionMethod);
|
|
53
|
+
|
|
54
|
+
// https://hedia.atlassian.net/browse/HDA-795
|
|
55
|
+
const limited = (1 - this.props.activityReduction) * 50;
|
|
56
|
+
|
|
57
|
+
if (rounded > limited) {
|
|
58
|
+
this.updatePartially(`${limited}`);
|
|
59
|
+
return this.props.onError(InsulinLimitError);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
this.updatePartially(`${rounded}`);
|
|
63
|
+
this.props.updateRecommendedInsulin(rounded);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
public render = () => {
|
|
67
|
+
return (
|
|
68
|
+
<React.Fragment>
|
|
69
|
+
<TouchableOpacity accessibilityLabel="editRecommendedInsulin" onPress={this.handleOnPress}>
|
|
70
|
+
<LinearGradient
|
|
71
|
+
style={recommendedInsulinStyles.container}
|
|
72
|
+
colors={[`#a200ff`, `#578aff`]}
|
|
73
|
+
start={{ x: 0, y: 0 }}
|
|
74
|
+
end={{ x: 1, y: 0 }}
|
|
75
|
+
>
|
|
76
|
+
<View style={recommendedInsulinStyles.recommendedTextContainer}>
|
|
77
|
+
<Text style={recommendedInsulinStyles.recommendedText}>
|
|
78
|
+
{i18n._(t`Recommended amount of insulin`)}
|
|
79
|
+
</Text>
|
|
80
|
+
</View>
|
|
81
|
+
<View style={recommendedInsulinStyles.recommendedContainer}>
|
|
82
|
+
<View style={recommendedInsulinStyles.valueContainer}>
|
|
83
|
+
<Text style={recommendedInsulinStyles.value}>{this.state.insulin}</Text>
|
|
84
|
+
<Text style={recommendedInsulinStyles.units}>{i18n._(t`Units`)}</Text>
|
|
85
|
+
</View>
|
|
86
|
+
<Icon style={recommendedInsulinStyles.editIcon} iconIdentifier={`Feather/edit`} />
|
|
87
|
+
</View>
|
|
88
|
+
</LinearGradient>
|
|
89
|
+
</TouchableOpacity>
|
|
90
|
+
<InvisibleNumberInput
|
|
91
|
+
decimalPlaces={3}
|
|
92
|
+
negativeAllowed={false}
|
|
93
|
+
cleanPartialInput={false}
|
|
94
|
+
partialInput={this.updatePartially}
|
|
95
|
+
onEnd={this.handleUpdatedInsulin}
|
|
96
|
+
visible={(visible) => (this.callbackInput = visible)}
|
|
97
|
+
startValue={`${this.state.insulin}`}
|
|
98
|
+
/>
|
|
99
|
+
</React.Fragment>
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const recommendedInsulinStyles = StyleSheet.create({
|
|
105
|
+
container: {
|
|
106
|
+
marginHorizontal: infoStyles.margin.margin,
|
|
107
|
+
borderRadius: 5,
|
|
108
|
+
},
|
|
109
|
+
recommendedTextContainer: {
|
|
110
|
+
flex: 1,
|
|
111
|
+
alignItems: `center`,
|
|
112
|
+
marginTop: `3%`,
|
|
113
|
+
},
|
|
114
|
+
recommendedText: {
|
|
115
|
+
color: `white`,
|
|
116
|
+
fontWeight: `bold`,
|
|
117
|
+
fontSize: Dimensions.get(`screen`).width / 24,
|
|
118
|
+
},
|
|
119
|
+
recommendedContainer: {
|
|
120
|
+
flex: 1,
|
|
121
|
+
flexDirection: `row`,
|
|
122
|
+
marginLeft: `10%`,
|
|
123
|
+
},
|
|
124
|
+
valueContainer: {
|
|
125
|
+
flex: 1,
|
|
126
|
+
flexDirection: `row`,
|
|
127
|
+
justifyContent: `center`,
|
|
128
|
+
},
|
|
129
|
+
value: {
|
|
130
|
+
color: `white`,
|
|
131
|
+
fontWeight: `bold`,
|
|
132
|
+
fontSize: Dimensions.get(`screen`).width / 5,
|
|
133
|
+
},
|
|
134
|
+
units: {
|
|
135
|
+
color: `white`,
|
|
136
|
+
fontSize: Dimensions.get(`screen`).width / 28,
|
|
137
|
+
textAlignVertical: `bottom`,
|
|
138
|
+
paddingBottom: `6%`,
|
|
139
|
+
},
|
|
140
|
+
editIcon: {
|
|
141
|
+
color: `white`,
|
|
142
|
+
fontSize: Dimensions.get(`screen`).width / 28,
|
|
143
|
+
textAlignVertical: `center`,
|
|
144
|
+
paddingBottom: `10%`,
|
|
145
|
+
marginRight: `5%`,
|
|
146
|
+
},
|
|
147
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface IProps {
|
|
3
|
+
remeasureTime: number;
|
|
4
|
+
onSliderChange(value: number): void;
|
|
5
|
+
}
|
|
6
|
+
export default class Remeasure extends React.Component<IProps, null> {
|
|
7
|
+
private slider;
|
|
8
|
+
componentDidMount(): void;
|
|
9
|
+
handleSliderChange: (remeasureTime: number) => void;
|
|
10
|
+
limitTime: (remeasureTime: number) => number;
|
|
11
|
+
render(): JSX.Element;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
const macro_1 = require("@lingui/macro");
|
|
7
|
+
const slider_1 = __importDefault(require("@react-native-community/slider"));
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const react_native_1 = require("react-native");
|
|
10
|
+
const i18nUtils_1 = require("../locale/i18nUtils");
|
|
11
|
+
const Constants_1 = require("../utils/Constants");
|
|
12
|
+
const InfoBars_1 = require("./InfoBars");
|
|
13
|
+
class Remeasure extends react_1.default.Component {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.handleSliderChange = (remeasureTime) => {
|
|
17
|
+
const limited = this.limitTime(remeasureTime);
|
|
18
|
+
this.setState({
|
|
19
|
+
remeasureTime: limited,
|
|
20
|
+
});
|
|
21
|
+
this.props.onSliderChange(limited);
|
|
22
|
+
};
|
|
23
|
+
this.limitTime = (remeasureTime) => {
|
|
24
|
+
return Math.min(Math.max(0, remeasureTime), 4);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
componentDidMount() {
|
|
28
|
+
this.slider.setNativeProps({
|
|
29
|
+
value: this.props.remeasureTime,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
const measure = this.props.remeasureTime > 0;
|
|
34
|
+
const limited = this.limitTime(this.props.remeasureTime);
|
|
35
|
+
return (<react_native_1.View style={remeasureStyles.container}>
|
|
36
|
+
<react_native_1.View style={remeasureStyles.borderContainer}>
|
|
37
|
+
<react_native_1.View style={remeasureStyles.remeasureContainer}>
|
|
38
|
+
<react_native_1.Text style={remeasureStyles.remeasureLabel}>{i18nUtils_1.i18n._(macro_1.t `Remind me to remeasure in`)}</react_native_1.Text>
|
|
39
|
+
</react_native_1.View>
|
|
40
|
+
<react_native_1.View style={remeasureStyles.valueUnitContainer}>
|
|
41
|
+
<react_native_1.View style={remeasureStyles.valueContainer}>
|
|
42
|
+
<react_native_1.Text style={remeasureStyles.value}>{measure ? limited : i18nUtils_1.i18n._(macro_1.t `OFF`)}</react_native_1.Text>
|
|
43
|
+
</react_native_1.View>
|
|
44
|
+
<react_native_1.View style={remeasureStyles.unitContainer}>
|
|
45
|
+
<react_native_1.Text style={remeasureStyles.units}>{measure ? i18nUtils_1.i18n._(macro_1.t `hours`) : ``}</react_native_1.Text>
|
|
46
|
+
</react_native_1.View>
|
|
47
|
+
</react_native_1.View>
|
|
48
|
+
</react_native_1.View>
|
|
49
|
+
<slider_1.default ref={(slider) => (this.slider = slider)} accessibilityLabel="remeasureSlider" maximumTrackTintColor={Constants_1.BORDER_COLOUR_TEAL} minimumTrackTintColor={Constants_1.BORDER_COLOUR_TEAL} thumbTintColor={Constants_1.BORDER_COLOUR_TEAL} maximumValue={4} minimumValue={0} step={0.5} style={remeasureStyles.sliderStyle} onValueChange={this.handleSliderChange}></slider_1.default>
|
|
50
|
+
</react_native_1.View>);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.default = Remeasure;
|
|
54
|
+
const remeasureStyles = react_native_1.StyleSheet.create({
|
|
55
|
+
container: {
|
|
56
|
+
flexDirection: `column`,
|
|
57
|
+
},
|
|
58
|
+
borderContainer: {
|
|
59
|
+
...InfoBars_1.infoStyles.borderContainer,
|
|
60
|
+
alignItems: `center`,
|
|
61
|
+
},
|
|
62
|
+
remeasureContainer: {
|
|
63
|
+
flex: 7,
|
|
64
|
+
},
|
|
65
|
+
remeasureLabel: {
|
|
66
|
+
color: `white`,
|
|
67
|
+
fontSize: react_native_1.Dimensions.get(`screen`).width / 25,
|
|
68
|
+
fontWeight: `bold`,
|
|
69
|
+
},
|
|
70
|
+
valueUnitContainer: {
|
|
71
|
+
...InfoBars_1.infoStyles.valueUnitContainer,
|
|
72
|
+
},
|
|
73
|
+
valueContainer: {
|
|
74
|
+
...InfoBars_1.infoStyles.valueContainer,
|
|
75
|
+
},
|
|
76
|
+
value: {
|
|
77
|
+
...InfoBars_1.infoStyles.value,
|
|
78
|
+
},
|
|
79
|
+
unitContainer: {
|
|
80
|
+
...InfoBars_1.infoStyles.unitContainer,
|
|
81
|
+
},
|
|
82
|
+
units: {
|
|
83
|
+
...InfoBars_1.infoStyles.units,
|
|
84
|
+
},
|
|
85
|
+
sliderStyle: {
|
|
86
|
+
marginTop: `3%`,
|
|
87
|
+
marginBottom: `2%`,
|
|
88
|
+
},
|
|
89
|
+
});
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { t } from "@lingui/macro";
|
|
2
|
+
import Slider from "@react-native-community/slider";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Dimensions, StyleSheet, Text, View } from "react-native";
|
|
5
|
+
import { i18n } from "../locale/i18nUtils";
|
|
6
|
+
import { BORDER_COLOUR_TEAL } from "../utils/Constants";
|
|
7
|
+
import { infoStyles } from "./InfoBars";
|
|
8
|
+
|
|
9
|
+
interface IProps {
|
|
10
|
+
remeasureTime: number;
|
|
11
|
+
onSliderChange(value: number): void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default class Remeasure extends React.Component<IProps, null> {
|
|
15
|
+
private slider: Slider;
|
|
16
|
+
|
|
17
|
+
public componentDidMount() {
|
|
18
|
+
this.slider.setNativeProps({
|
|
19
|
+
value: this.props.remeasureTime,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public handleSliderChange = (remeasureTime: number) => {
|
|
24
|
+
const limited = this.limitTime(remeasureTime);
|
|
25
|
+
this.setState({
|
|
26
|
+
remeasureTime: limited,
|
|
27
|
+
});
|
|
28
|
+
this.props.onSliderChange(limited);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
public limitTime = (remeasureTime: number) => {
|
|
32
|
+
return Math.min(Math.max(0, remeasureTime), 4);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
public render() {
|
|
36
|
+
const measure = this.props.remeasureTime > 0;
|
|
37
|
+
const limited = this.limitTime(this.props.remeasureTime);
|
|
38
|
+
return (
|
|
39
|
+
<View style={remeasureStyles.container}>
|
|
40
|
+
<View style={remeasureStyles.borderContainer}>
|
|
41
|
+
<View style={remeasureStyles.remeasureContainer}>
|
|
42
|
+
<Text style={remeasureStyles.remeasureLabel}>{i18n._(t`Remind me to remeasure in`)}</Text>
|
|
43
|
+
</View>
|
|
44
|
+
<View style={remeasureStyles.valueUnitContainer}>
|
|
45
|
+
<View style={remeasureStyles.valueContainer}>
|
|
46
|
+
<Text style={remeasureStyles.value}>{measure ? limited : i18n._(t`OFF`)}</Text>
|
|
47
|
+
</View>
|
|
48
|
+
<View style={remeasureStyles.unitContainer}>
|
|
49
|
+
<Text style={remeasureStyles.units}>{measure ? i18n._(t`hours`) : ``}</Text>
|
|
50
|
+
</View>
|
|
51
|
+
</View>
|
|
52
|
+
</View>
|
|
53
|
+
<Slider
|
|
54
|
+
ref={(slider) => (this.slider = slider)}
|
|
55
|
+
accessibilityLabel="remeasureSlider"
|
|
56
|
+
maximumTrackTintColor={BORDER_COLOUR_TEAL}
|
|
57
|
+
minimumTrackTintColor={BORDER_COLOUR_TEAL}
|
|
58
|
+
thumbTintColor={BORDER_COLOUR_TEAL}
|
|
59
|
+
maximumValue={4}
|
|
60
|
+
minimumValue={0}
|
|
61
|
+
step={0.5}
|
|
62
|
+
style={remeasureStyles.sliderStyle}
|
|
63
|
+
onValueChange={this.handleSliderChange}
|
|
64
|
+
></Slider>
|
|
65
|
+
</View>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const remeasureStyles = StyleSheet.create({
|
|
71
|
+
container: {
|
|
72
|
+
flexDirection: `column`,
|
|
73
|
+
},
|
|
74
|
+
borderContainer: {
|
|
75
|
+
...infoStyles.borderContainer,
|
|
76
|
+
alignItems: `center`,
|
|
77
|
+
},
|
|
78
|
+
remeasureContainer: {
|
|
79
|
+
flex: 7,
|
|
80
|
+
},
|
|
81
|
+
remeasureLabel: {
|
|
82
|
+
color: `white`,
|
|
83
|
+
fontSize: Dimensions.get(`screen`).width / 25,
|
|
84
|
+
fontWeight: `bold`,
|
|
85
|
+
},
|
|
86
|
+
valueUnitContainer: {
|
|
87
|
+
...infoStyles.valueUnitContainer,
|
|
88
|
+
},
|
|
89
|
+
valueContainer: {
|
|
90
|
+
...infoStyles.valueContainer,
|
|
91
|
+
},
|
|
92
|
+
value: {
|
|
93
|
+
...infoStyles.value,
|
|
94
|
+
},
|
|
95
|
+
unitContainer: {
|
|
96
|
+
...infoStyles.unitContainer,
|
|
97
|
+
},
|
|
98
|
+
units: {
|
|
99
|
+
...infoStyles.units,
|
|
100
|
+
},
|
|
101
|
+
sliderStyle: {
|
|
102
|
+
marginTop: `3%`,
|
|
103
|
+
marginBottom: `2%`,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface IProps {
|
|
3
|
+
visible: boolean;
|
|
4
|
+
transfer(): void;
|
|
5
|
+
}
|
|
6
|
+
interface IState {
|
|
7
|
+
pressed: boolean;
|
|
8
|
+
}
|
|
9
|
+
export default class TransferToLogbook extends React.Component<IProps, IState> {
|
|
10
|
+
state: IState;
|
|
11
|
+
handlePress: () => void;
|
|
12
|
+
render(): JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const macro_1 = require("@lingui/macro");
|
|
9
|
+
const i18nUtils_1 = require("../locale/i18nUtils");
|
|
10
|
+
const Icon_1 = __importDefault(require("./Icon"));
|
|
11
|
+
class TransferToLogbook extends react_1.default.Component {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.state = {
|
|
15
|
+
pressed: false,
|
|
16
|
+
};
|
|
17
|
+
this.handlePress = () => {
|
|
18
|
+
this.setState({
|
|
19
|
+
pressed: !this.state.pressed,
|
|
20
|
+
});
|
|
21
|
+
this.props.transfer();
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
if (!this.props.visible) {
|
|
26
|
+
return <react_native_1.View style={addToLogbookStyles.marginContainer}/>;
|
|
27
|
+
}
|
|
28
|
+
return (<react_native_1.TouchableOpacity onPress={this.handlePress} style={addToLogbookStyles.container} accessibilityLabel="transferToLogbook">
|
|
29
|
+
{!this.state.pressed ? (<react_native_1.View style={addToLogbookStyles.textContainer}>
|
|
30
|
+
<react_native_1.Text style={addToLogbookStyles.transferText}>{i18nUtils_1.i18n._(macro_1.t `Transfer to logbook`)}</react_native_1.Text>
|
|
31
|
+
</react_native_1.View>) : (<react_native_1.View style={addToLogbookStyles.textContainerActive}>
|
|
32
|
+
<Icon_1.default style={addToLogbookStyles.icon} iconIdentifier={`Feather/check`}/>
|
|
33
|
+
<react_native_1.Text style={addToLogbookStyles.transferTextActive}>{i18nUtils_1.i18n._(macro_1.t `Transfered to logbook`)}</react_native_1.Text>
|
|
34
|
+
</react_native_1.View>)}
|
|
35
|
+
</react_native_1.TouchableOpacity>);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.default = TransferToLogbook;
|
|
39
|
+
const addToLogbookStyles = react_native_1.StyleSheet.create({
|
|
40
|
+
marginContainer: {
|
|
41
|
+
marginVertical: `3%`,
|
|
42
|
+
},
|
|
43
|
+
container: {
|
|
44
|
+
flex: 1,
|
|
45
|
+
margin: `5%`,
|
|
46
|
+
},
|
|
47
|
+
textContainer: {
|
|
48
|
+
flexDirection: `row`,
|
|
49
|
+
justifyContent: `center`,
|
|
50
|
+
borderWidth: 1,
|
|
51
|
+
borderRadius: 100,
|
|
52
|
+
marginHorizontal: `4%`,
|
|
53
|
+
paddingVertical: `4%`,
|
|
54
|
+
borderColor: `#01FFFC`,
|
|
55
|
+
},
|
|
56
|
+
transferText: {
|
|
57
|
+
color: `#01FFFC`,
|
|
58
|
+
fontSize: react_native_1.Dimensions.get(`screen`).width / 22,
|
|
59
|
+
fontWeight: `bold`,
|
|
60
|
+
},
|
|
61
|
+
textContainerActive: {
|
|
62
|
+
flexDirection: `row`,
|
|
63
|
+
backgroundColor: `#01FFFC`,
|
|
64
|
+
justifyContent: `center`,
|
|
65
|
+
borderWidth: 1,
|
|
66
|
+
borderRadius: 100,
|
|
67
|
+
marginHorizontal: `4%`,
|
|
68
|
+
paddingVertical: `4%`,
|
|
69
|
+
},
|
|
70
|
+
icon: {
|
|
71
|
+
paddingTop: `1.3%`,
|
|
72
|
+
color: `#1B1F48`,
|
|
73
|
+
fontSize: react_native_1.Dimensions.get(`screen`).width / 22,
|
|
74
|
+
marginRight: `1%`,
|
|
75
|
+
},
|
|
76
|
+
transferTextActive: {
|
|
77
|
+
color: `#1B1F48`,
|
|
78
|
+
fontSize: react_native_1.Dimensions.get(`screen`).width / 22,
|
|
79
|
+
fontWeight: `bold`,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Dimensions, StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
3
|
+
|
|
4
|
+
import { t } from "@lingui/macro";
|
|
5
|
+
import { i18n } from "../locale/i18nUtils";
|
|
6
|
+
import Icon from "./Icon";
|
|
7
|
+
|
|
8
|
+
interface IProps {
|
|
9
|
+
visible: boolean;
|
|
10
|
+
transfer(): void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface IState {
|
|
14
|
+
pressed: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default class TransferToLogbook extends React.Component<IProps, IState> {
|
|
18
|
+
public state: IState = {
|
|
19
|
+
pressed: false,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
public handlePress = () => {
|
|
23
|
+
this.setState({
|
|
24
|
+
pressed: !this.state.pressed,
|
|
25
|
+
});
|
|
26
|
+
this.props.transfer();
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
public render() {
|
|
30
|
+
if (!this.props.visible) {
|
|
31
|
+
return <View style={addToLogbookStyles.marginContainer} />;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<TouchableOpacity
|
|
36
|
+
onPress={this.handlePress}
|
|
37
|
+
style={addToLogbookStyles.container}
|
|
38
|
+
accessibilityLabel="transferToLogbook"
|
|
39
|
+
>
|
|
40
|
+
{!this.state.pressed ? (
|
|
41
|
+
<View style={addToLogbookStyles.textContainer}>
|
|
42
|
+
<Text style={addToLogbookStyles.transferText}>{i18n._(t`Transfer to logbook`)}</Text>
|
|
43
|
+
</View>
|
|
44
|
+
) : (
|
|
45
|
+
<View style={addToLogbookStyles.textContainerActive}>
|
|
46
|
+
<Icon style={addToLogbookStyles.icon} iconIdentifier={`Feather/check`} />
|
|
47
|
+
<Text style={addToLogbookStyles.transferTextActive}>{i18n._(t`Transfered to logbook`)}</Text>
|
|
48
|
+
</View>
|
|
49
|
+
)}
|
|
50
|
+
</TouchableOpacity>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const addToLogbookStyles = StyleSheet.create({
|
|
56
|
+
marginContainer: {
|
|
57
|
+
marginVertical: `3%`,
|
|
58
|
+
},
|
|
59
|
+
container: {
|
|
60
|
+
flex: 1,
|
|
61
|
+
margin: `5%`,
|
|
62
|
+
},
|
|
63
|
+
textContainer: {
|
|
64
|
+
flexDirection: `row`,
|
|
65
|
+
justifyContent: `center`,
|
|
66
|
+
borderWidth: 1,
|
|
67
|
+
borderRadius: 100,
|
|
68
|
+
marginHorizontal: `4%`,
|
|
69
|
+
paddingVertical: `4%`,
|
|
70
|
+
borderColor: `#01FFFC`,
|
|
71
|
+
},
|
|
72
|
+
transferText: {
|
|
73
|
+
color: `#01FFFC`,
|
|
74
|
+
fontSize: Dimensions.get(`screen`).width / 22,
|
|
75
|
+
fontWeight: `bold`,
|
|
76
|
+
},
|
|
77
|
+
textContainerActive: {
|
|
78
|
+
flexDirection: `row`,
|
|
79
|
+
backgroundColor: `#01FFFC`,
|
|
80
|
+
justifyContent: `center`,
|
|
81
|
+
borderWidth: 1,
|
|
82
|
+
borderRadius: 100,
|
|
83
|
+
marginHorizontal: `4%`,
|
|
84
|
+
paddingVertical: `4%`,
|
|
85
|
+
},
|
|
86
|
+
icon: {
|
|
87
|
+
paddingTop: `1.3%`,
|
|
88
|
+
color: `#1B1F48`,
|
|
89
|
+
fontSize: Dimensions.get(`screen`).width / 22,
|
|
90
|
+
marginRight: `1%`,
|
|
91
|
+
},
|
|
92
|
+
transferTextActive: {
|
|
93
|
+
color: `#1B1F48`,
|
|
94
|
+
fontSize: Dimensions.get(`screen`).width / 22,
|
|
95
|
+
fontWeight: `bold`,
|
|
96
|
+
},
|
|
97
|
+
});
|
|
@@ -0,0 +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","Additional":"Supplerende","Blood Glucose Level":"Blodsukkerniveau","Entered":"Indtastet","Food":"Mad","Have you taken insulin within the last 4 hours?":"Har du taget insulin inden for de sidste 4 timer?","Hedia does not support insulin recommendations related to strenuous activity.":"Hedia underst\xF8tter ikke insulin anbefalinger relateret til anstrengende aktivitet.","Hedia does not support insulin recommendations with more than 300g carbohydrates present.":"Hedia underst\xF8tter ikke insulin anbefalinger hvori mere end 300g kulhydrater er tilstede.","How are you feeling?":"Hvordan har du det?","INSULIN\\nRECOMMENDATION":"INSULIN\nANBEFALING","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.","No":"Nej","OFF":"OFF","Please verify your activity interval settings are set up correctly.":"Kontroller at dine indstillinger for aktivitetsintervaller er opsat korrekt.","Recommended":"Anbefalet","Recommended amount of insulin":"Anbefalet enhed(er) af insulin","Remind me to remeasure in":"P\xE5mind mig at genm\xE5le om","Total":"Total","Transfer to logbook":"Overf\xF8r til logbog","Transfered to logbook":"Overf\xF8rt til logbok","Units":"Enheder","Yes":"Ja","g carbs":"g carbs","hours":"timer","units":"enheder"}};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"POT-Creation-Date: 2020-06-26 17:15+0200\n"
|
|
4
|
+
"Mime-Version: 1.0\n"
|
|
5
|
+
"Content-Type: text/plain; charset=utf-8\n"
|
|
6
|
+
"Content-Transfer-Encoding: 8bit\n"
|
|
7
|
+
"X-Generator: @lingui/cli\n"
|
|
8
|
+
"Language: da\n"
|
|
9
|
+
"Project-Id-Version: \n"
|
|
10
|
+
"Report-Msgid-Bugs-To: \n"
|
|
11
|
+
"PO-Revision-Date: \n"
|
|
12
|
+
"Last-Translator: \n"
|
|
13
|
+
"Language-Team: \n"
|
|
14
|
+
"Plural-Forms: \n"
|
|
15
|
+
|
|
16
|
+
#: src/RecommendationScreen.tsx:87
|
|
17
|
+
msgid "Active Insulin"
|
|
18
|
+
msgstr "Aktiv Insulin"
|
|
19
|
+
|
|
20
|
+
#: src/components/RecommendedCarbs.tsx:45
|
|
21
|
+
msgid "Additional"
|
|
22
|
+
msgstr "Supplerende"
|
|
23
|
+
|
|
24
|
+
#: src/RecommendationScreen.tsx:88
|
|
25
|
+
msgid "Blood Glucose Level"
|
|
26
|
+
msgstr "Blodsukkerniveau"
|
|
27
|
+
|
|
28
|
+
#: src/components/RecommendedCarbs.tsx:100
|
|
29
|
+
msgid "Entered"
|
|
30
|
+
msgstr "Indtastet"
|
|
31
|
+
|
|
32
|
+
#: src/components/RecommendedCarbs.tsx:99
|
|
33
|
+
msgid "Food"
|
|
34
|
+
msgstr "Mad"
|
|
35
|
+
|
|
36
|
+
#: src/components/RecentInsulin.tsx:16
|
|
37
|
+
msgid "Have you taken insulin within the last 4 hours?"
|
|
38
|
+
msgstr "Har du taget insulin inden for de sidste 4 timer?"
|
|
39
|
+
|
|
40
|
+
#: src/RecommendationError.ts:19
|
|
41
|
+
msgid "Hedia does not support insulin recommendations related to strenuous activity."
|
|
42
|
+
msgstr "Hedia understøtter ikke insulin anbefalinger relateret til anstrengende aktivitet."
|
|
43
|
+
|
|
44
|
+
#: src/RecommendationError.ts:21
|
|
45
|
+
msgid "Hedia does not support insulin recommendations with more than 300g carbohydrates present."
|
|
46
|
+
msgstr "Hedia understøtter ikke insulin anbefalinger hvori mere end 300g kulhydrater er tilstede."
|
|
47
|
+
|
|
48
|
+
#: src/components/Emotion.tsx:29
|
|
49
|
+
msgid "How are you feeling?"
|
|
50
|
+
msgstr "Hvordan har du det?"
|
|
51
|
+
|
|
52
|
+
#: src/components/Header.tsx:29
|
|
53
|
+
msgid "INSULIN\\nRECOMMENDATION"
|
|
54
|
+
msgstr ""
|
|
55
|
+
"INSULIN\n"
|
|
56
|
+
"ANBEFALING"
|
|
57
|
+
|
|
58
|
+
#: src/RecommendationError.ts:22
|
|
59
|
+
msgid "Insulin limit reached, for your safety Hedia will not recommend more than this."
|
|
60
|
+
msgstr "Insulingrænsen i Hedia er nået, for din sikkerhed vil der ikke blive anbefalet mere end dette."
|
|
61
|
+
|
|
62
|
+
#: src/components/RecentInsulin.tsx:25
|
|
63
|
+
msgid "No"
|
|
64
|
+
msgstr "Nej"
|
|
65
|
+
|
|
66
|
+
#: src/components/Remeasure.tsx:37
|
|
67
|
+
msgid "OFF"
|
|
68
|
+
msgstr "OFF"
|
|
69
|
+
|
|
70
|
+
#: src/RecommendationError.ts:20
|
|
71
|
+
msgid "Please verify your activity interval settings are set up correctly."
|
|
72
|
+
msgstr "Kontroller at dine indstillinger for aktivitetsintervaller er opsat korrekt."
|
|
73
|
+
|
|
74
|
+
#: src/components/RecommendedCarbs.tsx:42
|
|
75
|
+
msgid "Recommended"
|
|
76
|
+
msgstr "Anbefalet"
|
|
77
|
+
|
|
78
|
+
#: src/components/RecentInsulin.tsx:12
|
|
79
|
+
#: src/components/RecommendedInsulin.tsx:43
|
|
80
|
+
msgid "Recommended amount of insulin"
|
|
81
|
+
msgstr "Anbefalet enhed(er) af insulin"
|
|
82
|
+
|
|
83
|
+
#: src/components/Remeasure.tsx:33
|
|
84
|
+
msgid "Remind me to remeasure in"
|
|
85
|
+
msgstr "Påmind mig at genmåle om"
|
|
86
|
+
|
|
87
|
+
#: src/components/RecommendedCarbs.tsx:67
|
|
88
|
+
msgid "Total"
|
|
89
|
+
msgstr "Total"
|
|
90
|
+
|
|
91
|
+
#: src/components/TransferToLogbook.tsx:25
|
|
92
|
+
msgid "Transfer to logbook"
|
|
93
|
+
msgstr "Overfør til logbog"
|
|
94
|
+
|
|
95
|
+
#: src/components/TransferToLogbook.tsx:28
|
|
96
|
+
msgid "Transfered to logbook"
|
|
97
|
+
msgstr "Overført til logbok"
|
|
98
|
+
|
|
99
|
+
#: src/components/RecommendedInsulin.tsx:49
|
|
100
|
+
msgid "Units"
|
|
101
|
+
msgstr "Enheder"
|
|
102
|
+
|
|
103
|
+
#: src/components/RecentInsulin.tsx:22
|
|
104
|
+
msgid "Yes"
|
|
105
|
+
msgstr "Ja"
|
|
106
|
+
|
|
107
|
+
#: src/components/RecommendedCarbs.tsx:59
|
|
108
|
+
#: src/components/RecommendedCarbs.tsx:69
|
|
109
|
+
#: src/components/RecommendedCarbs.tsx:102
|
|
110
|
+
msgid "g carbs"
|
|
111
|
+
msgstr "g carbs"
|
|
112
|
+
|
|
113
|
+
#: src/components/Remeasure.tsx:40
|
|
114
|
+
msgid "hours"
|
|
115
|
+
msgstr "timer"
|
|
116
|
+
|
|
117
|
+
#: src/RecommendationScreen.tsx:87
|
|
118
|
+
msgid "units"
|
|
119
|
+
msgstr "enheder"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* eslint-disable */module.exports={languageData:{"plurals":function(n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"}},messages:{"Active Insulin":"Active Insulin","Additional":"Additional","Blood Glucose Level":"Blood Glucose Level","Entered":"Entered","Food":"Food","Have you taken insulin within the last 4 hours?":"Have you taken insulin within the last 4 hours?","Hedia does not support insulin recommendations related to strenuous activity.":"Hedia does not support insulin recommendations related to strenuous activity.","Hedia does not support insulin recommendations with more than 300g carbohydrates present.":"Hedia does not support insulin recommendations with more than 300g carbohydrates present.","How are you feeling?":"How are you feeling?","INSULIN\\nRECOMMENDATION":"INSULIN\nRECOMMENDATION","Insulin limit reached, for your safety Hedia will not recommend more than this.":"Insulin limit reached, for your safety Hedia will not recommend more than this.","No":"No","OFF":"OFF","Please verify your activity interval settings are set up correctly.":"Please verify your activity interval settings are set up correctly.","Recommended":"Recommended","Recommended amount of insulin":"Recommended amount of insulin","Remind me to remeasure in":"Remind me to remeasure in","Total":"Total","Transfer to logbook":"Transfer to logbook","Transfered to logbook":"Transfered to logbook","Units":"Units","Yes":"Yes","g carbs":"g carbs","hours":"hours","units":"units"}};
|