@hedia/recommendation-screen 1.0.0 → 1.0.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/Changelog.md +8 -4
- package/README.md +3 -3
- package/android/app/BUCK +55 -55
- package/android/app/build.gradle +225 -225
- package/android/app/build_defs.bzl +19 -19
- package/android/app/proguard-rules.pro +10 -10
- package/android/app/src/debug/AndroidManifest.xml +8 -8
- package/android/app/src/debug/java/com/hediarecommendationscreen/ReactNativeFlipper.java +72 -72
- package/android/app/src/main/AndroidManifest.xml +27 -27
- package/android/app/src/main/java/com/hediarecommendationscreen/MainActivity.java +15 -15
- package/android/app/src/main/java/com/hediarecommendationscreen/MainApplication.java +80 -80
- package/android/app/src/main/res/values/strings.xml +3 -3
- package/android/app/src/main/res/values/styles.xml +9 -9
- package/android/build.gradle +38 -38
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -5
- package/android/gradle.properties +28 -28
- package/android/gradlew +188 -188
- package/android/settings.gradle +3 -3
- package/index.d.ts +5 -5
- package/index.js +16 -16
- package/ios/HediaRecommendationScreen/AppDelegate.h +8 -8
- package/ios/HediaRecommendationScreen/AppDelegate.m +58 -58
- package/ios/HediaRecommendationScreen/Base.lproj/LaunchScreen.xib +42 -42
- package/ios/HediaRecommendationScreen/Images.xcassets/AppIcon.appiconset/Contents.json +37 -37
- package/ios/HediaRecommendationScreen/Images.xcassets/Contents.json +6 -6
- package/ios/HediaRecommendationScreen/Info.plist +57 -57
- package/ios/HediaRecommendationScreen/main.m +9 -9
- package/ios/HediaRecommendationScreen-tvOS/Info.plist +53 -53
- package/ios/HediaRecommendationScreen-tvOSTests/Info.plist +24 -24
- package/ios/HediaRecommendationScreen.xcodeproj/project.pbxproj +807 -807
- package/ios/HediaRecommendationScreen.xcodeproj/xcshareddata/xcschemes/HediaRecommendationScreen-tvOS.xcscheme +88 -88
- package/ios/HediaRecommendationScreen.xcodeproj/xcshareddata/xcschemes/HediaRecommendationScreen.xcscheme +88 -88
- package/ios/HediaRecommendationScreenTests/HediaRecommendationScreenTests.m +65 -65
- package/ios/HediaRecommendationScreenTests/Info.plist +24 -24
- package/ios/Podfile +104 -104
- package/package.json +1 -3
- package/src/RecommendationScreen.d.ts +42 -42
- package/src/RecommendationScreen.js +126 -127
- package/src/RecommendationScreen.tsx +3 -4
- package/src/components/Emotion.d.ts +14 -14
- package/src/components/Emotion.js +50 -51
- package/src/components/Emotion.tsx +1 -2
- package/src/components/Header.d.ts +52 -52
- package/src/components/Header.js +63 -64
- package/src/components/Header.tsx +1 -2
- package/src/components/Icon.js +41 -41
- package/src/components/InfoBars.d.ts +67 -67
- package/src/components/InfoBars.js +71 -71
- package/src/components/InvisibleNumberInput.d.ts +24 -24
- package/src/components/InvisibleNumberInput.js +64 -64
- package/src/components/MoodIcon.d.ts +14 -14
- package/src/components/MoodIcon.js +51 -51
- package/src/components/RecentInsulin.d.ts +9 -9
- package/src/components/RecentInsulin.js +75 -76
- package/src/components/RecentInsulin.tsx +4 -5
- package/src/components/RecommendedCarbs.d.ts +30 -30
- package/src/components/RecommendedCarbs.js +146 -147
- package/src/components/RecommendedCarbs.tsx +8 -9
- package/src/components/RecommendedInsulin.d.ts +22 -22
- package/src/components/RecommendedInsulin.js +93 -94
- package/src/components/RecommendedInsulin.tsx +2 -3
- package/src/components/Remeasure.d.ts +13 -13
- package/src/components/Remeasure.js +76 -77
- package/src/components/Remeasure.tsx +3 -4
- package/src/components/TransferToLogbook.d.ts +14 -14
- package/src/components/TransferToLogbook.js +75 -76
- package/src/components/TransferToLogbook.tsx +2 -3
- package/src/locale/da/messages.js +1 -1
- package/src/locale/da/messages.po +31 -29
- package/src/locale/en/messages.js +1 -1
- package/src/locale/en/messages.po +32 -30
- package/src/locale/i18nUtils.d.ts +5 -5
- package/src/locale/i18nUtils.js +22 -22
- package/src/types/enum.d.ts +26 -26
- package/src/types/enum.js +34 -34
- package/src/types/types.d.ts +21 -21
- package/src/types/types.js +2 -2
- package/src/utils/Constants.d.ts +3 -3
- package/src/utils/Constants.js +6 -6
- package/src/utils/RecommendationError.d.ts +9 -9
- package/src/utils/RecommendationError.js +16 -17
- package/src/utils/RecommendationError.ts +4 -6
- package/src/utils/Utils.d.ts +5 -5
- package/src/utils/Utils.js +24 -24
- package/.prettierignore +0 -2
- package/index-git.sh +0 -5
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { t } from "@lingui/macro";
|
|
2
1
|
import { i18n } from "../locale/i18nUtils";
|
|
3
2
|
import { RecommendationErrorEnum } from "../types/enum";
|
|
4
3
|
|
|
@@ -12,19 +11,18 @@ export class RecommendationError extends Error {
|
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
export const ActivityRangeError = new RecommendationError(
|
|
15
|
-
i18n._(
|
|
14
|
+
i18n._("Hedia does not support insulin recommendations related to strenuous activity."),
|
|
16
15
|
RecommendationErrorEnum.ActivityOutOfRange,
|
|
17
16
|
);
|
|
18
17
|
export const ActivityNullError = new RecommendationError(
|
|
19
|
-
i18n._(
|
|
18
|
+
i18n._("Please verify your activity interval settings are set up correctly."),
|
|
20
19
|
RecommendationErrorEnum.ActivityNull,
|
|
21
20
|
);
|
|
22
|
-
|
|
23
21
|
export const CarbohydrateLimitError = new RecommendationError(
|
|
24
|
-
i18n._(
|
|
22
|
+
i18n._("Hedia does not support insulin recommendations with more than 300g carbohydrates present."),
|
|
25
23
|
RecommendationErrorEnum.CarbohydrateLimit,
|
|
26
24
|
);
|
|
27
25
|
export const InsulinLimitError = new RecommendationError(
|
|
28
|
-
i18n._(
|
|
26
|
+
i18n._("Insulin limit reached, for your safety Hedia will not recommend more than this."),
|
|
29
27
|
RecommendationErrorEnum.InsulinLimit,
|
|
30
28
|
);
|
package/src/utils/Utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InjectionMethod } from "../types/enum";
|
|
2
|
-
export declare class Utils {
|
|
3
|
-
static getRounding(method: InjectionMethod): 2 | 10 | 1;
|
|
4
|
-
static roundValue(value: number, injectMethod: InjectionMethod): number;
|
|
5
|
-
}
|
|
1
|
+
import { InjectionMethod } from "../types/enum";
|
|
2
|
+
export declare class Utils {
|
|
3
|
+
static getRounding(method: InjectionMethod): 2 | 10 | 1;
|
|
4
|
+
static roundValue(value: number, injectMethod: InjectionMethod): number;
|
|
5
|
+
}
|
package/src/utils/Utils.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Utils = void 0;
|
|
4
|
-
const enum_1 = require("../types/enum");
|
|
5
|
-
class Utils {
|
|
6
|
-
static getRounding(method) {
|
|
7
|
-
switch (method) {
|
|
8
|
-
case enum_1.InjectionMethod.PenWhole:
|
|
9
|
-
return 1;
|
|
10
|
-
case enum_1.InjectionMethod.PenHalf:
|
|
11
|
-
return 2;
|
|
12
|
-
case enum_1.InjectionMethod.Pump:
|
|
13
|
-
return 10;
|
|
14
|
-
default:
|
|
15
|
-
throw Error(`Unsupported InjectionMethod: ${method}`);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
static roundValue(value, injectMethod) {
|
|
19
|
-
const rounding = Utils.getRounding(injectMethod);
|
|
20
|
-
const rounded = Math.round(value * rounding) / rounding;
|
|
21
|
-
return rounded;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.Utils = Utils;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Utils = void 0;
|
|
4
|
+
const enum_1 = require("../types/enum");
|
|
5
|
+
class Utils {
|
|
6
|
+
static getRounding(method) {
|
|
7
|
+
switch (method) {
|
|
8
|
+
case enum_1.InjectionMethod.PenWhole:
|
|
9
|
+
return 1;
|
|
10
|
+
case enum_1.InjectionMethod.PenHalf:
|
|
11
|
+
return 2;
|
|
12
|
+
case enum_1.InjectionMethod.Pump:
|
|
13
|
+
return 10;
|
|
14
|
+
default:
|
|
15
|
+
throw Error(`Unsupported InjectionMethod: ${method}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
static roundValue(value, injectMethod) {
|
|
19
|
+
const rounding = Utils.getRounding(injectMethod);
|
|
20
|
+
const rounded = Math.round(value * rounding) / rounding;
|
|
21
|
+
return rounded;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.Utils = Utils;
|
package/.prettierignore
DELETED