@hedia/recommendation-screen 2.1.33 → 2.1.34-alpha.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/ios/HediaRecommendationScreen.xcodeproj/project.pbxproj +2 -2
- package/ios/Podfile.lock +207 -207
- package/package.json +1 -1
- package/index.d.ts +0 -5
- package/index.js +0 -5
- package/src/RecommendationScreen.d.ts +0 -413
- package/src/RecommendationScreen.js +0 -493
- package/src/__tests__/RecommendationScreen.test.d.ts +0 -1
- package/src/__tests__/RecommendationScreen.test.js +0 -965
- package/src/__tests__/RecommendationUtils.test.d.ts +0 -1
- package/src/__tests__/RecommendationUtils.test.js +0 -216
- package/src/__tests__/Translate.test.d.ts +0 -1
- package/src/__tests__/Translate.test.js +0 -27
- package/src/__tests__/Utils.test.d.ts +0 -1
- package/src/__tests__/Utils.test.js +0 -66
- package/src/__tests__/Validations.test.d.ts +0 -1
- package/src/__tests__/Validations.test.js +0 -465
- package/src/__tests__/components/Activity.test.d.ts +0 -1
- package/src/__tests__/components/Activity.test.js +0 -86
- package/src/__tests__/components/Emotion.test.d.ts +0 -1
- package/src/__tests__/components/Emotion.test.js +0 -70
- package/src/__tests__/components/Header.test.d.ts +0 -1
- package/src/__tests__/components/Header.test.js +0 -36
- package/src/__tests__/components/InfoBars.test.d.ts +0 -1
- package/src/__tests__/components/InfoBars.test.js +0 -130
- package/src/__tests__/components/InvisibleNumberInput.test.d.ts +0 -1
- package/src/__tests__/components/InvisibleNumberInput.test.js +0 -160
- package/src/__tests__/components/LimitationMessage.test.d.ts +0 -1
- package/src/__tests__/components/LimitationMessage.test.js +0 -47
- package/src/__tests__/components/MoodIcon.test.d.ts +0 -1
- package/src/__tests__/components/MoodIcon.test.js +0 -30
- package/src/__tests__/components/RecommendationModal.test.d.ts +0 -1
- package/src/__tests__/components/RecommendationModal.test.js +0 -98
- package/src/__tests__/components/RecommendedCarbs.test.d.ts +0 -1
- package/src/__tests__/components/RecommendedCarbs.test.js +0 -120
- package/src/__tests__/components/RecommendedInsulin.test.d.ts +0 -1
- package/src/__tests__/components/RecommendedInsulin.test.js +0 -154
- package/src/__tests__/components/Remeasure.test.d.ts +0 -1
- package/src/__tests__/components/Remeasure.test.js +0 -78
- package/src/__tests__/components/TransferToLogbook.test.d.ts +0 -1
- package/src/__tests__/components/TransferToLogbook.test.js +0 -30
- package/src/__tests__/components/TwoOptionModal.test.d.ts +0 -1
- package/src/__tests__/components/TwoOptionModal.test.js +0 -65
- package/src/__tests__/utils.d.ts +0 -16
- package/src/__tests__/utils.js +0 -126
- package/src/components/Header.d.ts +0 -10
- package/src/components/Header.js +0 -75
- package/src/components/Icon.d.ts +0 -20
- package/src/components/Icon.js +0 -41
- package/src/components/InfoBars.d.ts +0 -103
- package/src/components/InfoBars.js +0 -129
- package/src/components/InvisibleNumberInput.d.ts +0 -89
- package/src/components/InvisibleNumberInput.js +0 -122
- package/src/components/LimitationMessage.d.ts +0 -14
- package/src/components/LimitationMessage.js +0 -31
- package/src/components/LineSeparator.d.ts +0 -10
- package/src/components/LineSeparator.js +0 -18
- package/src/components/RecentInsulin.d.ts +0 -17
- package/src/components/RecentInsulin.js +0 -94
- package/src/components/RecommendationModal.d.ts +0 -207
- package/src/components/RecommendationModal.js +0 -213
- package/src/components/RecommendedCarbs.d.ts +0 -94
- package/src/components/RecommendedCarbs.js +0 -251
- package/src/components/RecommendedInsulin.d.ts +0 -84
- package/src/components/RecommendedInsulin.js +0 -170
- package/src/components/Remeasure.d.ts +0 -49
- package/src/components/Remeasure.js +0 -125
- package/src/components/TransferToLogbook.d.ts +0 -34
- package/src/components/TransferToLogbook.js +0 -94
- package/src/components/TwoOptionModal.d.ts +0 -145
- package/src/components/TwoOptionModal.js +0 -148
- package/src/components/activity/Activity.d.ts +0 -26
- package/src/components/activity/Activity.js +0 -80
- package/src/components/activity/ActivityIcon.d.ts +0 -22
- package/src/components/activity/ActivityIcon.js +0 -58
- package/src/components/activity/ActivityIntensity.d.ts +0 -16
- package/src/components/activity/ActivityIntensity.js +0 -59
- package/src/components/mood/Emotion.d.ts +0 -38
- package/src/components/mood/Emotion.js +0 -65
- package/src/components/mood/MoodIcon.d.ts +0 -40
- package/src/components/mood/MoodIcon.js +0 -66
- package/src/locale/i18nUtils.d.ts +0 -18
- package/src/locale/i18nUtils.js +0 -39
- package/src/types/enum.d.ts +0 -122
- package/src/types/enum.js +0 -138
- package/src/types/types.d.ts +0 -17
- package/src/types/types.js +0 -1
- package/src/utils/AttentionMessages.d.ts +0 -96
- package/src/utils/AttentionMessages.js +0 -118
- package/src/utils/Constants.d.ts +0 -47
- package/src/utils/Constants.js +0 -47
- package/src/utils/RecommendationError.d.ts +0 -56
- package/src/utils/RecommendationError.js +0 -62
- package/src/utils/RecommendationUtils.d.ts +0 -100
- package/src/utils/RecommendationUtils.js +0 -199
- package/src/utils/Translations.d.ts +0 -9
- package/src/utils/Translations.js +0 -14
- package/src/utils/Utils.d.ts +0 -105
- package/src/utils/Utils.js +0 -141
- package/src/utils/Validations.d.ts +0 -250
- package/src/utils/Validations.js +0 -409
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
import { t } from "@lingui/macro";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { Alert, Dimensions, StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
4
|
-
import { i18n } from "../locale/i18nUtils";
|
|
5
|
-
import { Testing } from "../types/enum";
|
|
6
|
-
import { BORDER_COLOUR_GREY, BORDER_COLOUR_TEAL } from "../utils/Constants";
|
|
7
|
-
import { CarbohydrateLimitError } from "../utils/RecommendationError";
|
|
8
|
-
import Icon from "./Icon";
|
|
9
|
-
import { infoStyles } from "./InfoBars";
|
|
10
|
-
import InvisibleNumberInput from "./InvisibleNumberInput";
|
|
11
|
-
import LineSeparator from "./LineSeparator";
|
|
12
|
-
const { RecommendedCarbsTestIds } = Testing.Id;
|
|
13
|
-
/**
|
|
14
|
-
* The contents of the RecommendedCarbs component may vary quite a bit depending on data that was entered by the user
|
|
15
|
-
* and on the result of the recommendation calculation.
|
|
16
|
-
* For instance the part of the component that displays any recommendation of eating additional carbohydrates
|
|
17
|
-
* (composed by the renderRecommendedCarbs() method) will only be visible if it is actually recommended that the user eats additional carbohydrates.
|
|
18
|
-
*/
|
|
19
|
-
export default class RecommendedCarbs extends React.Component {
|
|
20
|
-
constructor() {
|
|
21
|
-
super(...arguments);
|
|
22
|
-
/** Initialise the state partialInput variable with undefined */
|
|
23
|
-
this.state = {
|
|
24
|
-
partialInput: undefined,
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Handle what should happen when the additional carbohydrates amount has been pressed.
|
|
28
|
-
* Uses the InvisibleNumberInput child component to enable the user to input the amount of additional carbohydrates that they are taking.
|
|
29
|
-
*/
|
|
30
|
-
this.showTextInput = () => {
|
|
31
|
-
this.callbackInput?.();
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Passed to the InvisibleNumberInput child component as a callback function to be called every time the content of the input field changes.
|
|
35
|
-
*
|
|
36
|
-
* Steps:
|
|
37
|
-
* 1. Save partialInput argument to the partialInput state variable.
|
|
38
|
-
* @param partialInput The contents of the input field.
|
|
39
|
-
*/
|
|
40
|
-
this.handlePartialInput = (partialInput) => {
|
|
41
|
-
this.setState({
|
|
42
|
-
partialInput,
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Handle what happens when input in the InvisibleNumberInput child component is completed.
|
|
47
|
-
*
|
|
48
|
-
* Steps:
|
|
49
|
-
* 1. If the carbs argument is greater than or equal to 0:
|
|
50
|
-
* - If the carbs argument is greater than 300:
|
|
51
|
-
* - Set the partialInput state variable to the value of the recommemdedCarbs prop.
|
|
52
|
-
* - Return - An alert message with the message of CarbohydrateLimitError() and with an OK button for closing it.
|
|
53
|
-
* - Use carbs as argument to call the changedRecommendedCarbs prop callback function.
|
|
54
|
-
|
|
55
|
-
* @param carbs The numerical value of the input field at completion.
|
|
56
|
-
* @returns void
|
|
57
|
-
*/
|
|
58
|
-
this.handleChangedCarbs = (carbs) => {
|
|
59
|
-
if (carbs >= 0) {
|
|
60
|
-
if (carbs > 300) {
|
|
61
|
-
this.setState({ partialInput: this.props.recommendedCarbs });
|
|
62
|
-
return Alert.alert(i18n._(t `Attention`), CarbohydrateLimitError().message, [
|
|
63
|
-
{
|
|
64
|
-
text: i18n._(t `OK`),
|
|
65
|
-
},
|
|
66
|
-
]);
|
|
67
|
-
}
|
|
68
|
-
this.props.changedRecommendedCarbs(carbs);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Render the section of the component that displays the extra carbs that the user should eat
|
|
73
|
-
* and allows the user to change the contents to indicate how many extra carbs they are actually going to eat.
|
|
74
|
-
*
|
|
75
|
-
* Steps:
|
|
76
|
-
* 1. Set a variable named shownCarbs to the partialInput state if it is set, or to the recommendedCarbs prop rounded to the nearest integer otherwise.
|
|
77
|
-
* 2. Set a variable named totalCarbs to the sum of the enteredCarbs prop and shownCarbs rounded to the nearest integer.
|
|
78
|
-
* 3. Compose and return a JSX element consisting of the following sub-components
|
|
79
|
-
* - A cancel button to remove recommended carbs from the calculation - When tapped, call the removeRecommendedCarbs prop callback function.
|
|
80
|
-
* - The text from the shownCarbs variable from step 1 - When tapped, call the showTextInput() method.
|
|
81
|
-
* - Use renderRow() to display the value of totalCarbs.
|
|
82
|
-
* - InvisibleNumberInput for showing the keyboard to enable the user to enter a number.
|
|
83
|
-
*/
|
|
84
|
-
this.renderRecommendedCarbs = () => {
|
|
85
|
-
const shownCarbs = this.state.partialInput ?? Math.round(Number(this.props.recommendedCarbs));
|
|
86
|
-
const totalCarbs = Math.round(parseFloat(this.props.enteredCarbs) + Number(shownCarbs));
|
|
87
|
-
return (<React.Fragment>
|
|
88
|
-
<LineSeparator color={BORDER_COLOUR_GREY}/>
|
|
89
|
-
<View style={calculationStyles.borderContainer}>
|
|
90
|
-
<View style={calculationStyles.recommendedContainer}>
|
|
91
|
-
<TouchableOpacity testID={RecommendedCarbsTestIds.RemoveRecommendation} accessibilityLabel="removeRecommendedCarbs" style={calculationStyles.removeRecommended} onPress={this.props.removeRecommendedCarbs}>
|
|
92
|
-
<Icon iconIdentifier={`Ionicons/ios-close-circle-outline`} style={calculationStyles.removeRecommendedIcon}/>
|
|
93
|
-
</TouchableOpacity>
|
|
94
|
-
<Text style={calculationStyles.recommendedLabel}>{i18n._(t `Recommended`)}</Text>
|
|
95
|
-
</View>
|
|
96
|
-
</View>
|
|
97
|
-
<View style={calculationStyles.borderContainer}>
|
|
98
|
-
<View style={calculationStyles.recommendedContainer}>
|
|
99
|
-
<Text style={calculationStyles.recommendedLabel}>{i18n._(t `Additional`)}</Text>
|
|
100
|
-
</View>
|
|
101
|
-
<View style={calculationStyles.valueUnitContainer}>
|
|
102
|
-
<TouchableOpacity testID={RecommendedCarbsTestIds.EditRecommendedCarbs} accessibilityLabel="editRecommendedCarbsButton" onPress={this.showTextInput} style={[calculationStyles.valueUnitContainer]}>
|
|
103
|
-
<View style={calculationStyles.valueContainer}>
|
|
104
|
-
<Text testID={RecommendedCarbsTestIds.RecommendedCarbs} style={[calculationStyles.value, { color: BORDER_COLOUR_TEAL }]}>
|
|
105
|
-
{shownCarbs}
|
|
106
|
-
</Text>
|
|
107
|
-
</View>
|
|
108
|
-
<View style={[calculationStyles.unitContainer]}>
|
|
109
|
-
<View style={calculationStyles.editIconContainer}>
|
|
110
|
-
<Icon style={calculationStyles.editIcon} iconIdentifier={`Feather/edit`}/>
|
|
111
|
-
</View>
|
|
112
|
-
<Text style={[calculationStyles.units, { color: BORDER_COLOUR_TEAL }]}>
|
|
113
|
-
{i18n._(t `grams`)}
|
|
114
|
-
</Text>
|
|
115
|
-
</View>
|
|
116
|
-
</TouchableOpacity>
|
|
117
|
-
</View>
|
|
118
|
-
</View>
|
|
119
|
-
<LineSeparator color={BORDER_COLOUR_TEAL}/>
|
|
120
|
-
{this.renderRow({
|
|
121
|
-
label: i18n._(t `Total`),
|
|
122
|
-
value: totalCarbs.toString(),
|
|
123
|
-
units: i18n._(t `grams`),
|
|
124
|
-
}, RecommendedCarbsTestIds.TotalCarbs)}
|
|
125
|
-
<InvisibleNumberInput testID={RecommendedCarbsTestIds.InvisibleCarbInput} negativeAllowed={false} cleanPartialInput={true} decimalPlaces={0} visible={(callback) => (this.callbackInput = callback)} partialInput={this.handlePartialInput} onEnd={this.handleChangedCarbs} startValue={this.props.recommendedCarbs} maxLength={3}/>
|
|
126
|
-
</React.Fragment>);
|
|
127
|
-
};
|
|
128
|
-
/**
|
|
129
|
-
* Display a row of information for the user. Specifically used to display the amount of carbohydrates that the user has entered.
|
|
130
|
-
* @param row The values to display
|
|
131
|
-
* @param testID Id used for component testing
|
|
132
|
-
* @returns A JSX element to display 3 strings on the screen: label, value, and a unit.
|
|
133
|
-
*/
|
|
134
|
-
this.renderRow = (row, testID) => {
|
|
135
|
-
return (<View style={[calculationStyles.borderContainer, { paddingVertical: `1%` }]}>
|
|
136
|
-
<View style={calculationStyles.rowContainer}>
|
|
137
|
-
<Text style={calculationStyles.rowLabel}>{row.label}</Text>
|
|
138
|
-
</View>
|
|
139
|
-
<View style={calculationStyles.valueUnitContainer}>
|
|
140
|
-
<View style={calculationStyles.valueContainer}>
|
|
141
|
-
<Text testID={testID} style={calculationStyles.value}>
|
|
142
|
-
{row.value}
|
|
143
|
-
</Text>
|
|
144
|
-
</View>
|
|
145
|
-
<View style={calculationStyles.unitContainer}>
|
|
146
|
-
<Text style={calculationStyles.units}>{row.units}</Text>
|
|
147
|
-
</View>
|
|
148
|
-
</View>
|
|
149
|
-
</View>);
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Steps:
|
|
154
|
-
* 1. Convert the recommendedCarbs prop to a number and save that as a variable named carbs.
|
|
155
|
-
* 2. Use renderRow() to display the user’s entered amount of carbohydrates
|
|
156
|
-
* 3. If carbs is not a NaN-value and it is positive, call renderRecommendedCarbs() to display the carbohydrate recommendation.
|
|
157
|
-
*/
|
|
158
|
-
render() {
|
|
159
|
-
const carbs = Number(this.props.recommendedCarbs);
|
|
160
|
-
return (<React.Fragment>
|
|
161
|
-
<View style={calculationStyles.foodTitleContainer}>
|
|
162
|
-
<Text style={infoStyles.label}>{i18n._(t `Food`)}</Text>
|
|
163
|
-
<Text style={calculationStyles.foodUnitsLabel}>{`(${i18n._(t `Carbohydrates`)})`}</Text>
|
|
164
|
-
</View>
|
|
165
|
-
{this.renderRow({
|
|
166
|
-
label: i18n._(t `Entered`),
|
|
167
|
-
value: this.props.enteredCarbs,
|
|
168
|
-
units: i18n._(t `grams`),
|
|
169
|
-
}, RecommendedCarbsTestIds.EnteredCarbs)}
|
|
170
|
-
{!isNaN(carbs) && carbs > 0 ? this.renderRecommendedCarbs() : null}
|
|
171
|
-
</React.Fragment>);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
const calculationStyles = StyleSheet.create({
|
|
175
|
-
borderContainer: {
|
|
176
|
-
...infoStyles.borderContainer,
|
|
177
|
-
alignItems: `center`,
|
|
178
|
-
},
|
|
179
|
-
foodTitleContainer: {
|
|
180
|
-
flex: infoStyles.borderContainer.flex,
|
|
181
|
-
flexDirection: infoStyles.borderContainer.flexDirection,
|
|
182
|
-
paddingHorizontal: infoStyles.borderContainer.paddingHorizontal,
|
|
183
|
-
alignItems: `center`,
|
|
184
|
-
paddingVertical: `2%`,
|
|
185
|
-
},
|
|
186
|
-
foodUnitsLabel: {
|
|
187
|
-
...infoStyles.units,
|
|
188
|
-
color: `rgba(160, 180, 240, 1)`,
|
|
189
|
-
paddingLeft: `1%`,
|
|
190
|
-
},
|
|
191
|
-
rowContainer: {
|
|
192
|
-
flex: 7,
|
|
193
|
-
},
|
|
194
|
-
rowLabel: {
|
|
195
|
-
color: `white`,
|
|
196
|
-
fontSize: Dimensions.get(`screen`).width / 25,
|
|
197
|
-
fontWeight: `bold`,
|
|
198
|
-
},
|
|
199
|
-
enteredContainer: {
|
|
200
|
-
flex: 3,
|
|
201
|
-
alignItems: `flex-end`,
|
|
202
|
-
},
|
|
203
|
-
entered: {
|
|
204
|
-
color: `white`,
|
|
205
|
-
fontSize: Dimensions.get(`screen`).width / 23,
|
|
206
|
-
},
|
|
207
|
-
valueUnitContainer: {
|
|
208
|
-
...infoStyles.valueUnitContainer,
|
|
209
|
-
},
|
|
210
|
-
valueContainer: {
|
|
211
|
-
...infoStyles.valueContainer,
|
|
212
|
-
},
|
|
213
|
-
value: {
|
|
214
|
-
...infoStyles.value,
|
|
215
|
-
},
|
|
216
|
-
unitContainer: {
|
|
217
|
-
...infoStyles.unitContainer,
|
|
218
|
-
},
|
|
219
|
-
units: {
|
|
220
|
-
...infoStyles.units,
|
|
221
|
-
},
|
|
222
|
-
editIconContainer: {
|
|
223
|
-
justifyContent: `flex-end`,
|
|
224
|
-
paddingRight: `20%`,
|
|
225
|
-
flexDirection: `row`,
|
|
226
|
-
},
|
|
227
|
-
editIcon: {
|
|
228
|
-
color: BORDER_COLOUR_TEAL,
|
|
229
|
-
fontSize: Dimensions.get(`screen`).width / 30,
|
|
230
|
-
},
|
|
231
|
-
recommendedContainer: {
|
|
232
|
-
flex: 7,
|
|
233
|
-
flexDirection: `row`,
|
|
234
|
-
},
|
|
235
|
-
recommendedLabel: {
|
|
236
|
-
color: BORDER_COLOUR_TEAL,
|
|
237
|
-
fontSize: Dimensions.get(`screen`).width / 25,
|
|
238
|
-
alignSelf: `center`,
|
|
239
|
-
fontWeight: `bold`,
|
|
240
|
-
},
|
|
241
|
-
removeRecommended: {
|
|
242
|
-
justifyContent: `center`,
|
|
243
|
-
marginRight: `1%`,
|
|
244
|
-
marginTop: `1%`,
|
|
245
|
-
},
|
|
246
|
-
removeRecommendedIcon: {
|
|
247
|
-
color: BORDER_COLOUR_TEAL,
|
|
248
|
-
fontSize: Dimensions.get(`screen`).width / 20,
|
|
249
|
-
paddingBottom: `0.5%`,
|
|
250
|
-
},
|
|
251
|
-
});
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { UserSettings } from "@hedia/types";
|
|
2
|
-
import React from "react";
|
|
3
|
-
export interface IProps {
|
|
4
|
-
/** The amount of insulin in units to display to the user as a recommendation. */
|
|
5
|
-
insulinRecommendation: number;
|
|
6
|
-
/** The amount of insulin introduced by the user. */
|
|
7
|
-
enteredInsulin: number | null;
|
|
8
|
-
/**
|
|
9
|
-
* The factor by which the recommendation was multiplied to get the reduced insulin amount.
|
|
10
|
-
* Used by the RecommendedInsulin component to check that the user’s input doesn’t exceed the maximum allowed.
|
|
11
|
-
* If no activity has been entered, this prop should be null.
|
|
12
|
-
* */
|
|
13
|
-
activityReduction: number | null;
|
|
14
|
-
/** Used to determine how the insulin amount should be rounded. */
|
|
15
|
-
injectionMethod: UserSettings.Enums.InjectionMethod;
|
|
16
|
-
/**
|
|
17
|
-
* Callback function taking a number as argument and giving no return value.
|
|
18
|
-
* To be called with the new value every time the content of the insulin input field gets changed.
|
|
19
|
-
*/
|
|
20
|
-
updateRecommendedInsulin(value: number): void;
|
|
21
|
-
}
|
|
22
|
-
export interface IState {
|
|
23
|
-
/** The entered amount of insulin as a string. */
|
|
24
|
-
partialInput?: string;
|
|
25
|
-
}
|
|
26
|
-
/** Input field for displaying the entered amount of insulin (which defaults to HDA’s recommendation) and allowing the user to edit it. */
|
|
27
|
-
export default class RecommendedInsulin extends React.Component<IProps, IState> {
|
|
28
|
-
/** Initialise the state partialInput variable with undefined */
|
|
29
|
-
state: IState;
|
|
30
|
-
/**
|
|
31
|
-
* Function taking no arguments and returning no value.
|
|
32
|
-
* Will be bound to the function that activates input for InvisibleNumberInput when that component has been mounted.
|
|
33
|
-
*/
|
|
34
|
-
callbackInput?: () => void;
|
|
35
|
-
/**
|
|
36
|
-
* Called immediately after updating occurs. Not called for the initial render.
|
|
37
|
-
* The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
|
|
38
|
-
*
|
|
39
|
-
* Steps:
|
|
40
|
-
* 1. If the value of the enteredInsulin prop was changed, set the partialInput state variable to the new value.
|
|
41
|
-
* @param prevProps The previous component props
|
|
42
|
-
*/
|
|
43
|
-
componentDidUpdate(prevProps: IProps): void;
|
|
44
|
-
/**
|
|
45
|
-
* Handle what should happen when the InsulinRecommendation component has been pressed.
|
|
46
|
-
* Uses the InvisibleNumberInput child component to enable the user to input the amount of insulin that hey are taking.
|
|
47
|
-
*
|
|
48
|
-
* Steps:
|
|
49
|
-
* 1. Call the callbackInput() member method.
|
|
50
|
-
*/
|
|
51
|
-
handleOnPress: () => void;
|
|
52
|
-
/**
|
|
53
|
-
* Passed to the InvisibleNumberInput child component as a callback function to be called every time the content of the input field changes.
|
|
54
|
-
*
|
|
55
|
-
* Steps:
|
|
56
|
-
* 1. Assign a new local variable, replacedZero, with the value of the insulin argument string
|
|
57
|
-
* except for the first character if insulin is longer than 1 character and starts with a '0' but doesn’t start with ‘0.’.
|
|
58
|
-
* Otherwise set it to insulin. This would be better handled by converting it to a number: replacedZero = Number(insulin);
|
|
59
|
-
* 2. Save replacedZero to the partialInput state variable.
|
|
60
|
-
* 3. Return replacedZero
|
|
61
|
-
* @param insulin The contents of the input field.
|
|
62
|
-
* @returns The partially cleaned input.
|
|
63
|
-
*/
|
|
64
|
-
updatePartially: (insulin: string) => string;
|
|
65
|
-
/**
|
|
66
|
-
* Handle what happens when input in the InvisibleNumberInput child component is completed.
|
|
67
|
-
*
|
|
68
|
-
* Steps:
|
|
69
|
-
* 1. Get the rounded insulin amount using the value argument and the injectionMethod prop as arguments for the Utils.roundValue() function.
|
|
70
|
-
* 2. Get the adjusted safety insulin limit (due to activity) by multiplying the activity reduction factor (which is 1 minus the activityReduction prop) with the SAFETY_INSULIN_LIMIT constant.
|
|
71
|
-
* 3. If the rounded value exceeds the adjusted safety threshold:
|
|
72
|
-
* - Call the updatePartially() method with the adjusted safety threshold to set the insulin amount to the capped value.
|
|
73
|
-
* - Return an Alert with a message about the insulin limit.
|
|
74
|
-
* 4. Call the updatePartially() method with the rounded value to set the entered insulin value.
|
|
75
|
-
* 5. Call the updateRecommendedInsulin callback function prop with rounded as the argument to report back the updated insulin amount to the parent RecommendationScreen component.
|
|
76
|
-
* @param value The numerical value of the input field at completion.
|
|
77
|
-
*/
|
|
78
|
-
handleUpdatedInsulin: (value: number) => void;
|
|
79
|
-
/**
|
|
80
|
-
* Render a JSX element to display the insulin input field with the current insulin amount value
|
|
81
|
-
* and using an InvisibleNumberInput component to enable input when the insulin amount is tapped.
|
|
82
|
-
*/
|
|
83
|
-
render: () => JSX.Element;
|
|
84
|
-
}
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { BolusCalculator } from "@hedia/types";
|
|
2
|
-
import { t } from "@lingui/macro";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { Alert, Dimensions, Platform, StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
5
|
-
import LinearGradient from "react-native-linear-gradient";
|
|
6
|
-
import { i18n } from "../locale/i18nUtils";
|
|
7
|
-
import { Testing } from "../types/enum";
|
|
8
|
-
import { Messages } from "../utils/AttentionMessages";
|
|
9
|
-
import { Utils } from "../utils/Utils";
|
|
10
|
-
import Icon from "./Icon";
|
|
11
|
-
import { infoStyles } from "./InfoBars";
|
|
12
|
-
import InvisibleNumberInput from "./InvisibleNumberInput";
|
|
13
|
-
const { RecommendedInsulinTestIds } = Testing.Id;
|
|
14
|
-
const SAFETY_INSULIN_LIMIT = BolusCalculator.Constants.SAFETY_INSULIN_LIMIT;
|
|
15
|
-
/** Input field for displaying the entered amount of insulin (which defaults to HDA’s recommendation) and allowing the user to edit it. */
|
|
16
|
-
export default class RecommendedInsulin extends React.Component {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
/** Initialise the state partialInput variable with undefined */
|
|
20
|
-
this.state = {
|
|
21
|
-
partialInput: undefined,
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Handle what should happen when the InsulinRecommendation component has been pressed.
|
|
25
|
-
* Uses the InvisibleNumberInput child component to enable the user to input the amount of insulin that hey are taking.
|
|
26
|
-
*
|
|
27
|
-
* Steps:
|
|
28
|
-
* 1. Call the callbackInput() member method.
|
|
29
|
-
*/
|
|
30
|
-
this.handleOnPress = () => {
|
|
31
|
-
this.callbackInput?.();
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Passed to the InvisibleNumberInput child component as a callback function to be called every time the content of the input field changes.
|
|
35
|
-
*
|
|
36
|
-
* Steps:
|
|
37
|
-
* 1. Assign a new local variable, replacedZero, with the value of the insulin argument string
|
|
38
|
-
* except for the first character if insulin is longer than 1 character and starts with a '0' but doesn’t start with ‘0.’.
|
|
39
|
-
* Otherwise set it to insulin. This would be better handled by converting it to a number: replacedZero = Number(insulin);
|
|
40
|
-
* 2. Save replacedZero to the partialInput state variable.
|
|
41
|
-
* 3. Return replacedZero
|
|
42
|
-
* @param insulin The contents of the input field.
|
|
43
|
-
* @returns The partially cleaned input.
|
|
44
|
-
*/
|
|
45
|
-
this.updatePartially = (insulin) => {
|
|
46
|
-
const replacedZero = insulin.length > 1 && insulin.startsWith(`0`) && !insulin.startsWith(`0.`) ? insulin.substring(1) : insulin;
|
|
47
|
-
this.setState({
|
|
48
|
-
partialInput: replacedZero,
|
|
49
|
-
});
|
|
50
|
-
return replacedZero;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Handle what happens when input in the InvisibleNumberInput child component is completed.
|
|
54
|
-
*
|
|
55
|
-
* Steps:
|
|
56
|
-
* 1. Get the rounded insulin amount using the value argument and the injectionMethod prop as arguments for the Utils.roundValue() function.
|
|
57
|
-
* 2. Get the adjusted safety insulin limit (due to activity) by multiplying the activity reduction factor (which is 1 minus the activityReduction prop) with the SAFETY_INSULIN_LIMIT constant.
|
|
58
|
-
* 3. If the rounded value exceeds the adjusted safety threshold:
|
|
59
|
-
* - Call the updatePartially() method with the adjusted safety threshold to set the insulin amount to the capped value.
|
|
60
|
-
* - Return an Alert with a message about the insulin limit.
|
|
61
|
-
* 4. Call the updatePartially() method with the rounded value to set the entered insulin value.
|
|
62
|
-
* 5. Call the updateRecommendedInsulin callback function prop with rounded as the argument to report back the updated insulin amount to the parent RecommendationScreen component.
|
|
63
|
-
* @param value The numerical value of the input field at completion.
|
|
64
|
-
*/
|
|
65
|
-
this.handleUpdatedInsulin = (value) => {
|
|
66
|
-
const rounded = Utils.roundValue(value, this.props.injectionMethod);
|
|
67
|
-
// https://hedia.atlassian.net/browse/HDA-795
|
|
68
|
-
const limited = (1 - (this.props.activityReduction ?? 0)) * SAFETY_INSULIN_LIMIT;
|
|
69
|
-
if (rounded > limited) {
|
|
70
|
-
this.setState({ partialInput: this.props.insulinRecommendation?.toString() ?? null });
|
|
71
|
-
this.props.updateRecommendedInsulin(this.props.insulinRecommendation);
|
|
72
|
-
return Alert.alert(i18n._(t `Attention`), Messages.InsulinInputWasLimited(this.props.activityReduction), [
|
|
73
|
-
{
|
|
74
|
-
text: i18n._(t `OK`),
|
|
75
|
-
},
|
|
76
|
-
]);
|
|
77
|
-
}
|
|
78
|
-
this.updatePartially(`${rounded}`);
|
|
79
|
-
this.props.updateRecommendedInsulin(rounded);
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Render a JSX element to display the insulin input field with the current insulin amount value
|
|
83
|
-
* and using an InvisibleNumberInput component to enable input when the insulin amount is tapped.
|
|
84
|
-
*/
|
|
85
|
-
this.render = () => {
|
|
86
|
-
const paddingBottom = Platform.OS === `ios` ? `3%` : `1%`;
|
|
87
|
-
const shownInsulin = this.state.partialInput ?? this.props.insulinRecommendation ?? `0`;
|
|
88
|
-
return (<React.Fragment>
|
|
89
|
-
<TouchableOpacity accessibilityLabel="editRecommendedInsulin" testID={RecommendedInsulinTestIds.EditRecommendedInsulin} onPress={this.handleOnPress}>
|
|
90
|
-
<LinearGradient style={recommendedInsulinStyles.container} colors={[`#a200ff`, `#578aff`]} start={{ x: 0, y: 0 }} end={{ x: 1, y: 0 }}>
|
|
91
|
-
<View style={recommendedInsulinStyles.recommendedTextContainer}>
|
|
92
|
-
<Text style={recommendedInsulinStyles.recommendedText}>
|
|
93
|
-
{i18n._(t `Recommended amount of insulin`)}
|
|
94
|
-
</Text>
|
|
95
|
-
</View>
|
|
96
|
-
<View style={[recommendedInsulinStyles.recommendedContainer, { paddingBottom }]}>
|
|
97
|
-
<View style={recommendedInsulinStyles.valueContainer}>
|
|
98
|
-
<Text style={recommendedInsulinStyles.value} testID={RecommendedInsulinTestIds.ShownInsulinText}>
|
|
99
|
-
{shownInsulin}
|
|
100
|
-
</Text>
|
|
101
|
-
<Text style={recommendedInsulinStyles.units}>{i18n._(t `Units`)}</Text>
|
|
102
|
-
</View>
|
|
103
|
-
<Icon style={recommendedInsulinStyles.editIcon} iconIdentifier={`Feather/edit`}/>
|
|
104
|
-
</View>
|
|
105
|
-
</LinearGradient>
|
|
106
|
-
</TouchableOpacity>
|
|
107
|
-
<InvisibleNumberInput testID={RecommendedInsulinTestIds.InvisibleInsulinInput} decimalPlaces={3} negativeAllowed={false} cleanPartialInput={false} partialInput={this.updatePartially} onEnd={this.handleUpdatedInsulin} visible={(visible) => (this.callbackInput = visible)} startValue={`${shownInsulin}`}/>
|
|
108
|
-
</React.Fragment>);
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Called immediately after updating occurs. Not called for the initial render.
|
|
113
|
-
* The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
|
|
114
|
-
*
|
|
115
|
-
* Steps:
|
|
116
|
-
* 1. If the value of the enteredInsulin prop was changed, set the partialInput state variable to the new value.
|
|
117
|
-
* @param prevProps The previous component props
|
|
118
|
-
*/
|
|
119
|
-
componentDidUpdate(prevProps) {
|
|
120
|
-
const { enteredInsulin } = this.props;
|
|
121
|
-
if (prevProps.enteredInsulin !== enteredInsulin) {
|
|
122
|
-
this.setState({ partialInput: enteredInsulin?.toString() });
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
const recommendedInsulinStyles = StyleSheet.create({
|
|
127
|
-
container: {
|
|
128
|
-
marginHorizontal: infoStyles.margin.margin,
|
|
129
|
-
marginTop: infoStyles.margin.margin,
|
|
130
|
-
borderRadius: 5,
|
|
131
|
-
},
|
|
132
|
-
recommendedTextContainer: {
|
|
133
|
-
flex: 1,
|
|
134
|
-
alignItems: `center`,
|
|
135
|
-
marginTop: `3%`,
|
|
136
|
-
},
|
|
137
|
-
recommendedText: {
|
|
138
|
-
paddingTop: `1%`,
|
|
139
|
-
...infoStyles.label,
|
|
140
|
-
},
|
|
141
|
-
recommendedContainer: {
|
|
142
|
-
flex: 1,
|
|
143
|
-
flexDirection: `row`,
|
|
144
|
-
marginLeft: `10%`,
|
|
145
|
-
},
|
|
146
|
-
valueContainer: {
|
|
147
|
-
flex: 1,
|
|
148
|
-
flexDirection: `row`,
|
|
149
|
-
justifyContent: `center`,
|
|
150
|
-
minHeight: Dimensions.get(`screen`).width / 4,
|
|
151
|
-
},
|
|
152
|
-
value: {
|
|
153
|
-
color: `white`,
|
|
154
|
-
fontWeight: `bold`,
|
|
155
|
-
fontSize: Dimensions.get(`screen`).width / 5,
|
|
156
|
-
},
|
|
157
|
-
units: {
|
|
158
|
-
alignSelf: `flex-end`,
|
|
159
|
-
color: `white`,
|
|
160
|
-
fontSize: Dimensions.get(`screen`).width / 28,
|
|
161
|
-
paddingBottom: `6%`,
|
|
162
|
-
},
|
|
163
|
-
editIcon: {
|
|
164
|
-
color: `white`,
|
|
165
|
-
fontSize: Dimensions.get(`screen`).width / 28,
|
|
166
|
-
textAlignVertical: `center`,
|
|
167
|
-
paddingBottom: `10%`,
|
|
168
|
-
marginRight: `5%`,
|
|
169
|
-
},
|
|
170
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export interface IProps {
|
|
3
|
-
/** The initial time (in hours) after which the user should be reminded to measure their BGL. */
|
|
4
|
-
remeasureTime: number;
|
|
5
|
-
/**
|
|
6
|
-
* Callback function taking a single number (the new remeasurement time) as argument
|
|
7
|
-
* Function to be called every time the slider component is changed to a new value.
|
|
8
|
-
*/
|
|
9
|
-
onSliderChange(value: number): void;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* The Remeasure component has a slider child component that the user can drag to change
|
|
13
|
-
* when they will get a reminder notification about measuring their BGL again.
|
|
14
|
-
*/
|
|
15
|
-
export default class Remeasure extends React.Component<IProps> {
|
|
16
|
-
/** For holding a reference to the slider component so its initial value can be set (only one time) when the Remeasure component has been mounted. */
|
|
17
|
-
private slider?;
|
|
18
|
-
/**
|
|
19
|
-
* Called immediately after a component is mounted. Setting state here will trigger re-rendering.
|
|
20
|
-
*
|
|
21
|
-
* If the value of a slider component in React Native is set to track an outside state,
|
|
22
|
-
* the slider indicator may jump back and forth while updates to the value are propagated through the affected objects and components.
|
|
23
|
-
* Since we don’t need to change the value of the slider from the outside after initialising it to the default value,
|
|
24
|
-
* we simply set the default value (using setNativeProp) upon initialisation instead of using the slider’s normal value prop to set it.
|
|
25
|
-
*
|
|
26
|
-
* Steps:
|
|
27
|
-
* 1. Call the setNativeProps() method on the slider to set its value to the remeasureTime prop.
|
|
28
|
-
*/
|
|
29
|
-
componentDidMount(): void;
|
|
30
|
-
/**
|
|
31
|
-
* Steps:
|
|
32
|
-
* 1. Use limitTime() to limit/clamp the value of remeasureTime in the range 0 to 6.
|
|
33
|
-
* 2. Call the onSliderChange prop callback function with the limited value as argument.
|
|
34
|
-
* @param remeasureTime The value of the remeasurement slider.
|
|
35
|
-
*/
|
|
36
|
-
handleSliderChange: (remeasureTime: number) => void;
|
|
37
|
-
/**
|
|
38
|
-
* Steps:
|
|
39
|
-
* 1.Use Math.min() and Math.max() to clamp remeasureTime in the range 0 to 6 and return the result.
|
|
40
|
-
* @param remeasureTime The value of the remeasurement slider.
|
|
41
|
-
* @returns The limited remeasurement time in hours
|
|
42
|
-
*/
|
|
43
|
-
limitTime: (remeasureTime: number) => number;
|
|
44
|
-
/**
|
|
45
|
-
* Compose a JSX element for displaying the currently selected remeasurement time along
|
|
46
|
-
* with a horizontal slider for changing it in increments of 0.5 hours in the range 0 to 6.
|
|
47
|
-
*/
|
|
48
|
-
render(): JSX.Element;
|
|
49
|
-
}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { t } from "@lingui/macro";
|
|
2
|
-
import Slider from "@react-native-community/slider";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { Dimensions, Platform, StyleSheet, Text, View } from "react-native";
|
|
5
|
-
import { i18n } from "../locale/i18nUtils";
|
|
6
|
-
import { Testing } from "../types/enum";
|
|
7
|
-
import { BORDER_COLOUR_GREY, BORDER_COLOUR_TEAL } from "../utils/Constants";
|
|
8
|
-
import { infoStyles } from "./InfoBars";
|
|
9
|
-
/**
|
|
10
|
-
* The Remeasure component has a slider child component that the user can drag to change
|
|
11
|
-
* when they will get a reminder notification about measuring their BGL again.
|
|
12
|
-
*/
|
|
13
|
-
export default class Remeasure extends React.Component {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
/**
|
|
17
|
-
* Steps:
|
|
18
|
-
* 1. Use limitTime() to limit/clamp the value of remeasureTime in the range 0 to 6.
|
|
19
|
-
* 2. Call the onSliderChange prop callback function with the limited value as argument.
|
|
20
|
-
* @param remeasureTime The value of the remeasurement slider.
|
|
21
|
-
*/
|
|
22
|
-
this.handleSliderChange = (remeasureTime) => {
|
|
23
|
-
const limited = this.limitTime(remeasureTime);
|
|
24
|
-
this.props.onSliderChange(limited);
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Steps:
|
|
28
|
-
* 1.Use Math.min() and Math.max() to clamp remeasureTime in the range 0 to 6 and return the result.
|
|
29
|
-
* @param remeasureTime The value of the remeasurement slider.
|
|
30
|
-
* @returns The limited remeasurement time in hours
|
|
31
|
-
*/
|
|
32
|
-
this.limitTime = (remeasureTime) => {
|
|
33
|
-
return Math.min(Math.max(0, remeasureTime), 6);
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Called immediately after a component is mounted. Setting state here will trigger re-rendering.
|
|
38
|
-
*
|
|
39
|
-
* If the value of a slider component in React Native is set to track an outside state,
|
|
40
|
-
* the slider indicator may jump back and forth while updates to the value are propagated through the affected objects and components.
|
|
41
|
-
* Since we don’t need to change the value of the slider from the outside after initialising it to the default value,
|
|
42
|
-
* we simply set the default value (using setNativeProp) upon initialisation instead of using the slider’s normal value prop to set it.
|
|
43
|
-
*
|
|
44
|
-
* Steps:
|
|
45
|
-
* 1. Call the setNativeProps() method on the slider to set its value to the remeasureTime prop.
|
|
46
|
-
*/
|
|
47
|
-
componentDidMount() {
|
|
48
|
-
this.slider?.setNativeProps({
|
|
49
|
-
value: this.props.remeasureTime,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Compose a JSX element for displaying the currently selected remeasurement time along
|
|
54
|
-
* with a horizontal slider for changing it in increments of 0.5 hours in the range 0 to 6.
|
|
55
|
-
*/
|
|
56
|
-
render() {
|
|
57
|
-
const measure = this.props.remeasureTime > 0;
|
|
58
|
-
const limited = this.limitTime(this.props.remeasureTime);
|
|
59
|
-
const marginHorizontal = Platform.OS === `ios` ? `3%` : `0%`;
|
|
60
|
-
const valueContainer = measure ? remeasureStyles.valueContainer : variantStyles.centeredValueContainer;
|
|
61
|
-
return (<View style={remeasureStyles.container}>
|
|
62
|
-
<View style={remeasureStyles.borderContainer}>
|
|
63
|
-
<View style={remeasureStyles.remeasureContainer}>
|
|
64
|
-
<Text style={remeasureStyles.remeasureLabel}>{i18n._(t `Remind me to remeasure in`)}</Text>
|
|
65
|
-
</View>
|
|
66
|
-
<View style={remeasureStyles.valueUnitContainer}>
|
|
67
|
-
<View style={valueContainer}>
|
|
68
|
-
<Text style={remeasureStyles.value}>{measure ? limited : i18n._(t `OFF`)}</Text>
|
|
69
|
-
</View>
|
|
70
|
-
{measure ? (<View style={remeasureStyles.unitContainer}>
|
|
71
|
-
<Text style={remeasureStyles.units}>{i18n._(t `hours`)}</Text>
|
|
72
|
-
</View>) : null}
|
|
73
|
-
</View>
|
|
74
|
-
</View>
|
|
75
|
-
<Slider ref={(slider) => {
|
|
76
|
-
if (slider !== null) {
|
|
77
|
-
this.slider = slider;
|
|
78
|
-
}
|
|
79
|
-
}} testID={Testing.Id.RemeasureTestIds.RemeasureSlider} accessibilityLabel="remeasureSlider" maximumTrackTintColor={BORDER_COLOUR_GREY} minimumTrackTintColor={BORDER_COLOUR_TEAL} thumbTintColor={BORDER_COLOUR_TEAL} maximumValue={6} minimumValue={0} step={0.5} style={[remeasureStyles.sliderStyle, { marginHorizontal }]} onValueChange={this.handleSliderChange}/>
|
|
80
|
-
</View>);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
const remeasureStyles = StyleSheet.create({
|
|
84
|
-
container: {
|
|
85
|
-
flexDirection: `column`,
|
|
86
|
-
padding: `3%`,
|
|
87
|
-
},
|
|
88
|
-
borderContainer: {
|
|
89
|
-
...infoStyles.borderContainer,
|
|
90
|
-
alignItems: `center`,
|
|
91
|
-
},
|
|
92
|
-
remeasureContainer: {
|
|
93
|
-
flex: 7,
|
|
94
|
-
},
|
|
95
|
-
remeasureLabel: {
|
|
96
|
-
color: `white`,
|
|
97
|
-
fontSize: Dimensions.get(`screen`).width / 25,
|
|
98
|
-
fontWeight: `bold`,
|
|
99
|
-
},
|
|
100
|
-
valueUnitContainer: {
|
|
101
|
-
...infoStyles.valueUnitContainer,
|
|
102
|
-
},
|
|
103
|
-
valueContainer: {
|
|
104
|
-
...infoStyles.valueContainer,
|
|
105
|
-
},
|
|
106
|
-
value: {
|
|
107
|
-
...infoStyles.value,
|
|
108
|
-
},
|
|
109
|
-
unitContainer: {
|
|
110
|
-
...infoStyles.unitContainer,
|
|
111
|
-
},
|
|
112
|
-
units: {
|
|
113
|
-
...infoStyles.units,
|
|
114
|
-
},
|
|
115
|
-
sliderStyle: {
|
|
116
|
-
marginTop: `3%`,
|
|
117
|
-
marginBottom: `2%`,
|
|
118
|
-
},
|
|
119
|
-
});
|
|
120
|
-
const variantStyles = StyleSheet.create({
|
|
121
|
-
centeredValueContainer: {
|
|
122
|
-
...remeasureStyles.valueContainer,
|
|
123
|
-
alignItems: `center`,
|
|
124
|
-
},
|
|
125
|
-
});
|