@hedia/recommendation-screen 1.5.2 → 1.6.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/.idea/workspace.xml +32 -201
- package/package.json +4 -3
- package/src/RecommendationScreen.d.ts +6 -3
- package/src/RecommendationScreen.jsx +8 -6
- package/src/RecommendationScreen.tsx +32 -9
- package/src/components/InfoBars.d.ts +4 -1
- package/src/components/InfoBars.jsx +19 -3
- package/src/components/InfoBars.tsx +19 -4
- package/src/locale/da/messages.js +1 -1
- package/src/locale/da/messages.po +30 -18
- package/src/locale/en/messages.js +1 -1
- package/src/locale/en/messages.po +30 -18
- package/src/types/enum.d.ts +7 -9
- package/src/types/enum.js +8 -11
- package/src/types/enum.ts +3 -6
- package/src/utils/Constants.d.ts +5 -2
- package/src/utils/Constants.js +6 -3
- package/src/utils/Constants.ts +6 -2
- package/src/utils/RecommendationError.d.ts +3 -1
- package/src/utils/RecommendationError.jsx +4 -2
- package/src/utils/RecommendationError.tsx +12 -2
- package/src/utils/Utils.d.ts +6 -1
- package/src/utils/Utils.js +17 -2
- package/src/utils/Utils.ts +21 -3
- package/src/utils/Validations.d.ts +5 -2
- package/src/utils/Validations.js +28 -7
- package/src/utils/Validations.ts +32 -7
package/.idea/workspace.xml
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
</component>
|
|
30
30
|
<component name="ChangeListManager">
|
|
31
31
|
<list default="true" id="bceba75c-4c15-4bdc-9b41-023f63a30830" name="Default Changelist" comment="">
|
|
32
|
-
<change beforePath="$PROJECT_DIR
|
|
32
|
+
<change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
|
|
33
33
|
</list>
|
|
34
34
|
<option name="SHOW_DIALOG" value="false" />
|
|
35
35
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
@@ -186,189 +186,18 @@
|
|
|
186
186
|
<workItem from="1601281403601" duration="8208000" />
|
|
187
187
|
<workItem from="1601639667672" duration="898000" />
|
|
188
188
|
<workItem from="1601883005682" duration="10293000" />
|
|
189
|
-
<workItem from="1601903898220" duration="
|
|
189
|
+
<workItem from="1601903898220" duration="2267000" />
|
|
190
|
+
<workItem from="1601972128642" duration="3574000" />
|
|
191
|
+
<workItem from="1602064836586" duration="3708000" />
|
|
192
|
+
<workItem from="1602165438473" duration="1424000" />
|
|
193
|
+
<workItem from="1602229083262" duration="2936000" />
|
|
194
|
+
<workItem from="1602239231218" duration="802000" />
|
|
195
|
+
<workItem from="1602487231033" duration="7422000" />
|
|
190
196
|
</task>
|
|
191
197
|
<servers />
|
|
192
198
|
</component>
|
|
193
199
|
<component name="TypeScriptGeneratedFilesManager">
|
|
194
200
|
<option name="version" value="3" />
|
|
195
|
-
<option name="exactExcludedFiles">
|
|
196
|
-
<list>
|
|
197
|
-
<option value="$PROJECT_DIR$/App.d.ts" />
|
|
198
|
-
<option value="$PROJECT_DIR$/App.jsx" />
|
|
199
|
-
<option value="$PROJECT_DIR$/index.js" />
|
|
200
|
-
<option value="$PROJECT_DIR$/index.d.ts" />
|
|
201
|
-
<option value="$PROJECT_DIR$/src/RecommendationScreen.d.ts" />
|
|
202
|
-
<option value="$PROJECT_DIR$/src/RecommendationScreen.jsx" />
|
|
203
|
-
<option value="$PROJECT_DIR$/src/types/enum.d.ts" />
|
|
204
|
-
<option value="$PROJECT_DIR$/src/types/enum.js" />
|
|
205
|
-
<option value="$PROJECT_DIR$/src/types/types.d.ts" />
|
|
206
|
-
<option value="$PROJECT_DIR$/src/types/types.js" />
|
|
207
|
-
<option value="$PROJECT_DIR$/src/utils/AttentionMessages.jsx" />
|
|
208
|
-
<option value="$PROJECT_DIR$/src/utils/RecommendationUtils.js" />
|
|
209
|
-
<option value="$PROJECT_DIR$/src/utils/AttentionMessages.d.ts" />
|
|
210
|
-
<option value="$PROJECT_DIR$/src/utils/RecommendationError.jsx" />
|
|
211
|
-
<option value="$PROJECT_DIR$/src/utils/RecommendationUtils.d.ts" />
|
|
212
|
-
<option value="$PROJECT_DIR$/src/utils/RecommendationError.d.ts" />
|
|
213
|
-
<option value="$PROJECT_DIR$/src/utils/Constants.d.ts" />
|
|
214
|
-
<option value="$PROJECT_DIR$/src/utils/Utils.d.ts" />
|
|
215
|
-
<option value="$PROJECT_DIR$/src/utils/Validations.js" />
|
|
216
|
-
<option value="$PROJECT_DIR$/src/utils/Utils.js" />
|
|
217
|
-
<option value="$PROJECT_DIR$/src/utils/Validations.d.ts" />
|
|
218
|
-
<option value="$PROJECT_DIR$/src/utils/Constants.js" />
|
|
219
|
-
<option value="$PROJECT_DIR$/src/locale/i18nUtils.js" />
|
|
220
|
-
<option value="$PROJECT_DIR$/src/locale/i18nUtils.d.ts" />
|
|
221
|
-
<option value="$PROJECT_DIR$/src/components/RecommendationModal.jsx" />
|
|
222
|
-
<option value="$PROJECT_DIR$/src/components/RecentInsulin.d.ts" />
|
|
223
|
-
<option value="$PROJECT_DIR$/src/components/Header.jsx" />
|
|
224
|
-
<option value="$PROJECT_DIR$/src/components/InvisibleNumberInput.jsx" />
|
|
225
|
-
<option value="$PROJECT_DIR$/src/components/InfoBars.jsx" />
|
|
226
|
-
<option value="$PROJECT_DIR$/src/components/InvisibleNumberInput.d.ts" />
|
|
227
|
-
<option value="$PROJECT_DIR$/src/components/RecommendedCarbs.d.ts" />
|
|
228
|
-
<option value="$PROJECT_DIR$/src/components/TwoOptionModal.d.ts" />
|
|
229
|
-
<option value="$PROJECT_DIR$/src/components/Remeasure.d.ts" />
|
|
230
|
-
<option value="$PROJECT_DIR$/src/components/Header.d.ts" />
|
|
231
|
-
<option value="$PROJECT_DIR$/src/components/InfoBars.d.ts" />
|
|
232
|
-
<option value="$PROJECT_DIR$/src/components/RecommendationModal.d.ts" />
|
|
233
|
-
<option value="$PROJECT_DIR$/src/components/RecommendedInsulin.jsx" />
|
|
234
|
-
<option value="$PROJECT_DIR$/src/components/TransferToLogbook.d.ts" />
|
|
235
|
-
<option value="$PROJECT_DIR$/src/components/LimitationMessage.jsx" />
|
|
236
|
-
<option value="$PROJECT_DIR$/src/components/LineSeparator.jsx" />
|
|
237
|
-
<option value="$PROJECT_DIR$/src/components/TwoOptionModal.jsx" />
|
|
238
|
-
<option value="$PROJECT_DIR$/src/components/RecentInsulin.jsx" />
|
|
239
|
-
<option value="$PROJECT_DIR$/src/components/LineSeparator.d.ts" />
|
|
240
|
-
<option value="$PROJECT_DIR$/src/components/Remeasure.jsx" />
|
|
241
|
-
<option value="$PROJECT_DIR$/src/components/RecommendedInsulin.d.ts" />
|
|
242
|
-
<option value="$PROJECT_DIR$/src/components/TransferToLogbook.jsx" />
|
|
243
|
-
<option value="$PROJECT_DIR$/src/components/LimitationMessage.d.ts" />
|
|
244
|
-
<option value="$PROJECT_DIR$/src/components/RecommendedCarbs.jsx" />
|
|
245
|
-
<option value="$PROJECT_DIR$/src/components/mood/MoodIcon.jsx" />
|
|
246
|
-
<option value="$PROJECT_DIR$/src/components/mood/Emotion.jsx" />
|
|
247
|
-
<option value="$PROJECT_DIR$/src/components/mood/MoodIcon.d.ts" />
|
|
248
|
-
<option value="$PROJECT_DIR$/src/components/mood/Emotion.d.ts" />
|
|
249
|
-
<option value="$PROJECT_DIR$/src/components/activity/ActivityIcon.d.ts" />
|
|
250
|
-
<option value="$PROJECT_DIR$/src/components/activity/Activity.d.ts" />
|
|
251
|
-
<option value="$PROJECT_DIR$/src/components/activity/ActivityIntensity.d.ts" />
|
|
252
|
-
<option value="$PROJECT_DIR$/src/components/activity/Activity.jsx" />
|
|
253
|
-
<option value="$PROJECT_DIR$/src/components/activity/ActivityIcon.jsx" />
|
|
254
|
-
<option value="$PROJECT_DIR$/src/components/activity/ActivityIntensity.jsx" />
|
|
255
|
-
<option value="$PROJECT_DIR$/App.d.ts" />
|
|
256
|
-
<option value="$PROJECT_DIR$/App.jsx" />
|
|
257
|
-
<option value="$PROJECT_DIR$/index.d.ts" />
|
|
258
|
-
<option value="$PROJECT_DIR$/src/RecommendationScreen.d.ts" />
|
|
259
|
-
<option value="$PROJECT_DIR$/src/RecommendationScreen.jsx" />
|
|
260
|
-
<option value="$PROJECT_DIR$/src/types/enum.d.ts" />
|
|
261
|
-
<option value="$PROJECT_DIR$/src/types/enum.js" />
|
|
262
|
-
<option value="$PROJECT_DIR$/src/types/types.d.ts" />
|
|
263
|
-
<option value="$PROJECT_DIR$/src/types/types.js" />
|
|
264
|
-
<option value="$PROJECT_DIR$/src/utils/AttentionMessages.jsx" />
|
|
265
|
-
<option value="$PROJECT_DIR$/src/utils/RecommendationUtils.js" />
|
|
266
|
-
<option value="$PROJECT_DIR$/src/utils/AttentionMessages.d.ts" />
|
|
267
|
-
<option value="$PROJECT_DIR$/src/utils/RecommendationError.jsx" />
|
|
268
|
-
<option value="$PROJECT_DIR$/src/utils/RecommendationUtils.d.ts" />
|
|
269
|
-
<option value="$PROJECT_DIR$/src/utils/RecommendationError.d.ts" />
|
|
270
|
-
<option value="$PROJECT_DIR$/src/utils/Constants.d.ts" />
|
|
271
|
-
<option value="$PROJECT_DIR$/src/utils/Utils.d.ts" />
|
|
272
|
-
<option value="$PROJECT_DIR$/src/utils/Validations.js" />
|
|
273
|
-
<option value="$PROJECT_DIR$/src/utils/Utils.js" />
|
|
274
|
-
<option value="$PROJECT_DIR$/src/utils/Validations.d.ts" />
|
|
275
|
-
<option value="$PROJECT_DIR$/src/utils/Constants.js" />
|
|
276
|
-
<option value="$PROJECT_DIR$/src/locale/i18nUtils.js" />
|
|
277
|
-
<option value="$PROJECT_DIR$/src/locale/i18nUtils.d.ts" />
|
|
278
|
-
<option value="$PROJECT_DIR$/src/components/RecommendationModal.jsx" />
|
|
279
|
-
<option value="$PROJECT_DIR$/src/components/RecentInsulin.d.ts" />
|
|
280
|
-
<option value="$PROJECT_DIR$/src/components/Header.jsx" />
|
|
281
|
-
<option value="$PROJECT_DIR$/src/components/InvisibleNumberInput.jsx" />
|
|
282
|
-
<option value="$PROJECT_DIR$/src/components/InfoBars.jsx" />
|
|
283
|
-
<option value="$PROJECT_DIR$/src/components/InvisibleNumberInput.d.ts" />
|
|
284
|
-
<option value="$PROJECT_DIR$/src/components/RecommendedCarbs.d.ts" />
|
|
285
|
-
<option value="$PROJECT_DIR$/src/components/TwoOptionModal.d.ts" />
|
|
286
|
-
<option value="$PROJECT_DIR$/src/components/Remeasure.d.ts" />
|
|
287
|
-
<option value="$PROJECT_DIR$/src/components/Header.d.ts" />
|
|
288
|
-
<option value="$PROJECT_DIR$/src/components/InfoBars.d.ts" />
|
|
289
|
-
<option value="$PROJECT_DIR$/src/components/RecommendationModal.d.ts" />
|
|
290
|
-
<option value="$PROJECT_DIR$/src/components/RecommendedInsulin.jsx" />
|
|
291
|
-
<option value="$PROJECT_DIR$/src/components/TransferToLogbook.d.ts" />
|
|
292
|
-
<option value="$PROJECT_DIR$/src/components/LimitationMessage.jsx" />
|
|
293
|
-
<option value="$PROJECT_DIR$/src/components/LineSeparator.jsx" />
|
|
294
|
-
<option value="$PROJECT_DIR$/src/components/TwoOptionModal.jsx" />
|
|
295
|
-
<option value="$PROJECT_DIR$/src/components/RecentInsulin.jsx" />
|
|
296
|
-
<option value="$PROJECT_DIR$/src/components/LineSeparator.d.ts" />
|
|
297
|
-
<option value="$PROJECT_DIR$/src/components/Remeasure.jsx" />
|
|
298
|
-
<option value="$PROJECT_DIR$/src/components/RecommendedInsulin.d.ts" />
|
|
299
|
-
<option value="$PROJECT_DIR$/src/components/TransferToLogbook.jsx" />
|
|
300
|
-
<option value="$PROJECT_DIR$/src/components/LimitationMessage.d.ts" />
|
|
301
|
-
<option value="$PROJECT_DIR$/src/components/RecommendedCarbs.jsx" />
|
|
302
|
-
<option value="$PROJECT_DIR$/src/components/mood/MoodIcon.jsx" />
|
|
303
|
-
<option value="$PROJECT_DIR$/src/components/mood/Emotion.jsx" />
|
|
304
|
-
<option value="$PROJECT_DIR$/src/components/mood/MoodIcon.d.ts" />
|
|
305
|
-
<option value="$PROJECT_DIR$/src/components/mood/Emotion.d.ts" />
|
|
306
|
-
<option value="$PROJECT_DIR$/src/components/activity/ActivityIcon.d.ts" />
|
|
307
|
-
<option value="$PROJECT_DIR$/src/components/activity/Activity.d.ts" />
|
|
308
|
-
<option value="$PROJECT_DIR$/src/components/activity/ActivityIntensity.d.ts" />
|
|
309
|
-
<option value="$PROJECT_DIR$/src/components/activity/Activity.jsx" />
|
|
310
|
-
<option value="$PROJECT_DIR$/src/components/activity/ActivityIcon.jsx" />
|
|
311
|
-
<option value="$PROJECT_DIR$/src/components/activity/ActivityIntensity.jsx" />
|
|
312
|
-
<option value="$PROJECT_DIR$/App.d.ts" />
|
|
313
|
-
<option value="$PROJECT_DIR$/App.jsx" />
|
|
314
|
-
<option value="$PROJECT_DIR$/index.js" />
|
|
315
|
-
<option value="$PROJECT_DIR$/index.d.ts" />
|
|
316
|
-
<option value="$PROJECT_DIR$/src/RecommendationScreen.d.ts" />
|
|
317
|
-
<option value="$PROJECT_DIR$/src/RecommendationScreen.jsx" />
|
|
318
|
-
<option value="$PROJECT_DIR$/src/types/enum.d.ts" />
|
|
319
|
-
<option value="$PROJECT_DIR$/src/types/enum.js" />
|
|
320
|
-
<option value="$PROJECT_DIR$/src/types/types.d.ts" />
|
|
321
|
-
<option value="$PROJECT_DIR$/src/types/types.js" />
|
|
322
|
-
<option value="$PROJECT_DIR$/src/utils/AttentionMessages.jsx" />
|
|
323
|
-
<option value="$PROJECT_DIR$/src/utils/RecommendationUtils.js" />
|
|
324
|
-
<option value="$PROJECT_DIR$/src/utils/AttentionMessages.d.ts" />
|
|
325
|
-
<option value="$PROJECT_DIR$/src/utils/RecommendationError.jsx" />
|
|
326
|
-
<option value="$PROJECT_DIR$/src/utils/RecommendationUtils.d.ts" />
|
|
327
|
-
<option value="$PROJECT_DIR$/src/utils/RecommendationError.d.ts" />
|
|
328
|
-
<option value="$PROJECT_DIR$/src/utils/Constants.d.ts" />
|
|
329
|
-
<option value="$PROJECT_DIR$/src/utils/Utils.d.ts" />
|
|
330
|
-
<option value="$PROJECT_DIR$/src/utils/Validations.js" />
|
|
331
|
-
<option value="$PROJECT_DIR$/src/utils/Utils.js" />
|
|
332
|
-
<option value="$PROJECT_DIR$/src/utils/Validations.d.ts" />
|
|
333
|
-
<option value="$PROJECT_DIR$/src/utils/Constants.js" />
|
|
334
|
-
<option value="$PROJECT_DIR$/src/locale/i18nUtils.js" />
|
|
335
|
-
<option value="$PROJECT_DIR$/src/locale/i18nUtils.d.ts" />
|
|
336
|
-
<option value="$PROJECT_DIR$/src/components/RecommendationModal.jsx" />
|
|
337
|
-
<option value="$PROJECT_DIR$/src/components/RecentInsulin.d.ts" />
|
|
338
|
-
<option value="$PROJECT_DIR$/src/components/Header.jsx" />
|
|
339
|
-
<option value="$PROJECT_DIR$/src/components/InvisibleNumberInput.jsx" />
|
|
340
|
-
<option value="$PROJECT_DIR$/src/components/InfoBars.jsx" />
|
|
341
|
-
<option value="$PROJECT_DIR$/src/components/InvisibleNumberInput.d.ts" />
|
|
342
|
-
<option value="$PROJECT_DIR$/src/components/RecommendedCarbs.d.ts" />
|
|
343
|
-
<option value="$PROJECT_DIR$/src/components/TwoOptionModal.d.ts" />
|
|
344
|
-
<option value="$PROJECT_DIR$/src/components/Remeasure.d.ts" />
|
|
345
|
-
<option value="$PROJECT_DIR$/src/components/Header.d.ts" />
|
|
346
|
-
<option value="$PROJECT_DIR$/src/components/InfoBars.d.ts" />
|
|
347
|
-
<option value="$PROJECT_DIR$/src/components/RecommendationModal.d.ts" />
|
|
348
|
-
<option value="$PROJECT_DIR$/src/components/RecommendedInsulin.jsx" />
|
|
349
|
-
<option value="$PROJECT_DIR$/src/components/TransferToLogbook.d.ts" />
|
|
350
|
-
<option value="$PROJECT_DIR$/src/components/LimitationMessage.jsx" />
|
|
351
|
-
<option value="$PROJECT_DIR$/src/components/LineSeparator.jsx" />
|
|
352
|
-
<option value="$PROJECT_DIR$/src/components/TwoOptionModal.jsx" />
|
|
353
|
-
<option value="$PROJECT_DIR$/src/components/RecentInsulin.jsx" />
|
|
354
|
-
<option value="$PROJECT_DIR$/src/components/LineSeparator.d.ts" />
|
|
355
|
-
<option value="$PROJECT_DIR$/src/components/Remeasure.jsx" />
|
|
356
|
-
<option value="$PROJECT_DIR$/src/components/RecommendedInsulin.d.ts" />
|
|
357
|
-
<option value="$PROJECT_DIR$/src/components/TransferToLogbook.jsx" />
|
|
358
|
-
<option value="$PROJECT_DIR$/src/components/LimitationMessage.d.ts" />
|
|
359
|
-
<option value="$PROJECT_DIR$/src/components/RecommendedCarbs.jsx" />
|
|
360
|
-
<option value="$PROJECT_DIR$/src/components/mood/MoodIcon.jsx" />
|
|
361
|
-
<option value="$PROJECT_DIR$/src/components/mood/Emotion.jsx" />
|
|
362
|
-
<option value="$PROJECT_DIR$/src/components/mood/MoodIcon.d.ts" />
|
|
363
|
-
<option value="$PROJECT_DIR$/src/components/mood/Emotion.d.ts" />
|
|
364
|
-
<option value="$PROJECT_DIR$/src/components/activity/ActivityIcon.d.ts" />
|
|
365
|
-
<option value="$PROJECT_DIR$/src/components/activity/Activity.d.ts" />
|
|
366
|
-
<option value="$PROJECT_DIR$/src/components/activity/ActivityIntensity.d.ts" />
|
|
367
|
-
<option value="$PROJECT_DIR$/src/components/activity/Activity.jsx" />
|
|
368
|
-
<option value="$PROJECT_DIR$/src/components/activity/ActivityIcon.jsx" />
|
|
369
|
-
<option value="$PROJECT_DIR$/src/components/activity/ActivityIntensity.jsx" />
|
|
370
|
-
</list>
|
|
371
|
-
</option>
|
|
372
201
|
</component>
|
|
373
202
|
<component name="Vcs.Log.Tabs.Properties">
|
|
374
203
|
<option name="TAB_STATES">
|
|
@@ -419,45 +248,46 @@
|
|
|
419
248
|
<state x="1792" y="-66" width="3440" height="1159" key="DiffContextDialog/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1600171230341" />
|
|
420
249
|
<state x="0" y="123" width="1792" height="897" key="DiffContextDialog/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1600096736067" />
|
|
421
250
|
<state x="1792" y="-314" width="1920" height="865" key="DiffContextDialog/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1598603549140" />
|
|
422
|
-
<state width="
|
|
251
|
+
<state width="1357" height="316" key="GridCell.Tab.0.bottom" timestamp="1602685669570">
|
|
423
252
|
<screen x="0" y="23" width="1792" height="1097" />
|
|
424
253
|
</state>
|
|
425
254
|
<state width="1750" height="261" key="GridCell.Tab.0.bottom/-1920.-66.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1596194051670" />
|
|
426
|
-
<state width="
|
|
255
|
+
<state width="1357" height="316" key="GridCell.Tab.0.bottom/0.23.1792.1097@0.23.1792.1097" timestamp="1602685669570" />
|
|
427
256
|
<state width="1750" height="383" key="GridCell.Tab.0.bottom/1792.-195.3440.1417/0.23.1792.1097@0.23.1792.1097" timestamp="1597945008184" />
|
|
428
|
-
<state width="
|
|
257
|
+
<state width="1738" height="428" key="GridCell.Tab.0.bottom/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1602257501217" />
|
|
429
258
|
<state width="1321" height="264" key="GridCell.Tab.0.bottom/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1600268308807" />
|
|
430
259
|
<state width="1878" height="183" key="GridCell.Tab.0.bottom/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599837918176" />
|
|
431
|
-
<state width="
|
|
260
|
+
<state width="1357" height="316" key="GridCell.Tab.0.center" timestamp="1602685669569">
|
|
432
261
|
<screen x="0" y="23" width="1792" height="1097" />
|
|
433
262
|
</state>
|
|
434
263
|
<state width="1750" height="261" key="GridCell.Tab.0.center/-1920.-66.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1596194051669" />
|
|
435
|
-
<state width="
|
|
264
|
+
<state width="1357" height="316" key="GridCell.Tab.0.center/0.23.1792.1097@0.23.1792.1097" timestamp="1602685669569" />
|
|
436
265
|
<state width="1750" height="383" key="GridCell.Tab.0.center/1792.-195.3440.1417/0.23.1792.1097@0.23.1792.1097" timestamp="1597945008183" />
|
|
437
|
-
<state width="
|
|
266
|
+
<state width="1738" height="428" key="GridCell.Tab.0.center/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1602257501216" />
|
|
438
267
|
<state width="1321" height="264" key="GridCell.Tab.0.center/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1600268308807" />
|
|
439
268
|
<state width="1878" height="183" key="GridCell.Tab.0.center/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599837918175" />
|
|
440
|
-
<state width="
|
|
269
|
+
<state width="1357" height="316" key="GridCell.Tab.0.left" timestamp="1602685669568">
|
|
441
270
|
<screen x="0" y="23" width="1792" height="1097" />
|
|
442
271
|
</state>
|
|
443
272
|
<state width="1750" height="261" key="GridCell.Tab.0.left/-1920.-66.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1596194051668" />
|
|
444
|
-
<state width="
|
|
273
|
+
<state width="1357" height="316" key="GridCell.Tab.0.left/0.23.1792.1097@0.23.1792.1097" timestamp="1602685669568" />
|
|
445
274
|
<state width="1750" height="383" key="GridCell.Tab.0.left/1792.-195.3440.1417/0.23.1792.1097@0.23.1792.1097" timestamp="1597945008182" />
|
|
446
|
-
<state width="
|
|
275
|
+
<state width="1738" height="428" key="GridCell.Tab.0.left/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1602257501216" />
|
|
447
276
|
<state width="1321" height="264" key="GridCell.Tab.0.left/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1600268308806" />
|
|
448
277
|
<state width="1878" height="183" key="GridCell.Tab.0.left/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599837918175" />
|
|
449
|
-
<state width="
|
|
278
|
+
<state width="1357" height="316" key="GridCell.Tab.0.right" timestamp="1602685669570">
|
|
450
279
|
<screen x="0" y="23" width="1792" height="1097" />
|
|
451
280
|
</state>
|
|
452
281
|
<state width="1750" height="261" key="GridCell.Tab.0.right/-1920.-66.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1596194051669" />
|
|
453
|
-
<state width="
|
|
282
|
+
<state width="1357" height="316" key="GridCell.Tab.0.right/0.23.1792.1097@0.23.1792.1097" timestamp="1602685669570" />
|
|
454
283
|
<state width="1750" height="383" key="GridCell.Tab.0.right/1792.-195.3440.1417/0.23.1792.1097@0.23.1792.1097" timestamp="1597945008183" />
|
|
455
|
-
<state width="
|
|
284
|
+
<state width="1738" height="428" key="GridCell.Tab.0.right/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1602257501217" />
|
|
456
285
|
<state width="1321" height="264" key="GridCell.Tab.0.right/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1600268308807" />
|
|
457
286
|
<state width="1878" height="183" key="GridCell.Tab.0.right/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599837918176" />
|
|
458
|
-
<state x="
|
|
459
|
-
<screen x="
|
|
287
|
+
<state x="511" y="303" key="IDE.errors.dialog" timestamp="1602487312159">
|
|
288
|
+
<screen x="0" y="23" width="1792" height="1097" />
|
|
460
289
|
</state>
|
|
290
|
+
<state x="511" y="303" key="IDE.errors.dialog/0.23.1792.1097@0.23.1792.1097" timestamp="1602487312159" />
|
|
461
291
|
<state x="511" y="303" key="IDE.errors.dialog/1792.-195.3440.1417/0.23.1792.1097@0.23.1792.1097" timestamp="1597308623997" />
|
|
462
292
|
<state x="2773" y="167" key="IDE.errors.dialog/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1598973647546" />
|
|
463
293
|
<state x="2340" y="-140" key="IDE.errors.dialog/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599637300780" />
|
|
@@ -477,22 +307,23 @@
|
|
|
477
307
|
<state x="2767" y="31" key="RollbackChangesDialog/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1598965839229" />
|
|
478
308
|
<state x="508" y="198" key="RollbackChangesDialog/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1600074907578" />
|
|
479
309
|
<state x="2336" y="-241" key="RollbackChangesDialog/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599833353364" />
|
|
480
|
-
<state x="
|
|
481
|
-
<screen x="
|
|
310
|
+
<state x="397" y="210" key="SettingsEditor" timestamp="1602499684439">
|
|
311
|
+
<screen x="0" y="23" width="1792" height="1097" />
|
|
482
312
|
</state>
|
|
483
313
|
<state x="397" y="210" key="SettingsEditor/-1920.-66.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1596110346829" />
|
|
314
|
+
<state x="397" y="210" key="SettingsEditor/0.23.1792.1097@0.23.1792.1097" timestamp="1602499684439" />
|
|
484
315
|
<state x="2554" y="47" key="SettingsEditor/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1600695463879" />
|
|
485
316
|
<state x="428" y="230" key="com.intellij.openapi.vcs.changes.SpecificFilesViewDialog" timestamp="1596103115204">
|
|
486
317
|
<screen x="0" y="23" width="1792" height="1097" />
|
|
487
318
|
</state>
|
|
488
319
|
<state x="428" y="230" key="com.intellij.openapi.vcs.changes.SpecificFilesViewDialog/-1920.-66.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1596103115204" />
|
|
489
|
-
<state x="559" y="310" width="1233" height="522" key="find.popup" timestamp="
|
|
320
|
+
<state x="559" y="310" width="1233" height="522" key="find.popup" timestamp="1602507247404">
|
|
490
321
|
<screen x="0" y="23" width="1792" height="1097" />
|
|
491
322
|
</state>
|
|
492
323
|
<state x="559" y="310" width="1233" height="522" key="find.popup/-1920.-66.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1596116959250" />
|
|
493
|
-
<state x="559" y="310" width="1233" height="522" key="find.popup/0.23.1792.1097@0.23.1792.1097" timestamp="
|
|
324
|
+
<state x="559" y="310" width="1233" height="522" key="find.popup/0.23.1792.1097@0.23.1792.1097" timestamp="1602507247404" />
|
|
494
325
|
<state x="558" y="310" width="1234" height="580" key="find.popup/1792.-195.3440.1417/0.23.1792.1097@0.23.1792.1097" timestamp="1597748403272" />
|
|
495
|
-
<state x="2491" y="140" width="2369" height="738" key="find.popup/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="
|
|
326
|
+
<state x="2491" y="140" width="2369" height="738" key="find.popup/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1602165450739" />
|
|
496
327
|
<state x="558" y="310" width="1234" height="580" key="find.popup/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1600240789477" />
|
|
497
328
|
<state x="2390" y="-133" width="1322" height="582" key="find.popup/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599833255779" />
|
|
498
329
|
<state width="600" height="440" key="javadoc.popup" timestamp="1600096493461">
|
|
@@ -503,13 +334,13 @@
|
|
|
503
334
|
<screen x="1792" y="-410" width="1920" height="1057" />
|
|
504
335
|
</state>
|
|
505
336
|
<state x="2477" y="-143" key="refactoring.ChangeSignatureDialog/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599040674381" />
|
|
506
|
-
<state x="360" y="268" width="670" height="676" key="search.everywhere.popup" timestamp="
|
|
337
|
+
<state x="360" y="268" width="670" height="676" key="search.everywhere.popup" timestamp="1602584484081">
|
|
507
338
|
<screen x="0" y="23" width="1792" height="1097" />
|
|
508
339
|
</state>
|
|
509
340
|
<state x="360" y="268" width="670" height="676" key="search.everywhere.popup/-1920.-66.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1596101738778" />
|
|
510
|
-
<state x="360" y="268" width="670" height="676" key="search.everywhere.popup/0.23.1792.1097@0.23.1792.1097" timestamp="
|
|
341
|
+
<state x="360" y="268" width="670" height="676" key="search.everywhere.popup/0.23.1792.1097@0.23.1792.1097" timestamp="1602584484081" />
|
|
511
342
|
<state x="360" y="268" width="671" height="677" key="search.everywhere.popup/1792.-195.3440.1417/0.23.1792.1097@0.23.1792.1097" timestamp="1597748285464" />
|
|
512
|
-
<state x="2484" y="121" width="1287" height="875" key="search.everywhere.popup/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="
|
|
343
|
+
<state x="2484" y="121" width="1287" height="875" key="search.everywhere.popup/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1601982106446" />
|
|
513
344
|
<state x="360" y="268" width="671" height="677" key="search.everywhere.popup/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1600242616490" />
|
|
514
345
|
<state x="2178" y="-174" width="718" height="652" key="search.everywhere.popup/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599833679258" />
|
|
515
346
|
</component>
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hedia/recommendation-screen",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Hedia Recommendation Screen for Bolus and Carbohydrates",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"a": "cd android && gradlew clean && cd .. && react-native run-android",
|
|
7
|
+
"a": "index-git.sh && cd android && gradlew clean && cd .. && react-native run-android",
|
|
8
8
|
"start": "react-native start",
|
|
9
|
-
"la": "cd ./android && ./gradlew clean && cd .. && gnome-terminal -- /bin/bash -c \"wmctrl -c 'Terminal';react-native start $SHELL\" && react-native run-android",
|
|
9
|
+
"la": "./index-git.sh && cd ./android && ./gradlew clean && cd .. && gnome-terminal -- /bin/bash -c \"wmctrl -c 'Terminal';react-native start $SHELL\" && react-native run-android",
|
|
10
10
|
"lint": "tslint --project .",
|
|
11
11
|
"lint-fix": "tslint --fix --project .",
|
|
12
12
|
"lint-pkg": "npmPkgJsonLint .",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@babel/preset-react": "7.10.1",
|
|
43
43
|
"@babel/preset-typescript": "7.10.1",
|
|
44
44
|
"@hedia/recommendation-calculator": "1.3.0",
|
|
45
|
+
"@hedia/types": "1.0.2",
|
|
45
46
|
"@lingui/babel-preset-react": "2.9.1",
|
|
46
47
|
"@lingui/cli": "2.9.1",
|
|
47
48
|
"@lingui/macro": "2.9.1",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { AppStateStatus } from "react-native";
|
|
3
|
-
import {
|
|
3
|
+
import { InjectionMethod, Language, MoodEnum } from "./types/enum";
|
|
4
4
|
import * as Calculator from "@hedia/recommendation-calculator";
|
|
5
|
+
import { BloodGlucoseUnit, BloodKetonesUnit } from "@hedia/types";
|
|
5
6
|
import { RecommendationError } from "./utils/RecommendationError";
|
|
6
7
|
import { IActivityDisplayProps, logbookEntry } from "./types/types";
|
|
7
8
|
import { AttentionMessage } from "./utils/AttentionMessages";
|
|
@@ -10,18 +11,20 @@ interface IResult {
|
|
|
10
11
|
entered?: number;
|
|
11
12
|
}
|
|
12
13
|
export interface IRecommendationProps {
|
|
13
|
-
|
|
14
|
+
bloodGlucoseUnit: BloodGlucoseUnit;
|
|
14
15
|
language: Language;
|
|
15
16
|
userReminder: number;
|
|
16
17
|
calculatorParams: Calculator.IRecommendationParams;
|
|
17
18
|
injectionMethod: InjectionMethod;
|
|
19
|
+
currentBKL: number;
|
|
20
|
+
bloodKetoneUnit: BloodKetonesUnit;
|
|
18
21
|
latestLogbookFrom6Hours: logbookEntry;
|
|
19
22
|
activityDisplayProps: IActivityDisplayProps;
|
|
20
23
|
carbRecommendationAnswer(carbRecommendationAnswer: boolean): void;
|
|
21
24
|
closeCalculationCallback(): void;
|
|
22
25
|
exitCallback(): void;
|
|
23
26
|
onRecentInsulinYes(): void;
|
|
24
|
-
transferToLogbook(carbs: IResult, insulin: IResult, reminder: number, recommendationDate: Date): void;
|
|
27
|
+
transferToLogbook(carbs: IResult, insulin: IResult, reminder: number, recommendationDate: Date, mood: MoodEnum): void;
|
|
25
28
|
onError(error: RecommendationError): void;
|
|
26
29
|
showBolusBar(toggle: boolean): void;
|
|
27
30
|
restartCalculation(): void;
|
|
@@ -133,11 +133,11 @@ class RecommendationScreen extends react_1.default.Component {
|
|
|
133
133
|
this.setState({ enteredInsulin });
|
|
134
134
|
};
|
|
135
135
|
this.handleTransfer = () => {
|
|
136
|
-
const { enteredCarbs, enteredInsulin, insulinRecommendation, remeasureTime, showExitModal } = this.state;
|
|
136
|
+
const { enteredCarbs, enteredInsulin, insulinRecommendation, remeasureTime, showExitModal, selectedMood, } = this.state;
|
|
137
137
|
const carbs = { suggested: this.suggestedCarbs, entered: enteredCarbs };
|
|
138
138
|
const insulin = { suggested: insulinRecommendation, entered: enteredInsulin };
|
|
139
139
|
showExitModal ? this.hideExitModal() : this.hideTimeoutModal();
|
|
140
|
-
this.props.transferToLogbook(carbs, insulin, remeasureTime, this.recommendationDate);
|
|
140
|
+
this.props.transferToLogbook(carbs, insulin, remeasureTime, this.recommendationDate, selectedMood);
|
|
141
141
|
};
|
|
142
142
|
this.getBGLevelAttentionMessage = () => {
|
|
143
143
|
const { calculatorParams, latestLogbookFrom6Hours } = this.props;
|
|
@@ -195,14 +195,16 @@ class RecommendationScreen extends react_1.default.Component {
|
|
|
195
195
|
return <react_native_1.View style={containerStyles.container}/>;
|
|
196
196
|
}
|
|
197
197
|
const { activeInsulin, recommendationModal, carbRecommendation, enteredCarbs, enteredInsulin, insulinRecommendation, activityReduction, isRecommendationDisplayed, } = this.state;
|
|
198
|
-
const { calculatorParams,
|
|
198
|
+
const { calculatorParams, bloodGlucoseUnit, currentBKL, bloodKetoneUnit } = this.props;
|
|
199
199
|
const { currentBGL, carbohydrates } = calculatorParams;
|
|
200
|
-
const displayedBGL =
|
|
200
|
+
const displayedBGL = Utils_1.Utils.displayedBGLValue(currentBGL, bloodGlucoseUnit);
|
|
201
|
+
const displayedBKL = Utils_1.Utils.displayedBKLValue(currentBKL, bloodKetoneUnit);
|
|
201
202
|
return (<react_2.I18nProvider language={this.props.language} i18n={i18nUtils_1.i18n}>
|
|
202
203
|
<react_native_1.ScrollView style={containerStyles.container} ref={(view) => (this.scrollView = view)}>
|
|
203
204
|
<Header_1.default exitCallback={this.onExit}/>
|
|
204
|
-
<InfoBars_1.default label={i18nUtils_1.i18n._(macro_1.t `Active Insulin`)} value={activeInsulin ? `${activeInsulin.toFixed(1)}` : null}
|
|
205
|
-
<InfoBars_1.default label={i18nUtils_1.i18n._(macro_1.t `Blood Glucose Level`)} value={currentBGL ? `${displayedBGL}` : null}
|
|
205
|
+
<InfoBars_1.default label={i18nUtils_1.i18n._(macro_1.t `Active Insulin`)} value={activeInsulin ? `${activeInsulin.toFixed(1)}` : null} unit={i18nUtils_1.i18n._(macro_1.t `units`)} showNullAsDash={false}/>
|
|
206
|
+
<InfoBars_1.default label={i18nUtils_1.i18n._(macro_1.t `Blood Glucose Level`)} value={currentBGL ? `${displayedBGL}` : null} unit={this.props.bloodGlucoseUnit} showNullAsDash={true}/>
|
|
207
|
+
<InfoBars_1.default label={i18nUtils_1.i18n._(macro_1.t `Blood Ketone Level`)} value={currentBKL !== null ? `${displayedBKL}` : null} unit={this.props.bloodKetoneUnit} showNullAsDash={true}/>
|
|
206
208
|
<react_native_1.View style={containerStyles.calcContainer}>
|
|
207
209
|
<react_native_1.View style={containerStyles.calcMargin}>
|
|
208
210
|
<react_native_1.View style={[
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { AppState, AppStateStatus, ScrollView, StyleSheet, View, YellowBox } from "react-native";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { InjectionMethod, Language, Milliseconds, MoodEnum } from "./types/enum";
|
|
5
5
|
import { BACKGROUND_COLOUR_PURPLE, BORDER_COLOUR_GREY, BORDER_COLOUR_TEAL } from "./utils/Constants";
|
|
6
6
|
|
|
7
7
|
import Header, { headerStyles } from "./components/Header";
|
|
@@ -12,6 +12,7 @@ import RecommendedInsulin from "./components/RecommendedInsulin";
|
|
|
12
12
|
import Remeasure from "./components/Remeasure";
|
|
13
13
|
|
|
14
14
|
import * as Calculator from "@hedia/recommendation-calculator";
|
|
15
|
+
import { BloodGlucoseUnit, BloodKetonesUnit } from "@hedia/types";
|
|
15
16
|
import { I18nProvider } from "@lingui/react";
|
|
16
17
|
import Emotion from "./components/mood/Emotion";
|
|
17
18
|
import TransferToLogbook from "./components/TransferToLogbook";
|
|
@@ -41,11 +42,13 @@ interface IResult {
|
|
|
41
42
|
|
|
42
43
|
export interface IRecommendationProps {
|
|
43
44
|
// Values
|
|
44
|
-
|
|
45
|
+
bloodGlucoseUnit: BloodGlucoseUnit;
|
|
45
46
|
language: Language;
|
|
46
47
|
userReminder: number;
|
|
47
48
|
calculatorParams: Calculator.IRecommendationParams;
|
|
48
49
|
injectionMethod: InjectionMethod;
|
|
50
|
+
currentBKL: number;
|
|
51
|
+
bloodKetoneUnit: BloodKetonesUnit;
|
|
49
52
|
latestLogbookFrom6Hours: logbookEntry;
|
|
50
53
|
activityDisplayProps: IActivityDisplayProps;
|
|
51
54
|
|
|
@@ -54,7 +57,13 @@ export interface IRecommendationProps {
|
|
|
54
57
|
closeCalculationCallback(): void;
|
|
55
58
|
exitCallback(): void;
|
|
56
59
|
onRecentInsulinYes(): void;
|
|
57
|
-
transferToLogbook(
|
|
60
|
+
transferToLogbook(
|
|
61
|
+
carbs: IResult,
|
|
62
|
+
insulin: IResult,
|
|
63
|
+
reminder: number,
|
|
64
|
+
recommendationDate: Date,
|
|
65
|
+
mood: MoodEnum,
|
|
66
|
+
): void;
|
|
58
67
|
onError(error: RecommendationError): void;
|
|
59
68
|
showBolusBar(toggle: boolean): void;
|
|
60
69
|
restartCalculation(): void;
|
|
@@ -228,12 +237,19 @@ export default class RecommendationScreen extends React.Component<IRecommendatio
|
|
|
228
237
|
};
|
|
229
238
|
|
|
230
239
|
public handleTransfer = (): void => {
|
|
231
|
-
const {
|
|
240
|
+
const {
|
|
241
|
+
enteredCarbs,
|
|
242
|
+
enteredInsulin,
|
|
243
|
+
insulinRecommendation,
|
|
244
|
+
remeasureTime,
|
|
245
|
+
showExitModal,
|
|
246
|
+
selectedMood,
|
|
247
|
+
} = this.state;
|
|
232
248
|
const carbs: IResult = { suggested: this.suggestedCarbs, entered: enteredCarbs };
|
|
233
249
|
const insulin: IResult = { suggested: insulinRecommendation, entered: enteredInsulin };
|
|
234
250
|
|
|
235
251
|
showExitModal ? this.hideExitModal() : this.hideTimeoutModal();
|
|
236
|
-
this.props.transferToLogbook(carbs, insulin, remeasureTime, this.recommendationDate);
|
|
252
|
+
this.props.transferToLogbook(carbs, insulin, remeasureTime, this.recommendationDate, selectedMood);
|
|
237
253
|
};
|
|
238
254
|
|
|
239
255
|
public getBGLevelAttentionMessage = (): AttentionMessage => {
|
|
@@ -270,9 +286,10 @@ export default class RecommendationScreen extends React.Component<IRecommendatio
|
|
|
270
286
|
activityReduction,
|
|
271
287
|
isRecommendationDisplayed,
|
|
272
288
|
} = this.state;
|
|
273
|
-
const { calculatorParams,
|
|
289
|
+
const { calculatorParams, bloodGlucoseUnit, currentBKL, bloodKetoneUnit } = this.props;
|
|
274
290
|
const { currentBGL, carbohydrates } = calculatorParams;
|
|
275
|
-
const displayedBGL =
|
|
291
|
+
const displayedBGL = Utils.displayedBGLValue(currentBGL, bloodGlucoseUnit);
|
|
292
|
+
const displayedBKL = Utils.displayedBKLValue(currentBKL, bloodKetoneUnit);
|
|
276
293
|
|
|
277
294
|
return (
|
|
278
295
|
<I18nProvider language={this.props.language} i18n={i18n}>
|
|
@@ -281,13 +298,19 @@ export default class RecommendationScreen extends React.Component<IRecommendatio
|
|
|
281
298
|
<InfoBars
|
|
282
299
|
label={i18n._(t`Active Insulin`)}
|
|
283
300
|
value={activeInsulin ? `${activeInsulin.toFixed(1)}` : null}
|
|
284
|
-
|
|
301
|
+
unit={i18n._(t`units`)}
|
|
285
302
|
showNullAsDash={false}
|
|
286
303
|
/>
|
|
287
304
|
<InfoBars
|
|
288
305
|
label={i18n._(t`Blood Glucose Level`)}
|
|
289
306
|
value={currentBGL ? `${displayedBGL}` : null}
|
|
290
|
-
|
|
307
|
+
unit={this.props.bloodGlucoseUnit}
|
|
308
|
+
showNullAsDash={true}
|
|
309
|
+
/>
|
|
310
|
+
<InfoBars
|
|
311
|
+
label={i18n._(t`Blood Ketone Level`)}
|
|
312
|
+
value={currentBKL !== null ? `${displayedBKL}` : null}
|
|
313
|
+
unit={this.props.bloodKetoneUnit}
|
|
291
314
|
showNullAsDash={true}
|
|
292
315
|
/>
|
|
293
316
|
<View style={containerStyles.calcContainer}>
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { BloodGlucoseUnit, BloodKetonesUnit } from "@hedia/types";
|
|
1
2
|
import React from "react";
|
|
2
3
|
export interface IProps {
|
|
3
4
|
label: string;
|
|
4
5
|
value?: string;
|
|
5
|
-
|
|
6
|
+
unit: string | BloodGlucoseUnit | BloodKetonesUnit;
|
|
6
7
|
showNullAsDash: boolean;
|
|
7
8
|
}
|
|
8
9
|
export default class InfoBars extends React.Component<IProps> {
|
|
10
|
+
displayValue: () => string;
|
|
11
|
+
displayUnit: () => string;
|
|
9
12
|
render(): JSX.Element;
|
|
10
13
|
}
|
|
11
14
|
export declare const infoStyles: {
|
|
@@ -4,13 +4,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.infoStyles = void 0;
|
|
7
|
+
const types_1 = require("@hedia/types");
|
|
8
|
+
const macro_1 = require("@lingui/macro");
|
|
7
9
|
const react_1 = __importDefault(require("react"));
|
|
8
10
|
const react_native_1 = require("react-native");
|
|
11
|
+
const i18nUtils_1 = require("../locale/i18nUtils");
|
|
9
12
|
const Constants_1 = require("../utils/Constants");
|
|
13
|
+
const Utils_1 = require("../utils/Utils");
|
|
10
14
|
const Header_1 = require("./Header");
|
|
11
15
|
class InfoBars extends react_1.default.Component {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.displayValue = () => {
|
|
19
|
+
const { showNullAsDash, unit, value } = this.props;
|
|
20
|
+
const noDecimal = unit === types_1.BloodGlucoseUnit.MG_DL || unit === types_1.BloodKetonesUnit.MG_DL;
|
|
21
|
+
const nullPlaceholder = noDecimal ? `-` : `-.-`;
|
|
22
|
+
return value ?? (showNullAsDash ? nullPlaceholder : `0`);
|
|
23
|
+
};
|
|
24
|
+
this.displayUnit = () => {
|
|
25
|
+
const { unit } = this.props;
|
|
26
|
+
return unit === i18nUtils_1.i18n._(macro_1.t `units`) ? unit : Utils_1.Utils.formatUnit(unit);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
12
29
|
render() {
|
|
13
|
-
const displayedValue = this.props.value ?? (this.props.showNullAsDash ? `-.-` : `0`);
|
|
14
30
|
return (<react_native_1.View style={exports.infoStyles.container}>
|
|
15
31
|
<react_native_1.View style={exports.infoStyles.margin}>
|
|
16
32
|
<react_native_1.View style={exports.infoStyles.border}>
|
|
@@ -20,10 +36,10 @@ class InfoBars extends react_1.default.Component {
|
|
|
20
36
|
</react_native_1.View>
|
|
21
37
|
<react_native_1.View style={exports.infoStyles.valueUnitContainer}>
|
|
22
38
|
<react_native_1.View style={exports.infoStyles.valueContainer}>
|
|
23
|
-
<react_native_1.Text style={exports.infoStyles.value}>{
|
|
39
|
+
<react_native_1.Text style={exports.infoStyles.value}>{this.displayValue()}</react_native_1.Text>
|
|
24
40
|
</react_native_1.View>
|
|
25
41
|
<react_native_1.View style={exports.infoStyles.unitContainer}>
|
|
26
|
-
<react_native_1.Text style={exports.infoStyles.units}>{this.
|
|
42
|
+
<react_native_1.Text style={exports.infoStyles.units}>{this.displayUnit()}</react_native_1.Text>
|
|
27
43
|
</react_native_1.View>
|
|
28
44
|
</react_native_1.View>
|
|
29
45
|
</react_native_1.View>
|