@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,110 +1,109 @@
|
|
|
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
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
this.
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
this.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
this.render = () => {
|
|
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 react_native_linear_gradient_1 = __importDefault(require("react-native-linear-gradient"));
|
|
9
|
+
const i18nUtils_1 = require("../locale/i18nUtils");
|
|
10
|
+
const RecommendationError_1 = require("../utils/RecommendationError");
|
|
11
|
+
const Utils_1 = require("../utils/Utils");
|
|
12
|
+
const Icon_1 = __importDefault(require("./Icon"));
|
|
13
|
+
const InfoBars_1 = require("./InfoBars");
|
|
14
|
+
const InvisibleNumberInput_1 = __importDefault(require("./InvisibleNumberInput"));
|
|
15
|
+
class RecommendedInsulin extends react_1.default.Component {
|
|
16
|
+
constructor(props) {
|
|
17
|
+
super(props);
|
|
18
|
+
this.handleOnPress = () => {
|
|
19
|
+
this.callbackInput?.();
|
|
20
|
+
};
|
|
21
|
+
this.updatePartially = (insulin) => {
|
|
22
|
+
const replacedZero = insulin.length > 1 && insulin.startsWith(`0`) && !insulin.startsWith(`0.`) ? insulin.substring(1) : insulin;
|
|
23
|
+
this.setState({
|
|
24
|
+
insulin: replacedZero,
|
|
25
|
+
});
|
|
26
|
+
return replacedZero;
|
|
27
|
+
};
|
|
28
|
+
this.handleUpdatedInsulin = (value) => {
|
|
29
|
+
const rounded = Utils_1.Utils.roundValue(value, this.props.injectionMethod);
|
|
30
|
+
// https://hedia.atlassian.net/browse/HDA-795
|
|
31
|
+
const limited = (1 - this.props.activityReduction) * 50;
|
|
32
|
+
if (rounded > limited) {
|
|
33
|
+
this.updatePartially(`${limited}`);
|
|
34
|
+
return this.props.onError(RecommendationError_1.InsulinLimitError);
|
|
35
|
+
}
|
|
36
|
+
this.updatePartially(`${rounded}`);
|
|
37
|
+
this.props.updateRecommendedInsulin(rounded);
|
|
38
|
+
};
|
|
39
|
+
this.render = () => {
|
|
41
40
|
return (<react_1.default.Fragment>
|
|
42
41
|
<react_native_1.TouchableOpacity accessibilityLabel="editRecommendedInsulin" onPress={this.handleOnPress}>
|
|
43
42
|
<react_native_linear_gradient_1.default style={recommendedInsulinStyles.container} colors={[`#a200ff`, `#578aff`]} start={{ x: 0, y: 0 }} end={{ x: 1, y: 0 }}>
|
|
44
43
|
<react_native_1.View style={recommendedInsulinStyles.recommendedTextContainer}>
|
|
45
44
|
<react_native_1.Text style={recommendedInsulinStyles.recommendedText}>
|
|
46
|
-
{i18nUtils_1.i18n._(
|
|
45
|
+
{i18nUtils_1.i18n._("Recommended amount of insulin")}
|
|
47
46
|
</react_native_1.Text>
|
|
48
47
|
</react_native_1.View>
|
|
49
48
|
<react_native_1.View style={recommendedInsulinStyles.recommendedContainer}>
|
|
50
49
|
<react_native_1.View style={recommendedInsulinStyles.valueContainer}>
|
|
51
50
|
<react_native_1.Text style={recommendedInsulinStyles.value}>{this.state.insulin}</react_native_1.Text>
|
|
52
|
-
<react_native_1.Text style={recommendedInsulinStyles.units}>{i18nUtils_1.i18n._(
|
|
51
|
+
<react_native_1.Text style={recommendedInsulinStyles.units}>{i18nUtils_1.i18n._("Units")}</react_native_1.Text>
|
|
53
52
|
</react_native_1.View>
|
|
54
53
|
<Icon_1.default style={recommendedInsulinStyles.editIcon} iconIdentifier={`Feather/edit`}/>
|
|
55
54
|
</react_native_1.View>
|
|
56
55
|
</react_native_linear_gradient_1.default>
|
|
57
56
|
</react_native_1.TouchableOpacity>
|
|
58
57
|
<InvisibleNumberInput_1.default decimalPlaces={3} negativeAllowed={false} cleanPartialInput={false} partialInput={this.updatePartially} onEnd={this.handleUpdatedInsulin} visible={(visible) => (this.callbackInput = visible)} startValue={`${this.state.insulin}`}/>
|
|
59
|
-
</react_1.default.Fragment>);
|
|
60
|
-
};
|
|
61
|
-
this.state = {
|
|
62
|
-
insulin: `${props.insulinRecommendation ?? 0}`,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.default = RecommendedInsulin;
|
|
67
|
-
const recommendedInsulinStyles = react_native_1.StyleSheet.create({
|
|
68
|
-
container: {
|
|
69
|
-
marginHorizontal: InfoBars_1.infoStyles.margin.margin,
|
|
70
|
-
borderRadius: 5,
|
|
71
|
-
},
|
|
72
|
-
recommendedTextContainer: {
|
|
73
|
-
flex: 1,
|
|
74
|
-
alignItems: `center`,
|
|
75
|
-
marginTop: `3%`,
|
|
76
|
-
},
|
|
77
|
-
recommendedText: {
|
|
78
|
-
color: `white`,
|
|
79
|
-
fontWeight: `bold`,
|
|
80
|
-
fontSize: react_native_1.Dimensions.get(`screen`).width / 24,
|
|
81
|
-
},
|
|
82
|
-
recommendedContainer: {
|
|
83
|
-
flex: 1,
|
|
84
|
-
flexDirection: `row`,
|
|
85
|
-
marginLeft: `10%`,
|
|
86
|
-
},
|
|
87
|
-
valueContainer: {
|
|
88
|
-
flex: 1,
|
|
89
|
-
flexDirection: `row`,
|
|
90
|
-
justifyContent: `center`,
|
|
91
|
-
},
|
|
92
|
-
value: {
|
|
93
|
-
color: `white`,
|
|
94
|
-
fontWeight: `bold`,
|
|
95
|
-
fontSize: react_native_1.Dimensions.get(`screen`).width / 5,
|
|
96
|
-
},
|
|
97
|
-
units: {
|
|
98
|
-
color: `white`,
|
|
99
|
-
fontSize: react_native_1.Dimensions.get(`screen`).width / 28,
|
|
100
|
-
textAlignVertical: `bottom`,
|
|
101
|
-
paddingBottom: `6%`,
|
|
102
|
-
},
|
|
103
|
-
editIcon: {
|
|
104
|
-
color: `white`,
|
|
105
|
-
fontSize: react_native_1.Dimensions.get(`screen`).width / 28,
|
|
106
|
-
textAlignVertical: `center`,
|
|
107
|
-
paddingBottom: `10%`,
|
|
108
|
-
marginRight: `5%`,
|
|
109
|
-
},
|
|
110
|
-
});
|
|
58
|
+
</react_1.default.Fragment>);
|
|
59
|
+
};
|
|
60
|
+
this.state = {
|
|
61
|
+
insulin: `${props.insulinRecommendation ?? 0}`,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.default = RecommendedInsulin;
|
|
66
|
+
const recommendedInsulinStyles = react_native_1.StyleSheet.create({
|
|
67
|
+
container: {
|
|
68
|
+
marginHorizontal: InfoBars_1.infoStyles.margin.margin,
|
|
69
|
+
borderRadius: 5,
|
|
70
|
+
},
|
|
71
|
+
recommendedTextContainer: {
|
|
72
|
+
flex: 1,
|
|
73
|
+
alignItems: `center`,
|
|
74
|
+
marginTop: `3%`,
|
|
75
|
+
},
|
|
76
|
+
recommendedText: {
|
|
77
|
+
color: `white`,
|
|
78
|
+
fontWeight: `bold`,
|
|
79
|
+
fontSize: react_native_1.Dimensions.get(`screen`).width / 24,
|
|
80
|
+
},
|
|
81
|
+
recommendedContainer: {
|
|
82
|
+
flex: 1,
|
|
83
|
+
flexDirection: `row`,
|
|
84
|
+
marginLeft: `10%`,
|
|
85
|
+
},
|
|
86
|
+
valueContainer: {
|
|
87
|
+
flex: 1,
|
|
88
|
+
flexDirection: `row`,
|
|
89
|
+
justifyContent: `center`,
|
|
90
|
+
},
|
|
91
|
+
value: {
|
|
92
|
+
color: `white`,
|
|
93
|
+
fontWeight: `bold`,
|
|
94
|
+
fontSize: react_native_1.Dimensions.get(`screen`).width / 5,
|
|
95
|
+
},
|
|
96
|
+
units: {
|
|
97
|
+
color: `white`,
|
|
98
|
+
fontSize: react_native_1.Dimensions.get(`screen`).width / 28,
|
|
99
|
+
textAlignVertical: `bottom`,
|
|
100
|
+
paddingBottom: `6%`,
|
|
101
|
+
},
|
|
102
|
+
editIcon: {
|
|
103
|
+
color: `white`,
|
|
104
|
+
fontSize: react_native_1.Dimensions.get(`screen`).width / 28,
|
|
105
|
+
textAlignVertical: `center`,
|
|
106
|
+
paddingBottom: `10%`,
|
|
107
|
+
marginRight: `5%`,
|
|
108
|
+
},
|
|
109
|
+
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { t } from "@lingui/macro";
|
|
2
1
|
import React from "react";
|
|
3
2
|
import { Dimensions, StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
4
3
|
import LinearGradient from "react-native-linear-gradient";
|
|
@@ -75,13 +74,13 @@ export default class RecommendedInsulin extends React.Component<IProps, IState>
|
|
|
75
74
|
>
|
|
76
75
|
<View style={recommendedInsulinStyles.recommendedTextContainer}>
|
|
77
76
|
<Text style={recommendedInsulinStyles.recommendedText}>
|
|
78
|
-
{i18n._(
|
|
77
|
+
{i18n._("Recommended amount of insulin")}
|
|
79
78
|
</Text>
|
|
80
79
|
</View>
|
|
81
80
|
<View style={recommendedInsulinStyles.recommendedContainer}>
|
|
82
81
|
<View style={recommendedInsulinStyles.valueContainer}>
|
|
83
82
|
<Text style={recommendedInsulinStyles.value}>{this.state.insulin}</Text>
|
|
84
|
-
<Text style={recommendedInsulinStyles.units}>{i18n._(
|
|
83
|
+
<Text style={recommendedInsulinStyles.units}>{i18n._("Units")}</Text>
|
|
85
84
|
</View>
|
|
86
85
|
<Icon style={recommendedInsulinStyles.editIcon} iconIdentifier={`Feather/edit`} />
|
|
87
86
|
</View>
|
|
@@ -1,13 +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 {};
|
|
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 {};
|
|
@@ -1,89 +1,88 @@
|
|
|
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
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
const limited = this.limitTime(this.props.remeasureTime);
|
|
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 slider_1 = __importDefault(require("@react-native-community/slider"));
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const i18nUtils_1 = require("../locale/i18nUtils");
|
|
10
|
+
const Constants_1 = require("../utils/Constants");
|
|
11
|
+
const InfoBars_1 = require("./InfoBars");
|
|
12
|
+
class Remeasure extends react_1.default.Component {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.handleSliderChange = (remeasureTime) => {
|
|
16
|
+
const limited = this.limitTime(remeasureTime);
|
|
17
|
+
this.setState({
|
|
18
|
+
remeasureTime: limited,
|
|
19
|
+
});
|
|
20
|
+
this.props.onSliderChange(limited);
|
|
21
|
+
};
|
|
22
|
+
this.limitTime = (remeasureTime) => {
|
|
23
|
+
return Math.min(Math.max(0, remeasureTime), 4);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
componentDidMount() {
|
|
27
|
+
this.slider.setNativeProps({
|
|
28
|
+
value: this.props.remeasureTime,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
const measure = this.props.remeasureTime > 0;
|
|
33
|
+
const limited = this.limitTime(this.props.remeasureTime);
|
|
35
34
|
return (<react_native_1.View style={remeasureStyles.container}>
|
|
36
35
|
<react_native_1.View style={remeasureStyles.borderContainer}>
|
|
37
36
|
<react_native_1.View style={remeasureStyles.remeasureContainer}>
|
|
38
|
-
<react_native_1.Text style={remeasureStyles.remeasureLabel}>{i18nUtils_1.i18n._(
|
|
37
|
+
<react_native_1.Text style={remeasureStyles.remeasureLabel}>{i18nUtils_1.i18n._("Remind me to remeasure in")}</react_native_1.Text>
|
|
39
38
|
</react_native_1.View>
|
|
40
39
|
<react_native_1.View style={remeasureStyles.valueUnitContainer}>
|
|
41
40
|
<react_native_1.View style={remeasureStyles.valueContainer}>
|
|
42
|
-
<react_native_1.Text style={remeasureStyles.value}>{measure ? limited : i18nUtils_1.i18n._(
|
|
41
|
+
<react_native_1.Text style={remeasureStyles.value}>{measure ? limited : i18nUtils_1.i18n._("OFF")}</react_native_1.Text>
|
|
43
42
|
</react_native_1.View>
|
|
44
43
|
<react_native_1.View style={remeasureStyles.unitContainer}>
|
|
45
|
-
<react_native_1.Text style={remeasureStyles.units}>{measure ? i18nUtils_1.i18n._(
|
|
44
|
+
<react_native_1.Text style={remeasureStyles.units}>{measure ? i18nUtils_1.i18n._("hours") : ``}</react_native_1.Text>
|
|
46
45
|
</react_native_1.View>
|
|
47
46
|
</react_native_1.View>
|
|
48
47
|
</react_native_1.View>
|
|
49
48
|
<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
|
-
});
|
|
49
|
+
</react_native_1.View>);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.default = Remeasure;
|
|
53
|
+
const remeasureStyles = react_native_1.StyleSheet.create({
|
|
54
|
+
container: {
|
|
55
|
+
flexDirection: `column`,
|
|
56
|
+
},
|
|
57
|
+
borderContainer: {
|
|
58
|
+
...InfoBars_1.infoStyles.borderContainer,
|
|
59
|
+
alignItems: `center`,
|
|
60
|
+
},
|
|
61
|
+
remeasureContainer: {
|
|
62
|
+
flex: 7,
|
|
63
|
+
},
|
|
64
|
+
remeasureLabel: {
|
|
65
|
+
color: `white`,
|
|
66
|
+
fontSize: react_native_1.Dimensions.get(`screen`).width / 25,
|
|
67
|
+
fontWeight: `bold`,
|
|
68
|
+
},
|
|
69
|
+
valueUnitContainer: {
|
|
70
|
+
...InfoBars_1.infoStyles.valueUnitContainer,
|
|
71
|
+
},
|
|
72
|
+
valueContainer: {
|
|
73
|
+
...InfoBars_1.infoStyles.valueContainer,
|
|
74
|
+
},
|
|
75
|
+
value: {
|
|
76
|
+
...InfoBars_1.infoStyles.value,
|
|
77
|
+
},
|
|
78
|
+
unitContainer: {
|
|
79
|
+
...InfoBars_1.infoStyles.unitContainer,
|
|
80
|
+
},
|
|
81
|
+
units: {
|
|
82
|
+
...InfoBars_1.infoStyles.units,
|
|
83
|
+
},
|
|
84
|
+
sliderStyle: {
|
|
85
|
+
marginTop: `3%`,
|
|
86
|
+
marginBottom: `2%`,
|
|
87
|
+
},
|
|
88
|
+
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { t } from "@lingui/macro";
|
|
2
1
|
import Slider from "@react-native-community/slider";
|
|
3
2
|
import React from "react";
|
|
4
3
|
import { Dimensions, StyleSheet, Text, View } from "react-native";
|
|
@@ -39,14 +38,14 @@ export default class Remeasure extends React.Component<IProps, null> {
|
|
|
39
38
|
<View style={remeasureStyles.container}>
|
|
40
39
|
<View style={remeasureStyles.borderContainer}>
|
|
41
40
|
<View style={remeasureStyles.remeasureContainer}>
|
|
42
|
-
<Text style={remeasureStyles.remeasureLabel}>{i18n._(
|
|
41
|
+
<Text style={remeasureStyles.remeasureLabel}>{i18n._("Remind me to remeasure in")}</Text>
|
|
43
42
|
</View>
|
|
44
43
|
<View style={remeasureStyles.valueUnitContainer}>
|
|
45
44
|
<View style={remeasureStyles.valueContainer}>
|
|
46
|
-
<Text style={remeasureStyles.value}>{measure ? limited : i18n._(
|
|
45
|
+
<Text style={remeasureStyles.value}>{measure ? limited : i18n._("OFF")}</Text>
|
|
47
46
|
</View>
|
|
48
47
|
<View style={remeasureStyles.unitContainer}>
|
|
49
|
-
<Text style={remeasureStyles.units}>{measure ? i18n._(
|
|
48
|
+
<Text style={remeasureStyles.units}>{measure ? i18n._("hours") : ``}</Text>
|
|
50
49
|
</View>
|
|
51
50
|
</View>
|
|
52
51
|
</View>
|
|
@@ -1,14 +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 {};
|
|
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 {};
|
|
@@ -1,81 +1,80 @@
|
|
|
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
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
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 i18nUtils_1 = require("../locale/i18nUtils");
|
|
9
|
+
const Icon_1 = __importDefault(require("./Icon"));
|
|
10
|
+
class TransferToLogbook extends react_1.default.Component {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.state = {
|
|
14
|
+
pressed: false,
|
|
15
|
+
};
|
|
16
|
+
this.handlePress = () => {
|
|
17
|
+
this.setState({
|
|
18
|
+
pressed: !this.state.pressed,
|
|
19
|
+
});
|
|
20
|
+
this.props.transfer();
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
if (!this.props.visible) {
|
|
25
|
+
return <react_native_1.View style={addToLogbookStyles.marginContainer}/>;
|
|
26
|
+
}
|
|
28
27
|
return (<react_native_1.TouchableOpacity onPress={this.handlePress} style={addToLogbookStyles.container} accessibilityLabel="transferToLogbook">
|
|
29
28
|
{!this.state.pressed ? (<react_native_1.View style={addToLogbookStyles.textContainer}>
|
|
30
|
-
<react_native_1.Text style={addToLogbookStyles.transferText}>{i18nUtils_1.i18n._(
|
|
29
|
+
<react_native_1.Text style={addToLogbookStyles.transferText}>{i18nUtils_1.i18n._("Transfer to logbook")}</react_native_1.Text>
|
|
31
30
|
</react_native_1.View>) : (<react_native_1.View style={addToLogbookStyles.textContainerActive}>
|
|
32
31
|
<Icon_1.default style={addToLogbookStyles.icon} iconIdentifier={`Feather/check`}/>
|
|
33
|
-
<react_native_1.Text style={addToLogbookStyles.transferTextActive}>{i18nUtils_1.i18n._(
|
|
32
|
+
<react_native_1.Text style={addToLogbookStyles.transferTextActive}>{i18nUtils_1.i18n._("Transfered to logbook")}</react_native_1.Text>
|
|
34
33
|
</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
|
-
});
|
|
34
|
+
</react_native_1.TouchableOpacity>);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.default = TransferToLogbook;
|
|
38
|
+
const addToLogbookStyles = react_native_1.StyleSheet.create({
|
|
39
|
+
marginContainer: {
|
|
40
|
+
marginVertical: `3%`,
|
|
41
|
+
},
|
|
42
|
+
container: {
|
|
43
|
+
flex: 1,
|
|
44
|
+
margin: `5%`,
|
|
45
|
+
},
|
|
46
|
+
textContainer: {
|
|
47
|
+
flexDirection: `row`,
|
|
48
|
+
justifyContent: `center`,
|
|
49
|
+
borderWidth: 1,
|
|
50
|
+
borderRadius: 100,
|
|
51
|
+
marginHorizontal: `4%`,
|
|
52
|
+
paddingVertical: `4%`,
|
|
53
|
+
borderColor: `#01FFFC`,
|
|
54
|
+
},
|
|
55
|
+
transferText: {
|
|
56
|
+
color: `#01FFFC`,
|
|
57
|
+
fontSize: react_native_1.Dimensions.get(`screen`).width / 22,
|
|
58
|
+
fontWeight: `bold`,
|
|
59
|
+
},
|
|
60
|
+
textContainerActive: {
|
|
61
|
+
flexDirection: `row`,
|
|
62
|
+
backgroundColor: `#01FFFC`,
|
|
63
|
+
justifyContent: `center`,
|
|
64
|
+
borderWidth: 1,
|
|
65
|
+
borderRadius: 100,
|
|
66
|
+
marginHorizontal: `4%`,
|
|
67
|
+
paddingVertical: `4%`,
|
|
68
|
+
},
|
|
69
|
+
icon: {
|
|
70
|
+
paddingTop: `1.3%`,
|
|
71
|
+
color: `#1B1F48`,
|
|
72
|
+
fontSize: react_native_1.Dimensions.get(`screen`).width / 22,
|
|
73
|
+
marginRight: `1%`,
|
|
74
|
+
},
|
|
75
|
+
transferTextActive: {
|
|
76
|
+
color: `#1B1F48`,
|
|
77
|
+
fontSize: react_native_1.Dimensions.get(`screen`).width / 22,
|
|
78
|
+
fontWeight: `bold`,
|
|
79
|
+
},
|
|
80
|
+
});
|