@hedia/recommendation-screen 2.1.73 → 2.1.74-alpha.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/lib/commonjs/RecommendationScreen.js +768 -0
- package/lib/commonjs/RecommendationScreen.js.map +1 -0
- package/lib/commonjs/assets/IconsSVG/Close.js +20 -0
- package/lib/commonjs/assets/IconsSVG/Close.js.map +1 -0
- package/lib/commonjs/assets/IconsSVG/CloseOutlined.js +28 -0
- package/lib/commonjs/assets/IconsSVG/CloseOutlined.js.map +1 -0
- package/lib/commonjs/assets/IconsSVG/Edit.js +23 -0
- package/lib/commonjs/assets/IconsSVG/Edit.js.map +1 -0
- package/lib/commonjs/assets/IconsSVG/activity/Cycling.js +43 -0
- package/lib/commonjs/assets/IconsSVG/activity/Cycling.js.map +1 -0
- package/lib/commonjs/assets/IconsSVG/activity/Running.js +33 -0
- package/lib/commonjs/assets/IconsSVG/activity/Running.js.map +1 -0
- package/lib/commonjs/assets/IconsSVG/activity/Stretching.js +33 -0
- package/lib/commonjs/assets/IconsSVG/activity/Stretching.js.map +1 -0
- package/lib/commonjs/assets/IconsSVG/activity/Swimming.js +48 -0
- package/lib/commonjs/assets/IconsSVG/activity/Swimming.js.map +1 -0
- package/lib/commonjs/assets/IconsSVG/activity/Walking.js +38 -0
- package/lib/commonjs/assets/IconsSVG/activity/Walking.js.map +1 -0
- package/lib/commonjs/assets/IconsSVG/mood/Happy.js +34 -0
- package/lib/commonjs/assets/IconsSVG/mood/Happy.js.map +1 -0
- package/lib/commonjs/assets/IconsSVG/mood/Neutral.js +34 -0
- package/lib/commonjs/assets/IconsSVG/mood/Neutral.js.map +1 -0
- package/lib/commonjs/assets/IconsSVG/mood/Sad.js +34 -0
- package/lib/commonjs/assets/IconsSVG/mood/Sad.js.map +1 -0
- package/lib/commonjs/assets/IconsSVG/mood/SemiHappy.js +34 -0
- package/lib/commonjs/assets/IconsSVG/mood/SemiHappy.js.map +1 -0
- package/lib/commonjs/assets/IconsSVG/mood/SemiSad.js +34 -0
- package/lib/commonjs/assets/IconsSVG/mood/SemiSad.js.map +1 -0
- package/lib/commonjs/components/ExitModal.js +124 -0
- package/lib/commonjs/components/ExitModal.js.map +1 -0
- package/lib/commonjs/components/InfoBars.js +123 -0
- package/lib/commonjs/components/InfoBars.js.map +1 -0
- package/lib/commonjs/components/InvisibleNumberInput.js +150 -0
- package/lib/commonjs/components/InvisibleNumberInput.js.map +1 -0
- package/lib/commonjs/components/LineSeparator.js +27 -0
- package/lib/commonjs/components/LineSeparator.js.map +1 -0
- package/lib/commonjs/components/RecentInsulin.js +105 -0
- package/lib/commonjs/components/RecentInsulin.js.map +1 -0
- package/lib/commonjs/components/RecommendationModal.js +302 -0
- package/lib/commonjs/components/RecommendationModal.js.map +1 -0
- package/lib/commonjs/components/RecommendedCarbs.js +289 -0
- package/lib/commonjs/components/RecommendedCarbs.js.map +1 -0
- package/lib/commonjs/components/RecommendedInsulin.js +208 -0
- package/lib/commonjs/components/RecommendedInsulin.js.map +1 -0
- package/lib/commonjs/components/Remeasure.js +131 -0
- package/lib/commonjs/components/Remeasure.js.map +1 -0
- package/lib/commonjs/components/Text.js +25 -0
- package/lib/commonjs/components/Text.js.map +1 -0
- package/lib/commonjs/components/TimeoutModal.js +113 -0
- package/lib/commonjs/components/TimeoutModal.js.map +1 -0
- package/lib/commonjs/components/TransferToLogbook.js +83 -0
- package/lib/commonjs/components/TransferToLogbook.js.map +1 -0
- package/lib/commonjs/components/activity/Activity.js +112 -0
- package/lib/commonjs/components/activity/Activity.js.map +1 -0
- package/lib/commonjs/components/activity/ActivityIcon.js +86 -0
- package/lib/commonjs/components/activity/ActivityIcon.js.map +1 -0
- package/lib/commonjs/components/activity/ActivityIntensity.js +65 -0
- package/lib/commonjs/components/activity/ActivityIntensity.js.map +1 -0
- package/lib/commonjs/components/mood/Emotion.js +86 -0
- package/lib/commonjs/components/mood/Emotion.js.map +1 -0
- package/lib/commonjs/components/mood/MoodIcon.js +107 -0
- package/lib/commonjs/components/mood/MoodIcon.js.map +1 -0
- package/lib/commonjs/components/styles/fonts.js +154 -0
- package/lib/commonjs/components/styles/fonts.js.map +1 -0
- package/lib/commonjs/index.js +21 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/locales/da/translations.json +82 -0
- package/lib/commonjs/locales/de/translations.json +81 -0
- package/lib/commonjs/locales/en/translations.json +84 -0
- package/lib/commonjs/locales/es/translations.json +81 -0
- package/lib/commonjs/locales/fr/translations.json +81 -0
- package/lib/commonjs/locales/it/translations.json +81 -0
- package/lib/commonjs/locales/translate.js +63 -0
- package/lib/commonjs/locales/translate.js.map +1 -0
- package/lib/commonjs/types/enum.js +179 -0
- package/lib/commonjs/types/enum.js.map +1 -0
- package/lib/commonjs/types/types.js +6 -0
- package/lib/commonjs/types/types.js.map +1 -0
- package/lib/commonjs/utils/AttentionMessages.js +141 -0
- package/lib/commonjs/utils/AttentionMessages.js.map +1 -0
- package/lib/commonjs/utils/Constants.js +138 -0
- package/lib/commonjs/utils/Constants.js.map +1 -0
- package/lib/commonjs/utils/RecommendationError.js +116 -0
- package/lib/commonjs/utils/RecommendationError.js.map +1 -0
- package/lib/commonjs/utils/RecommendationUtils.js +212 -0
- package/lib/commonjs/utils/RecommendationUtils.js.map +1 -0
- package/lib/commonjs/utils/Translations.js +22 -0
- package/lib/commonjs/utils/Translations.js.map +1 -0
- package/lib/commonjs/utils/Utils.js +162 -0
- package/lib/commonjs/utils/Utils.js.map +1 -0
- package/lib/commonjs/utils/Validations.js +468 -0
- package/lib/commonjs/utils/Validations.js.map +1 -0
- package/lib/module/RecommendationScreen.js +758 -0
- package/lib/module/RecommendationScreen.js.map +1 -0
- package/lib/module/assets/IconsSVG/Close.js +11 -0
- package/lib/module/assets/IconsSVG/Close.js.map +1 -0
- package/lib/module/assets/IconsSVG/CloseOutlined.js +19 -0
- package/lib/module/assets/IconsSVG/CloseOutlined.js.map +1 -0
- package/lib/module/assets/IconsSVG/Edit.js +14 -0
- package/lib/module/assets/IconsSVG/Edit.js.map +1 -0
- package/lib/module/assets/IconsSVG/activity/Cycling.js +34 -0
- package/lib/module/assets/IconsSVG/activity/Cycling.js.map +1 -0
- package/lib/module/assets/IconsSVG/activity/Running.js +24 -0
- package/lib/module/assets/IconsSVG/activity/Running.js.map +1 -0
- package/lib/module/assets/IconsSVG/activity/Stretching.js +24 -0
- package/lib/module/assets/IconsSVG/activity/Stretching.js.map +1 -0
- package/lib/module/assets/IconsSVG/activity/Swimming.js +39 -0
- package/lib/module/assets/IconsSVG/activity/Swimming.js.map +1 -0
- package/lib/module/assets/IconsSVG/activity/Walking.js +29 -0
- package/lib/module/assets/IconsSVG/activity/Walking.js.map +1 -0
- package/lib/module/assets/IconsSVG/mood/Happy.js +25 -0
- package/lib/module/assets/IconsSVG/mood/Happy.js.map +1 -0
- package/lib/module/assets/IconsSVG/mood/Neutral.js +25 -0
- package/lib/module/assets/IconsSVG/mood/Neutral.js.map +1 -0
- package/lib/module/assets/IconsSVG/mood/Sad.js +25 -0
- package/lib/module/assets/IconsSVG/mood/Sad.js.map +1 -0
- package/lib/module/assets/IconsSVG/mood/SemiHappy.js +25 -0
- package/lib/module/assets/IconsSVG/mood/SemiHappy.js.map +1 -0
- package/lib/module/assets/IconsSVG/mood/SemiSad.js +25 -0
- package/lib/module/assets/IconsSVG/mood/SemiSad.js.map +1 -0
- package/lib/module/components/ExitModal.js +114 -0
- package/lib/module/components/ExitModal.js.map +1 -0
- package/lib/module/components/InfoBars.js +114 -0
- package/lib/module/components/InfoBars.js.map +1 -0
- package/lib/module/components/InvisibleNumberInput.js +142 -0
- package/lib/module/components/InvisibleNumberInput.js.map +1 -0
- package/lib/module/components/LineSeparator.js +19 -0
- package/lib/module/components/LineSeparator.js.map +1 -0
- package/lib/module/components/RecentInsulin.js +97 -0
- package/lib/module/components/RecentInsulin.js.map +1 -0
- package/lib/module/components/RecommendationModal.js +291 -0
- package/lib/module/components/RecommendationModal.js.map +1 -0
- package/lib/module/components/RecommendedCarbs.js +281 -0
- package/lib/module/components/RecommendedCarbs.js.map +1 -0
- package/lib/module/components/RecommendedInsulin.js +200 -0
- package/lib/module/components/RecommendedInsulin.js.map +1 -0
- package/lib/module/components/Remeasure.js +123 -0
- package/lib/module/components/Remeasure.js.map +1 -0
- package/lib/module/components/Text.js +16 -0
- package/lib/module/components/Text.js.map +1 -0
- package/lib/module/components/TimeoutModal.js +103 -0
- package/lib/module/components/TimeoutModal.js.map +1 -0
- package/lib/module/components/TransferToLogbook.js +75 -0
- package/lib/module/components/TransferToLogbook.js.map +1 -0
- package/lib/module/components/activity/Activity.js +104 -0
- package/lib/module/components/activity/Activity.js.map +1 -0
- package/lib/module/components/activity/ActivityIcon.js +78 -0
- package/lib/module/components/activity/ActivityIcon.js.map +1 -0
- package/lib/module/components/activity/ActivityIntensity.js +57 -0
- package/lib/module/components/activity/ActivityIntensity.js.map +1 -0
- package/lib/module/components/mood/Emotion.js +78 -0
- package/lib/module/components/mood/Emotion.js.map +1 -0
- package/lib/module/components/mood/MoodIcon.js +97 -0
- package/lib/module/components/mood/MoodIcon.js.map +1 -0
- package/lib/module/components/styles/fonts.js +145 -0
- package/lib/module/components/styles/fonts.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/locales/da/translations.json +82 -0
- package/lib/module/locales/de/translations.json +81 -0
- package/lib/module/locales/en/translations.json +84 -0
- package/lib/module/locales/es/translations.json +81 -0
- package/lib/module/locales/fr/translations.json +81 -0
- package/lib/module/locales/it/translations.json +81 -0
- package/lib/module/locales/translate.js +55 -0
- package/lib/module/locales/translate.js.map +1 -0
- package/lib/module/types/enum.js +170 -0
- package/lib/module/types/enum.js.map +1 -0
- package/lib/module/types/types.js.map +1 -0
- package/lib/module/utils/AttentionMessages.js +131 -0
- package/lib/module/utils/AttentionMessages.js.map +1 -0
- package/{dist/src → lib/module}/utils/Constants.js +78 -35
- package/lib/module/utils/Constants.js.map +1 -0
- package/{dist/src → lib/module}/utils/RecommendationError.js +28 -6
- package/lib/module/utils/RecommendationError.js.map +1 -0
- package/{dist/src → lib/module}/utils/RecommendationUtils.js +89 -90
- package/lib/module/utils/RecommendationUtils.js.map +1 -0
- package/{dist/src → lib/module}/utils/Translations.js +5 -3
- package/lib/module/utils/Translations.js.map +1 -0
- package/lib/module/utils/Utils.js +155 -0
- package/lib/module/utils/Utils.js.map +1 -0
- package/{dist/src → lib/module}/utils/Validations.js +155 -128
- package/lib/module/utils/Validations.js.map +1 -0
- package/{dist/src → lib/typescript}/RecommendationScreen.d.ts +2 -1
- package/lib/typescript/RecommendationScreen.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/assets/IconsSVG/Close.d.ts +1 -0
- package/lib/typescript/assets/IconsSVG/Close.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/assets/IconsSVG/CloseOutlined.d.ts +1 -0
- package/lib/typescript/assets/IconsSVG/CloseOutlined.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/assets/IconsSVG/Edit.d.ts +1 -0
- package/lib/typescript/assets/IconsSVG/Edit.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/assets/IconsSVG/activity/Cycling.d.ts +1 -0
- package/lib/typescript/assets/IconsSVG/activity/Cycling.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/assets/IconsSVG/activity/Running.d.ts +1 -0
- package/lib/typescript/assets/IconsSVG/activity/Running.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/assets/IconsSVG/activity/Stretching.d.ts +1 -0
- package/lib/typescript/assets/IconsSVG/activity/Stretching.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/assets/IconsSVG/activity/Swimming.d.ts +1 -0
- package/lib/typescript/assets/IconsSVG/activity/Swimming.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/assets/IconsSVG/activity/Walking.d.ts +1 -0
- package/lib/typescript/assets/IconsSVG/activity/Walking.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/assets/IconsSVG/mood/Happy.d.ts +1 -0
- package/lib/typescript/assets/IconsSVG/mood/Happy.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/assets/IconsSVG/mood/Neutral.d.ts +1 -0
- package/lib/typescript/assets/IconsSVG/mood/Neutral.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/assets/IconsSVG/mood/Sad.d.ts +1 -0
- package/lib/typescript/assets/IconsSVG/mood/Sad.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/assets/IconsSVG/mood/SemiHappy.d.ts +1 -0
- package/lib/typescript/assets/IconsSVG/mood/SemiHappy.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/assets/IconsSVG/mood/SemiSad.d.ts +1 -0
- package/lib/typescript/assets/IconsSVG/mood/SemiSad.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/ExitModal.d.ts +1 -0
- package/lib/typescript/components/ExitModal.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/InfoBars.d.ts +1 -0
- package/lib/typescript/components/InfoBars.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/InvisibleNumberInput.d.ts +1 -0
- package/lib/typescript/components/InvisibleNumberInput.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/LineSeparator.d.ts +1 -0
- package/lib/typescript/components/LineSeparator.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/RecentInsulin.d.ts +1 -0
- package/lib/typescript/components/RecentInsulin.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/RecommendationModal.d.ts +1 -0
- package/lib/typescript/components/RecommendationModal.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/RecommendedCarbs.d.ts +1 -0
- package/lib/typescript/components/RecommendedCarbs.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/RecommendedInsulin.d.ts +1 -0
- package/lib/typescript/components/RecommendedInsulin.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/Remeasure.d.ts +1 -0
- package/lib/typescript/components/Remeasure.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/Text.d.ts +1 -0
- package/lib/typescript/components/Text.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/TimeoutModal.d.ts +1 -0
- package/lib/typescript/components/TimeoutModal.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/TransferToLogbook.d.ts +1 -0
- package/lib/typescript/components/TransferToLogbook.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/activity/Activity.d.ts +1 -0
- package/lib/typescript/components/activity/Activity.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/activity/ActivityIcon.d.ts +1 -0
- package/lib/typescript/components/activity/ActivityIcon.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/activity/ActivityIntensity.d.ts +1 -0
- package/lib/typescript/components/activity/ActivityIntensity.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/mood/Emotion.d.ts +1 -0
- package/lib/typescript/components/mood/Emotion.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/mood/MoodIcon.d.ts +1 -0
- package/lib/typescript/components/mood/MoodIcon.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/components/styles/fonts.d.ts +1 -0
- package/lib/typescript/components/styles/fonts.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +5 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/locales/translate.d.ts +1 -0
- package/lib/typescript/locales/translate.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/types/enum.d.ts +1 -0
- package/lib/typescript/types/enum.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/types/types.d.ts +1 -0
- package/lib/typescript/types/types.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/utils/AttentionMessages.d.ts +1 -0
- package/lib/typescript/utils/AttentionMessages.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/utils/Constants.d.ts +1 -0
- package/lib/typescript/utils/Constants.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/utils/RecommendationError.d.ts +1 -0
- package/lib/typescript/utils/RecommendationError.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/utils/RecommendationUtils.d.ts +1 -0
- package/lib/typescript/utils/RecommendationUtils.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/utils/Translations.d.ts +1 -0
- package/lib/typescript/utils/Translations.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/utils/Utils.d.ts +1 -0
- package/lib/typescript/utils/Utils.d.ts.map +1 -0
- package/{dist/src → lib/typescript}/utils/Validations.d.ts +1 -0
- package/lib/typescript/utils/Validations.d.ts.map +1 -0
- package/package.json +27 -7
- package/src/RecommendationScreen.tsx +854 -0
- package/src/assets/IconsSVG/Close.tsx +13 -0
- package/src/assets/IconsSVG/CloseOutlined.tsx +23 -0
- package/src/assets/IconsSVG/Edit.tsx +16 -0
- package/src/assets/IconsSVG/activity/Cycling.tsx +41 -0
- package/src/assets/IconsSVG/activity/Running.tsx +29 -0
- package/src/assets/IconsSVG/activity/Stretching.tsx +29 -0
- package/src/assets/IconsSVG/activity/Swimming.tsx +47 -0
- package/src/assets/IconsSVG/activity/Walking.tsx +35 -0
- package/src/assets/IconsSVG/mood/Happy.tsx +30 -0
- package/src/assets/IconsSVG/mood/Neutral.tsx +30 -0
- package/src/assets/IconsSVG/mood/Sad.tsx +30 -0
- package/src/assets/IconsSVG/mood/SemiHappy.tsx +30 -0
- package/src/assets/IconsSVG/mood/SemiSad.tsx +30 -0
- package/src/components/ExitModal.tsx +134 -0
- package/src/components/InfoBars.tsx +122 -0
- package/src/components/InvisibleNumberInput.tsx +170 -0
- package/src/components/LineSeparator.tsx +29 -0
- package/src/components/RecentInsulin.tsx +109 -0
- package/src/components/RecommendationModal.tsx +319 -0
- package/src/components/RecommendedCarbs.tsx +303 -0
- package/src/components/RecommendedInsulin.tsx +219 -0
- package/src/components/Remeasure.tsx +135 -0
- package/src/components/Text.tsx +27 -0
- package/src/components/TimeoutModal.tsx +121 -0
- package/src/components/TransferToLogbook.tsx +92 -0
- package/src/components/activity/Activity.tsx +107 -0
- package/src/components/activity/ActivityIcon.tsx +77 -0
- package/src/components/activity/ActivityIntensity.tsx +67 -0
- package/src/components/mood/Emotion.tsx +97 -0
- package/src/components/mood/MoodIcon.tsx +91 -0
- package/src/components/styles/fonts.ts +145 -0
- package/src/index.ts +5 -0
- package/src/locales/da/translations.json +82 -0
- package/src/locales/de/translations.json +81 -0
- package/src/locales/en/translations.json +84 -0
- package/src/locales/es/translations.json +81 -0
- package/src/locales/fr/translations.json +81 -0
- package/src/locales/it/translations.json +81 -0
- package/src/locales/translate.ts +62 -0
- package/src/types/enum.ts +164 -0
- package/src/types/types.ts +19 -0
- package/src/utils/AttentionMessages.ts +167 -0
- package/src/utils/Constants.ts +77 -0
- package/src/utils/RecommendationError.ts +182 -0
- package/src/utils/RecommendationUtils.ts +232 -0
- package/src/utils/Translations.ts +17 -0
- package/src/utils/Utils.ts +156 -0
- package/src/utils/Validations.ts +490 -0
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -6
- package/dist/index.js.map +0 -1
- package/dist/src/RecommendationScreen.js +0 -537
- package/dist/src/RecommendationScreen.js.map +0 -1
- package/dist/src/assets/IconsSVG/Close.js +0 -7
- package/dist/src/assets/IconsSVG/Close.js.map +0 -1
- package/dist/src/assets/IconsSVG/CloseOutlined.js +0 -9
- package/dist/src/assets/IconsSVG/CloseOutlined.js.map +0 -1
- package/dist/src/assets/IconsSVG/Edit.js +0 -8
- package/dist/src/assets/IconsSVG/Edit.js.map +0 -1
- package/dist/src/assets/IconsSVG/activity/Cycling.js +0 -12
- package/dist/src/assets/IconsSVG/activity/Cycling.js.map +0 -1
- package/dist/src/assets/IconsSVG/activity/Running.js +0 -10
- package/dist/src/assets/IconsSVG/activity/Running.js.map +0 -1
- package/dist/src/assets/IconsSVG/activity/Stretching.js +0 -10
- package/dist/src/assets/IconsSVG/activity/Stretching.js.map +0 -1
- package/dist/src/assets/IconsSVG/activity/Swimming.js +0 -13
- package/dist/src/assets/IconsSVG/activity/Swimming.js.map +0 -1
- package/dist/src/assets/IconsSVG/activity/Walking.js +0 -11
- package/dist/src/assets/IconsSVG/activity/Walking.js.map +0 -1
- package/dist/src/assets/IconsSVG/mood/Happy.js +0 -11
- package/dist/src/assets/IconsSVG/mood/Happy.js.map +0 -1
- package/dist/src/assets/IconsSVG/mood/Neutral.js +0 -11
- package/dist/src/assets/IconsSVG/mood/Neutral.js.map +0 -1
- package/dist/src/assets/IconsSVG/mood/Sad.js +0 -11
- package/dist/src/assets/IconsSVG/mood/Sad.js.map +0 -1
- package/dist/src/assets/IconsSVG/mood/SemiHappy.js +0 -11
- package/dist/src/assets/IconsSVG/mood/SemiHappy.js.map +0 -1
- package/dist/src/assets/IconsSVG/mood/SemiSad.js +0 -11
- package/dist/src/assets/IconsSVG/mood/SemiSad.js.map +0 -1
- package/dist/src/components/ExitModal.js +0 -91
- package/dist/src/components/ExitModal.js.map +0 -1
- package/dist/src/components/InfoBars.js +0 -98
- package/dist/src/components/InfoBars.js.map +0 -1
- package/dist/src/components/InvisibleNumberInput.js +0 -123
- package/dist/src/components/InvisibleNumberInput.js.map +0 -1
- package/dist/src/components/LineSeparator.js +0 -17
- package/dist/src/components/LineSeparator.js.map +0 -1
- package/dist/src/components/RecentInsulin.js +0 -90
- package/dist/src/components/RecentInsulin.js.map +0 -1
- package/dist/src/components/RecommendationModal.js +0 -241
- package/dist/src/components/RecommendationModal.js.map +0 -1
- package/dist/src/components/RecommendedCarbs.js +0 -234
- package/dist/src/components/RecommendedCarbs.js.map +0 -1
- package/dist/src/components/RecommendedInsulin.js +0 -166
- package/dist/src/components/RecommendedInsulin.js.map +0 -1
- package/dist/src/components/Remeasure.js +0 -103
- package/dist/src/components/Remeasure.js.map +0 -1
- package/dist/src/components/Text.js +0 -14
- package/dist/src/components/Text.js.map +0 -1
- package/dist/src/components/TimeoutModal.js +0 -84
- package/dist/src/components/TimeoutModal.js.map +0 -1
- package/dist/src/components/TransferToLogbook.js +0 -68
- package/dist/src/components/TransferToLogbook.js.map +0 -1
- package/dist/src/components/activity/Activity.js +0 -93
- package/dist/src/components/activity/Activity.js.map +0 -1
- package/dist/src/components/activity/ActivityIcon.js +0 -66
- package/dist/src/components/activity/ActivityIcon.js.map +0 -1
- package/dist/src/components/activity/ActivityIntensity.js +0 -55
- package/dist/src/components/activity/ActivityIntensity.js.map +0 -1
- package/dist/src/components/mood/Emotion.js +0 -69
- package/dist/src/components/mood/Emotion.js.map +0 -1
- package/dist/src/components/mood/MoodIcon.js +0 -68
- package/dist/src/components/mood/MoodIcon.js.map +0 -1
- package/dist/src/components/styles/fonts.js +0 -145
- package/dist/src/components/styles/fonts.js.map +0 -1
- package/dist/src/locales/da/translations.json +0 -82
- package/dist/src/locales/de/translations.json +0 -81
- package/dist/src/locales/en/translations.json +0 -84
- package/dist/src/locales/es/translations.json +0 -81
- package/dist/src/locales/fr/translations.json +0 -81
- package/dist/src/locales/it/translations.json +0 -81
- package/dist/src/locales/translate.js +0 -53
- package/dist/src/locales/translate.js.map +0 -1
- package/dist/src/types/enum.js +0 -154
- package/dist/src/types/enum.js.map +0 -1
- package/dist/src/types/types.js.map +0 -1
- package/dist/src/utils/AttentionMessages.js +0 -123
- package/dist/src/utils/AttentionMessages.js.map +0 -1
- package/dist/src/utils/Constants.js.map +0 -1
- package/dist/src/utils/RecommendationError.js.map +0 -1
- package/dist/src/utils/RecommendationUtils.js.map +0 -1
- package/dist/src/utils/Translations.js.map +0 -1
- package/dist/src/utils/Utils.js +0 -142
- package/dist/src/utils/Utils.js.map +0 -1
- package/dist/src/utils/Validations.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- /package/{dist/src → lib/module}/types/types.js +0 -0
|
@@ -0,0 +1,768 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.RecommendationScreen = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeKeyboardAwareScrollView = require("react-native-keyboard-aware-scroll-view");
|
|
10
|
+
var Calculator = _interopRequireWildcard(require("@hedia/recommendation-calculator"));
|
|
11
|
+
var _types = require("@hedia/types");
|
|
12
|
+
var _Activity = _interopRequireDefault(require("./components/activity/Activity"));
|
|
13
|
+
var _ExitModal = _interopRequireDefault(require("./components/ExitModal"));
|
|
14
|
+
var _InfoBars = _interopRequireDefault(require("./components/InfoBars"));
|
|
15
|
+
var _Emotion = _interopRequireDefault(require("./components/mood/Emotion"));
|
|
16
|
+
var _RecentInsulin = _interopRequireDefault(require("./components/RecentInsulin"));
|
|
17
|
+
var _RecommendationModal = _interopRequireDefault(require("./components/RecommendationModal"));
|
|
18
|
+
var _RecommendedCarbs = _interopRequireDefault(require("./components/RecommendedCarbs"));
|
|
19
|
+
var _RecommendedInsulin = _interopRequireDefault(require("./components/RecommendedInsulin"));
|
|
20
|
+
var _Remeasure = _interopRequireDefault(require("./components/Remeasure"));
|
|
21
|
+
var _fonts = require("./components/styles/fonts");
|
|
22
|
+
var _Text = _interopRequireDefault(require("./components/Text"));
|
|
23
|
+
var _TimeoutModal = _interopRequireDefault(require("./components/TimeoutModal"));
|
|
24
|
+
var _TransferToLogbook = _interopRequireDefault(require("./components/TransferToLogbook"));
|
|
25
|
+
var _translate = require("./locales/translate");
|
|
26
|
+
var _enum = require("./types/enum");
|
|
27
|
+
var _AttentionMessages = require("./utils/AttentionMessages");
|
|
28
|
+
var _Constants = require("./utils/Constants");
|
|
29
|
+
var _RecommendationUtils = require("./utils/RecommendationUtils");
|
|
30
|
+
var _Utils = require("./utils/Utils");
|
|
31
|
+
var _Validations = require("./utils/Validations");
|
|
32
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
34
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
|
+
const {
|
|
36
|
+
InfoBarTestIds,
|
|
37
|
+
RecommendationScreenTestIds
|
|
38
|
+
} = _enum.Testing.Id;
|
|
39
|
+
|
|
40
|
+
// Ignoring long timer warnings
|
|
41
|
+
// https://github.com/facebook/react-native/issues/12981#issuecomment-652745831
|
|
42
|
+
_reactNative.LogBox.ignoreLogs([`Setting a timer`]);
|
|
43
|
+
|
|
44
|
+
/** Represents both a suggestion by HDA and an actual amount of either insulin or carbohydrates. */
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The RecommendationScreen is the React component that passes relevant inputs to the recommendation calculation module and presents
|
|
48
|
+
* the resulting recommendation along with related messages or warnings to the user.
|
|
49
|
+
* The RecommendationScreen component accepts properties with the user’s settings/preferences and other inputs needed for calculating a recommendation.
|
|
50
|
+
* @noInheritDoc
|
|
51
|
+
*/
|
|
52
|
+
class RecommendationScreen extends _react.default.Component {
|
|
53
|
+
/** Reference to the timer that prompts the user to make a new calculation after 15 minutes. */
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The carbohydrate recommendation for the user.
|
|
57
|
+
* This value is saved in a member variable because we want to store it unmodified if the logbook entry
|
|
58
|
+
* gets saved regardless of what other changes were made on the recommendation screen.
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* A guard against displaying wrong or dangerous information to the user.
|
|
63
|
+
* If an error has occurred, this variable will be set to true and an empty placeholder will be rendered instead of the normal recommendation screen.
|
|
64
|
+
*/
|
|
65
|
+
hasError = false;
|
|
66
|
+
/** The timestamp when the current recommendation was made. For determining if the recommendation is too old and should be hidden from the user. */
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Steps:
|
|
70
|
+
* 1. Call the super() method with the props.
|
|
71
|
+
* 2. Execute the following steps and if an exception is thrown, catch it, set the hasError member variable to true and call the onError callback prop with the caught exception as argument:
|
|
72
|
+
* - Call the validateParams() method with the props as argument
|
|
73
|
+
* - Set the recommendationDate member to the current date and time
|
|
74
|
+
* - Set the language by using the language prop as argument for calling changeLanguage()
|
|
75
|
+
* - Unpack recentBoluses from the calculatorParams prop.
|
|
76
|
+
* - Use the calculatorParams prop as argument for calling calculateRecommendation() and unpack all of the resulting values.
|
|
77
|
+
* - Call the onRecommendationDisplayed() callback prop if the recommendation is visible
|
|
78
|
+
* - Copy the carbRecommendation to the suggestedCarbs member variable.
|
|
79
|
+
* - Set the following state variables:
|
|
80
|
+
* - Set remeasureTime to the return value from calling the getBGLevelRemeasurementReminder() method.
|
|
81
|
+
* - Set isRecommendationDisplayed to be false if the length of recentBoluses is 0 or false otherwise.
|
|
82
|
+
* - Set insulinRecommendation to be the bolus insulin recommendation rounded using roundValue().
|
|
83
|
+
* - Set wasLimited to the wasLimited return value from calling calculateRecommendation() above.
|
|
84
|
+
* - Set activityReduction to the reduction returned from the calculation result.
|
|
85
|
+
* - Set carbRecommendation to the recommendation returned from the calculation result.
|
|
86
|
+
* - Set activeInsulin to the estimation returned from the calculation result.
|
|
87
|
+
* - Set enteredCarbs, enteredInsulin, selectedMood to null.
|
|
88
|
+
* - Set recommendationModal to be true if wasLimited is true or if carbRecommendation after being rounded is truthy or if the return value from calling the getBGLevelAttentionMessage() method is truthy.
|
|
89
|
+
* - Set onlyShowLimitationMessage, showTimeoutModal to be false.
|
|
90
|
+
* - Set showExitModal with the value of the showExitModal prop.
|
|
91
|
+
* 3. Start a 15 minute timer assigned to the timer member variable using the setTimeout() function. When the timer expires, call the showTimeoutModal() method.
|
|
92
|
+
* @param props The data required to initialise the Recommendation Screen
|
|
93
|
+
*/
|
|
94
|
+
constructor(props) {
|
|
95
|
+
super(props);
|
|
96
|
+
try {
|
|
97
|
+
(0, _Validations.validateParams)(props);
|
|
98
|
+
(0, _translate.changeLocale)(props.language);
|
|
99
|
+
this.recommendationDate = new Date();
|
|
100
|
+
const {
|
|
101
|
+
recentBoluses
|
|
102
|
+
} = props.calculatorParams;
|
|
103
|
+
const {
|
|
104
|
+
bolus,
|
|
105
|
+
carbRecommendation,
|
|
106
|
+
activityReduction,
|
|
107
|
+
wasLimited,
|
|
108
|
+
activeInsulin
|
|
109
|
+
} = Calculator.calculateRecommendation(props.calculatorParams);
|
|
110
|
+
this.suggestedCarbs = carbRecommendation;
|
|
111
|
+
const isRecommendationDisplayed = recentBoluses?.length !== 0;
|
|
112
|
+
if (isRecommendationDisplayed) {
|
|
113
|
+
this.props.onRecommendationDisplayed();
|
|
114
|
+
}
|
|
115
|
+
this.state = {
|
|
116
|
+
remeasureTime: this.getBGLevelRemeasurementReminder(),
|
|
117
|
+
isRecommendationDisplayed,
|
|
118
|
+
insulinRecommendation: _Utils.Utils.roundValue(bolus, props.injectionMethod),
|
|
119
|
+
wasLimited,
|
|
120
|
+
activityReduction,
|
|
121
|
+
carbRecommendation,
|
|
122
|
+
activeInsulin,
|
|
123
|
+
enteredCarbs: null,
|
|
124
|
+
enteredInsulin: null,
|
|
125
|
+
selectedMood: null,
|
|
126
|
+
recommendationModal: wasLimited || !!Math.round(carbRecommendation) || !!this.getBGLevelAttentionMessage(),
|
|
127
|
+
onlyShowLimitationMessage: false,
|
|
128
|
+
showExitModal: props.showExitModal,
|
|
129
|
+
showTimeoutModal: false,
|
|
130
|
+
timeoutModalAction: null,
|
|
131
|
+
exitModalAction: null
|
|
132
|
+
};
|
|
133
|
+
this.timer = setTimeout(this.showTimeoutModal, _types.Milliseconds.Minute * 15);
|
|
134
|
+
} catch (error) {
|
|
135
|
+
this.hasError = true;
|
|
136
|
+
props.onError(error);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Called immediately after a component is mounted. Setting state here will trigger re-rendering.
|
|
142
|
+
*
|
|
143
|
+
* Steps:
|
|
144
|
+
* 1. If there is no error, create a listener to call the handleAppStateChange() method when the app state changes.
|
|
145
|
+
*/
|
|
146
|
+
componentDidMount() {
|
|
147
|
+
if (!this.hasError) {
|
|
148
|
+
this.appStateSubscription = _reactNative.AppState.addEventListener(`change`, this.handleAppStateChange);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Called immediately before a component is destroyed.
|
|
154
|
+
* Perform any necessary cleanup in this method, such as cancelled network requests, or cleaning up any DOM elements created in componentDidMount.
|
|
155
|
+
*
|
|
156
|
+
* Clear the 15 minute timer that was set in the constructor during initialisation so it doesn't keep running and gets triggered after the recommendation screen was closed.
|
|
157
|
+
*
|
|
158
|
+
* Steps:
|
|
159
|
+
* 1. Call clearTimeout on the timer member variable.
|
|
160
|
+
* 2. Remove the listener for app state changes that was set by the componentDidMount() method.
|
|
161
|
+
*/
|
|
162
|
+
componentWillUnmount() {
|
|
163
|
+
if (this.timer !== undefined) {
|
|
164
|
+
clearTimeout(this.timer);
|
|
165
|
+
}
|
|
166
|
+
this.appStateSubscription?.remove();
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Called immediately after updating occurs. This method is not called for the initial render.
|
|
171
|
+
* Use this as an opportunity to operate on the DOM when the component has been updated.
|
|
172
|
+
* Steps:
|
|
173
|
+
* 1. If the showExitModal prop is true and it was false before, call the onExit() method.
|
|
174
|
+
* @param showExitModal The previous showExitModal props of the component.
|
|
175
|
+
*/
|
|
176
|
+
componentDidUpdate(_ref) {
|
|
177
|
+
let {
|
|
178
|
+
showExitModal
|
|
179
|
+
} = _ref;
|
|
180
|
+
if (this.props.showExitModal && showExitModal !== this.props.showExitModal) {
|
|
181
|
+
this.onExit();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Steps:
|
|
187
|
+
* 1. Evaluate a boolean called isOlderThan15Minutes to indicate whether the recommendationDate member variable represents a time more than 15 minutes ago.
|
|
188
|
+
* 2. If nextAppState is ‘active’ and isOlderThan15Minutes is true then call the showTimeoutModal() method.
|
|
189
|
+
* @param nextAppState The new state of the app.
|
|
190
|
+
*/
|
|
191
|
+
handleAppStateChange = nextAppState => {
|
|
192
|
+
const time = this.recommendationDate.getTime();
|
|
193
|
+
const isOlderThan15Minutes = new Date().getTime() - time > _types.Milliseconds.Minute * 15;
|
|
194
|
+
if (nextAppState === `active` && isOlderThan15Minutes) {
|
|
195
|
+
this.showTimeoutModal();
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Steps:
|
|
201
|
+
* 1. Set the showTimeoutModal state variable to be true.
|
|
202
|
+
* */
|
|
203
|
+
showTimeoutModal = () => {
|
|
204
|
+
this.setState({
|
|
205
|
+
showTimeoutModal: true
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Make a new insulin calculation and set the result to be displayed to the user.
|
|
211
|
+
*
|
|
212
|
+
* Steps:
|
|
213
|
+
* 1. Use calculatorParams as an argument for calling calculateRecommendation(). Unpack bolus, wasLimited, and activityReduction from the result.
|
|
214
|
+
* 2. Set the following state variables:
|
|
215
|
+
* - Set insulinRecommendation to the bolus rounded using the roundValue() function.
|
|
216
|
+
* - Set enteredInsulin to be undefined.
|
|
217
|
+
* - Set wasLimited to be the value returned from the insulin calculator.
|
|
218
|
+
* - Set activityReduction to be the value returned from the insulin calculator.
|
|
219
|
+
* - Set showLimitationMessage to be the wasLimited value returned from the insulin calculator.
|
|
220
|
+
* @param calculatorParams The input values for the bolus calculator itself.
|
|
221
|
+
*/
|
|
222
|
+
recalculateInsulin = calculatorParams => {
|
|
223
|
+
const {
|
|
224
|
+
bolus,
|
|
225
|
+
wasLimited,
|
|
226
|
+
activityReduction
|
|
227
|
+
} = Calculator.calculateRecommendation(calculatorParams);
|
|
228
|
+
this.setState({
|
|
229
|
+
insulinRecommendation: _Utils.Utils.roundValue(bolus, this.props.injectionMethod),
|
|
230
|
+
enteredInsulin: null,
|
|
231
|
+
wasLimited,
|
|
232
|
+
activityReduction,
|
|
233
|
+
onlyShowLimitationMessage: wasLimited
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Handle presses on the exit button in the header bar.
|
|
239
|
+
*
|
|
240
|
+
* Steps:
|
|
241
|
+
* 1. If the insulin recommendation is being displayed (the isRecommendationDisplayed state variable is true):
|
|
242
|
+
* - Set the showExitModal state variable to true.
|
|
243
|
+
* 2. Else:
|
|
244
|
+
* - Call the exitCallback prop callback function.
|
|
245
|
+
*/
|
|
246
|
+
onExit = () => {
|
|
247
|
+
if (this.state?.isRecommendationDisplayed) {
|
|
248
|
+
this.setState({
|
|
249
|
+
showExitModal: true
|
|
250
|
+
});
|
|
251
|
+
} else {
|
|
252
|
+
this.props.exitCallback();
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Hide the modal that shows attention messages.
|
|
258
|
+
*
|
|
259
|
+
* Steps:
|
|
260
|
+
* 1. Set the recommendationModal state variable to false.
|
|
261
|
+
*/
|
|
262
|
+
hideAttentionModal = () => {
|
|
263
|
+
this.setState({
|
|
264
|
+
recommendationModal: false,
|
|
265
|
+
onlyShowLimitationMessage: false
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Handle presses on the transfer button in the exit modal.
|
|
271
|
+
*/
|
|
272
|
+
onPressTransferExitModal = () => {
|
|
273
|
+
this.setState({
|
|
274
|
+
showExitModal: false,
|
|
275
|
+
exitModalAction: _enum.ExitModalActions.Transfer
|
|
276
|
+
});
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Handle presses on the close calculation button in the exit modal.
|
|
281
|
+
*/
|
|
282
|
+
onPressCloseExitModal = () => {
|
|
283
|
+
this.setState({
|
|
284
|
+
showExitModal: false,
|
|
285
|
+
exitModalAction: _enum.ExitModalActions.CloseCalculation
|
|
286
|
+
});
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Handle presses on the hide button in the exit modal.
|
|
291
|
+
*/
|
|
292
|
+
onPressHideExitModal = () => {
|
|
293
|
+
this.setState({
|
|
294
|
+
showExitModal: false,
|
|
295
|
+
exitModalAction: _enum.ExitModalActions.Hide
|
|
296
|
+
});
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Call the chosen modal action on the didHide modal callback .
|
|
301
|
+
*/
|
|
302
|
+
onExitModalDidHide = () => {
|
|
303
|
+
switch (this.state.exitModalAction) {
|
|
304
|
+
case _enum.ExitModalActions.Transfer:
|
|
305
|
+
this.handleTransfer();
|
|
306
|
+
break;
|
|
307
|
+
case _enum.ExitModalActions.CloseCalculation:
|
|
308
|
+
this.props.closeCalculationCallback();
|
|
309
|
+
break;
|
|
310
|
+
case _enum.ExitModalActions.Hide:
|
|
311
|
+
this.props.hideExitModal();
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Handle presses on the close calculation button in the timeout modal.
|
|
318
|
+
*/
|
|
319
|
+
onPressCloseCalculationTimeoutModal = () => {
|
|
320
|
+
this.setState({
|
|
321
|
+
showTimeoutModal: false,
|
|
322
|
+
timeoutModalAction: _enum.TimeoutModalActions.CloseCalculation
|
|
323
|
+
});
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Handle presses on the restart calculation button in the timeout modal.
|
|
328
|
+
*/
|
|
329
|
+
onPressRestartCalculationTimeoutModal = () => {
|
|
330
|
+
this.setState({
|
|
331
|
+
showTimeoutModal: false,
|
|
332
|
+
timeoutModalAction: _enum.TimeoutModalActions.RestartCalculation
|
|
333
|
+
});
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Handle presses on the transfer button in the timeout modal.
|
|
338
|
+
*/
|
|
339
|
+
onPressTransferTimeoutModal = () => {
|
|
340
|
+
this.setState({
|
|
341
|
+
showTimeoutModal: false,
|
|
342
|
+
timeoutModalAction: _enum.TimeoutModalActions.Transfer
|
|
343
|
+
});
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Call the chosen modal action on the didHide modal callback .
|
|
348
|
+
*/
|
|
349
|
+
onTimeoutModalDidHide = () => {
|
|
350
|
+
switch (this.state.timeoutModalAction) {
|
|
351
|
+
case _enum.TimeoutModalActions.RestartCalculation:
|
|
352
|
+
this.props.restartCalculation();
|
|
353
|
+
break;
|
|
354
|
+
case _enum.TimeoutModalActions.Transfer:
|
|
355
|
+
this.props.onSaveToLogbook();
|
|
356
|
+
this.handleTransfer();
|
|
357
|
+
break;
|
|
358
|
+
case _enum.TimeoutModalActions.CloseCalculation:
|
|
359
|
+
this.props.onReturnToDashboard();
|
|
360
|
+
this.props.closeCalculationCallback();
|
|
361
|
+
break;
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Used as a callback function for the Remeasure component to update the state when the remeasure time slider’s value changes.
|
|
367
|
+
*
|
|
368
|
+
* Steps:
|
|
369
|
+
* 1. Set the remeasureTime state variable to the value of the remeasureTime argument.
|
|
370
|
+
* @param remeasureTime The number of hours for which to wait before reminding the user to measure their BGL again. 0 indicates that the user should not be reminded.
|
|
371
|
+
*/
|
|
372
|
+
updateRemeasureTime = remeasureTime => {
|
|
373
|
+
this.setState({
|
|
374
|
+
remeasureTime
|
|
375
|
+
});
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Handle what happens if the user taps “No” to the question about injecting insulin within the last 4 hours.
|
|
380
|
+
* The card that prompts the user to answer if they have injected insulin within the last 4 hours shall be hidden and
|
|
381
|
+
* the screen shall automatically be scrolled to the bottom so the user can see the now visible “Transfer to logbook” button.
|
|
382
|
+
*
|
|
383
|
+
* Steps:
|
|
384
|
+
* 1. Set the isRecommendationDisplayed state variable to be true.
|
|
385
|
+
* 2. Call the onRecommendationDisplayed prop callback function.
|
|
386
|
+
* 3. As a callback to the setState() method, define a new anonymous function that calls setTimeout() with a duration of 0 milliseconds.
|
|
387
|
+
* When the time expires, call the scrollToEnd() method of the scrollView member, with the animated argument set to true.
|
|
388
|
+
* This ensures that the scroll event happens after all other events that get queued to happen at the same time,
|
|
389
|
+
* so all relevant elements are visible on the screen and the scroll happens reliably.
|
|
390
|
+
*/
|
|
391
|
+
handleNoRecentInsulin = () => {
|
|
392
|
+
this.props.onRecentInsulinNo();
|
|
393
|
+
this.setState({
|
|
394
|
+
isRecommendationDisplayed: true
|
|
395
|
+
}, () => {
|
|
396
|
+
this.props.onRecommendationDisplayed();
|
|
397
|
+
setTimeout(() => {
|
|
398
|
+
this.scrollView?.scrollToEnd(true);
|
|
399
|
+
}, 0);
|
|
400
|
+
});
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Handle what happens when the user changes the content of the additional carbohydrates input field.
|
|
405
|
+
*
|
|
406
|
+
* Steps:
|
|
407
|
+
* 1. Set the enteredCarbs state variable to the value of the enteredCarbs argument.
|
|
408
|
+
* 2. As a callback to the setState() method, define a new anonymous function that calls the recalculateInsulin() function using
|
|
409
|
+
* a copy of the calculatorParams prop where the carbohydrates property has been overwritten to be
|
|
410
|
+
* the sum of the carbohydrates property of the calculatorParams prop and the enteredCarbs argument.
|
|
411
|
+
* @param enteredCarbs The amount of carbohydrates in grams that has been entered in the additional carbohydrates input field.
|
|
412
|
+
*/
|
|
413
|
+
updateCarbRecommendation = enteredCarbs => {
|
|
414
|
+
const providedCarbs = this.props.calculatorParams.carbohydrates;
|
|
415
|
+
this.setState({
|
|
416
|
+
enteredCarbs
|
|
417
|
+
}, () => {
|
|
418
|
+
this.recalculateInsulin({
|
|
419
|
+
...this.props.calculatorParams,
|
|
420
|
+
carbohydrates: providedCarbs + enteredCarbs
|
|
421
|
+
});
|
|
422
|
+
});
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Handle what happens when the cross button by the additional carbohydrates button is tapped.
|
|
427
|
+
*
|
|
428
|
+
* Steps:
|
|
429
|
+
* 1. Set both the enteredCarbs and the carbRecommendation state variables to null.
|
|
430
|
+
* 2. As a callback to the setState() method, define a new anonymous function that calls the recalculateInsulin() function using a copy of the calculatorParams prop.
|
|
431
|
+
*/
|
|
432
|
+
removeCarbRecommendation = () => {
|
|
433
|
+
this.setState({
|
|
434
|
+
enteredCarbs: null,
|
|
435
|
+
carbRecommendation: null
|
|
436
|
+
}, () => this.recalculateInsulin({
|
|
437
|
+
...this.props.calculatorParams
|
|
438
|
+
}));
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Handle what happens when the user is recommended to eat additional carbohydrates but taps the decline button.
|
|
443
|
+
*
|
|
444
|
+
* Steps:
|
|
445
|
+
* 1. Call the hideAttentionModal() method.
|
|
446
|
+
* 2. Call the removeCarbRecommendation() method.
|
|
447
|
+
* 3. Call the carbRecommendationAnswer() prop callback function with false as argument.
|
|
448
|
+
*/
|
|
449
|
+
declineCarbRecommendation = () => {
|
|
450
|
+
this.hideAttentionModal();
|
|
451
|
+
this.removeCarbRecommendation();
|
|
452
|
+
this.props.carbRecommendationAnswer(false);
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Handle what happens when the user is recommended to eat additional carbohydrates and they tap the accept button.
|
|
457
|
+
*
|
|
458
|
+
* Steps:
|
|
459
|
+
* 1. Call the hideAttentionModal() method.
|
|
460
|
+
* 2. Call the carbRecommendationAnswer() prop callback function with true as argument.
|
|
461
|
+
*/
|
|
462
|
+
acceptCarbRecommendation = () => {
|
|
463
|
+
this.hideAttentionModal();
|
|
464
|
+
this.props.carbRecommendationAnswer(true);
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Used as a callback function for the Emotion component to update the state when a mood icon is tapped.
|
|
469
|
+
*
|
|
470
|
+
* Steps:
|
|
471
|
+
* 1. Set the selectedMood state variable to the value of the selectedMood argument.
|
|
472
|
+
* @param selectedMood he mood that should be selected going forward or null if no mood should be selected.
|
|
473
|
+
*/
|
|
474
|
+
handleMoodSelected = selectedMood => {
|
|
475
|
+
this.setState({
|
|
476
|
+
selectedMood
|
|
477
|
+
});
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Handle what happens when the user changes the content of the insulin input field.
|
|
482
|
+
*
|
|
483
|
+
* Steps:
|
|
484
|
+
* 1. Set the enteredInsulin state variable to the value of the enteredInsulin argument.
|
|
485
|
+
* @param enteredInsulin The amount of insulin (in units) that has been entered in the insulin input field.
|
|
486
|
+
*/
|
|
487
|
+
updateInsulinRecommendation = enteredInsulin => {
|
|
488
|
+
this.setState({
|
|
489
|
+
enteredInsulin
|
|
490
|
+
});
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Handle what happens when the “Transfer to Logbook” button is pressed.
|
|
495
|
+
* Namely, the entered data should be saved in a logbook entry and the recommendation screen should be closed.
|
|
496
|
+
*
|
|
497
|
+
* Steps:
|
|
498
|
+
* 1. Unpack the enteredCarbs, enteredInsulin, insulinRecommendation, remeasureTime, and showExitModal state variables
|
|
499
|
+
* 2. Create an IResult object called carbs consisting of suggestedCarbs and enteredCarbs.
|
|
500
|
+
* 3. Create an IResult object called Insulin consisting of insulinRecommendation and enteredInsulin.
|
|
501
|
+
* 4. Call the transferToLogbook prop callback function with the following arguments:
|
|
502
|
+
* - Set the carbs argument to the carbs IResult object.
|
|
503
|
+
* - Set the insulin argument to the insulin IResult object.
|
|
504
|
+
* - Set the reminder argument to the remeasureTime state variable.
|
|
505
|
+
* - Set the recommendationDate argument to the recommendationDate member variable.
|
|
506
|
+
*/
|
|
507
|
+
handleTransfer = () => {
|
|
508
|
+
const {
|
|
509
|
+
enteredCarbs,
|
|
510
|
+
enteredInsulin,
|
|
511
|
+
insulinRecommendation,
|
|
512
|
+
remeasureTime,
|
|
513
|
+
selectedMood
|
|
514
|
+
} = this.state;
|
|
515
|
+
const carbs = {
|
|
516
|
+
suggested: this.suggestedCarbs,
|
|
517
|
+
entered: enteredCarbs
|
|
518
|
+
};
|
|
519
|
+
const insulin = {
|
|
520
|
+
suggested: insulinRecommendation,
|
|
521
|
+
entered: enteredInsulin
|
|
522
|
+
};
|
|
523
|
+
this.props.transferToLogbook(carbs, insulin, remeasureTime, this.recommendationDate, selectedMood);
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Get the attention message that should be displayed for the user to draw their attention to noteworthy circumstances regarding their current blood glucose level.
|
|
528
|
+
*
|
|
529
|
+
* Steps:
|
|
530
|
+
* 1. Unpack calculatorParams and latestLogbookFrom6Hours from the props.
|
|
531
|
+
* 2. Unpack currentBGL and activity from calculatorparams.
|
|
532
|
+
* 3. Get bgLevel, the categorisation of the blood glucose level, by calling the getBGLevel() function with the currentBGL and latestLogbookFrom6Hours as arguments.
|
|
533
|
+
* 4. Return the attention message that is returned when calling getAttentionMessage() using bgLevel and activity as arguments.
|
|
534
|
+
* @returns A string describing what the user needs to be aware of regarding their current blood glucose level.
|
|
535
|
+
* If there is nothing noteworthy, null will be returned instead.
|
|
536
|
+
*/
|
|
537
|
+
getBGLevelAttentionMessage = () => {
|
|
538
|
+
const {
|
|
539
|
+
calculatorParams,
|
|
540
|
+
latestLogbookFrom6Hours
|
|
541
|
+
} = this.props;
|
|
542
|
+
const {
|
|
543
|
+
currentBGL,
|
|
544
|
+
activity
|
|
545
|
+
} = calculatorParams;
|
|
546
|
+
const bgLevel = (0, _RecommendationUtils.getBGLevel)(currentBGL, latestLogbookFrom6Hours);
|
|
547
|
+
return (0, _RecommendationUtils.getAttentionMessage)(bgLevel, activity);
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Get the initial value for the remeasurement reminder time slider depending on the user’s entered information.
|
|
552
|
+
*
|
|
553
|
+
* Steps:
|
|
554
|
+
* 1. Unpack calculatorParams, userReminder, and latestLogbookFrom6Hours from the props.
|
|
555
|
+
* 2. Unpack currentBGL, activity, and carbohydrates from calculatorParams.
|
|
556
|
+
* 3. Get bgLevel, the categorisation of the blood glucose level, by calling the getBGLevel() function with the currentBGL and latestLogbookFrom6Hours as arguments.
|
|
557
|
+
* 4. Return the attention message that is returned when calling getReminder() using bgLevel, carbohydrates, userReminder, and activity as arguments.
|
|
558
|
+
* @returns The time interval in hours that should be used as the initial value for the remeasurement reminder time slider.
|
|
559
|
+
*/
|
|
560
|
+
getBGLevelRemeasurementReminder = () => {
|
|
561
|
+
const {
|
|
562
|
+
calculatorParams,
|
|
563
|
+
userReminder,
|
|
564
|
+
latestLogbookFrom6Hours
|
|
565
|
+
} = this.props;
|
|
566
|
+
const {
|
|
567
|
+
currentBGL,
|
|
568
|
+
activity,
|
|
569
|
+
carbohydrates
|
|
570
|
+
} = calculatorParams;
|
|
571
|
+
const bgLevel = (0, _RecommendationUtils.getBGLevel)(currentBGL, latestLogbookFrom6Hours);
|
|
572
|
+
return (0, _RecommendationUtils.getReminder)(bgLevel, carbohydrates, userReminder, activity);
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Get the attention message that should be displayed to the user to let them know that the insulin recommendation that
|
|
577
|
+
* is being displayed to them was limited by the maximum insulin threshold.
|
|
578
|
+
*
|
|
579
|
+
* Steps:
|
|
580
|
+
* 1. Unpack the wasLimited and activityReduction state variables.
|
|
581
|
+
* 2. Return the result from calling getLimitationMessage() with wasLimited and activityReduction as arguments.
|
|
582
|
+
* @returns A message to inform the user how the insulin recommendation was limited. If there is no limitation attention message, null will be returned instead.
|
|
583
|
+
*/
|
|
584
|
+
getLimitationAttentionMessage = () => {
|
|
585
|
+
const {
|
|
586
|
+
wasLimited,
|
|
587
|
+
activityReduction
|
|
588
|
+
} = this.state;
|
|
589
|
+
return (0, _RecommendationUtils.getLimitationMessage)(wasLimited, activityReduction);
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
/** Render a JSX element for displaying the insulin recommendation screen. */
|
|
593
|
+
render() {
|
|
594
|
+
if (this.hasError) {
|
|
595
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
596
|
+
style: styles.container
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
const {
|
|
600
|
+
activeInsulin,
|
|
601
|
+
recommendationModal,
|
|
602
|
+
carbRecommendation: carbRecommendationProp,
|
|
603
|
+
enteredCarbs,
|
|
604
|
+
enteredInsulin,
|
|
605
|
+
insulinRecommendation,
|
|
606
|
+
activityReduction,
|
|
607
|
+
isRecommendationDisplayed
|
|
608
|
+
} = this.state;
|
|
609
|
+
const {
|
|
610
|
+
BloodGlucose: BGValueTestID,
|
|
611
|
+
BloodKetone: BKValueTestID,
|
|
612
|
+
ActiveInsulin: ActiveInsulinValueTestID
|
|
613
|
+
} = InfoBarTestIds.Value;
|
|
614
|
+
const {
|
|
615
|
+
ActiveInsulin: ActiveInsulinUnitTestID,
|
|
616
|
+
BloodGlucose: BGUnitTestID,
|
|
617
|
+
BloodKetone: BKUnitTestID
|
|
618
|
+
} = InfoBarTestIds.Unit;
|
|
619
|
+
const carbRecommendation = carbRecommendationProp !== null ? Math.round(carbRecommendationProp) : null;
|
|
620
|
+
const recommendedCarbs = enteredCarbs ?? carbRecommendation;
|
|
621
|
+
const foodBorderColor = recommendedCarbs !== null && recommendedCarbs > 0 ? _Constants.colors.teal : _Constants.colors.dustyDarkBlue;
|
|
622
|
+
const {
|
|
623
|
+
calculatorParams,
|
|
624
|
+
bloodGlucoseUnit,
|
|
625
|
+
currentBKL,
|
|
626
|
+
bloodKetoneUnit
|
|
627
|
+
} = this.props;
|
|
628
|
+
const {
|
|
629
|
+
currentBGL,
|
|
630
|
+
carbohydrates: providedCarbs
|
|
631
|
+
} = calculatorParams;
|
|
632
|
+
const displayedBGL = currentBGL ? _Utils.Utils.displayedBGLValue(currentBGL, bloodGlucoseUnit) : null;
|
|
633
|
+
const displayedBKL = currentBKL !== null && bloodKetoneUnit ? _Utils.Utils.displayedBKLValue(currentBKL, bloodKetoneUnit) : null;
|
|
634
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNativeKeyboardAwareScrollView.KeyboardAwareScrollView, {
|
|
635
|
+
testID: RecommendationScreenTestIds.RecommendationScrollView,
|
|
636
|
+
enableResetScrollToCoords: false,
|
|
637
|
+
style: styles.container,
|
|
638
|
+
ref: view => {
|
|
639
|
+
if (view !== null) {
|
|
640
|
+
this.scrollView = view;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}, /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
644
|
+
style: styles.header
|
|
645
|
+
}, (0, _translate.t)(`Insulin recommendation`)), /*#__PURE__*/_react.default.createElement(_InfoBars.default, {
|
|
646
|
+
label: (0, _translate.t)(`Active Insulin`),
|
|
647
|
+
value: activeInsulin ? `${activeInsulin.toFixed(1)}` : null,
|
|
648
|
+
unit: (0, _translate.t)(`units`),
|
|
649
|
+
showNullAsDash: false,
|
|
650
|
+
testID: {
|
|
651
|
+
unitID: ActiveInsulinUnitTestID,
|
|
652
|
+
valueID: ActiveInsulinValueTestID
|
|
653
|
+
}
|
|
654
|
+
}), /*#__PURE__*/_react.default.createElement(_InfoBars.default, {
|
|
655
|
+
label: (0, _translate.t)(`Blood Glucose Level`),
|
|
656
|
+
value: displayedBGL,
|
|
657
|
+
unit: this.props.bloodGlucoseUnit,
|
|
658
|
+
showNullAsDash: true,
|
|
659
|
+
testID: {
|
|
660
|
+
unitID: BGUnitTestID,
|
|
661
|
+
valueID: BGValueTestID
|
|
662
|
+
}
|
|
663
|
+
}), /*#__PURE__*/_react.default.createElement(_InfoBars.default, {
|
|
664
|
+
label: (0, _translate.t)(`Blood Ketone Level`),
|
|
665
|
+
value: displayedBKL,
|
|
666
|
+
unit: this.props.bloodKetoneUnit,
|
|
667
|
+
showNullAsDash: true,
|
|
668
|
+
testID: {
|
|
669
|
+
unitID: BKUnitTestID,
|
|
670
|
+
valueID: BKValueTestID
|
|
671
|
+
}
|
|
672
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
673
|
+
style: [styles.carbsBorder, {
|
|
674
|
+
borderColor: foodBorderColor
|
|
675
|
+
}]
|
|
676
|
+
}, /*#__PURE__*/_react.default.createElement(_RecommendedCarbs.default, {
|
|
677
|
+
enteredCarbs: `${providedCarbs}`,
|
|
678
|
+
changedRecommendedCarbs: this.updateCarbRecommendation,
|
|
679
|
+
recommendedCarbs: `${recommendedCarbs}`,
|
|
680
|
+
removeRecommendedCarbs: this.removeCarbRecommendation
|
|
681
|
+
})), this.props.calculatorParams.activity && this.props.activityDisplayProps && /*#__PURE__*/_react.default.createElement(_Activity.default, {
|
|
682
|
+
activity: this.props.calculatorParams.activity,
|
|
683
|
+
activityType: this.props.activityDisplayProps.activityType,
|
|
684
|
+
activityTitle: this.props.activityDisplayProps.activityTitle,
|
|
685
|
+
activityReduction: activityReduction
|
|
686
|
+
}), /*#__PURE__*/_react.default.createElement(_Remeasure.default, {
|
|
687
|
+
onSliderChange: this.updateRemeasureTime,
|
|
688
|
+
remeasureTime: this.state.remeasureTime
|
|
689
|
+
}), !isRecommendationDisplayed ? /*#__PURE__*/_react.default.createElement(_RecentInsulin.default, {
|
|
690
|
+
onRecentInsulinYes: this.props.onRecentInsulinYes,
|
|
691
|
+
onRecentInsulinNo: this.handleNoRecentInsulin
|
|
692
|
+
}) : /*#__PURE__*/_react.default.createElement(_RecommendedInsulin.default, {
|
|
693
|
+
injectionMethod: this.props.injectionMethod,
|
|
694
|
+
insulinRecommendation: insulinRecommendation,
|
|
695
|
+
enteredInsulin: enteredInsulin,
|
|
696
|
+
activityReduction: activityReduction,
|
|
697
|
+
updateRecommendedInsulin: this.updateInsulinRecommendation
|
|
698
|
+
}), /*#__PURE__*/_react.default.createElement(_TransferToLogbook.default, {
|
|
699
|
+
visible: isRecommendationDisplayed,
|
|
700
|
+
transfer: this.handleTransfer
|
|
701
|
+
}), /*#__PURE__*/_react.default.createElement(_Emotion.default, {
|
|
702
|
+
moodSelected: this.handleMoodSelected,
|
|
703
|
+
currentMood: this.state.selectedMood
|
|
704
|
+
}), /*#__PURE__*/_react.default.createElement(_RecommendationModal.default, {
|
|
705
|
+
isVisible: recommendationModal || this.state.onlyShowLimitationMessage,
|
|
706
|
+
onlyShowLimitationMessage: this.state.onlyShowLimitationMessage,
|
|
707
|
+
suggestedCarbohydrates: carbRecommendationProp,
|
|
708
|
+
attentionMessage: this.getBGLevelAttentionMessage(),
|
|
709
|
+
limitationMessage: this.getLimitationAttentionMessage(),
|
|
710
|
+
onClickOkButton: this.hideAttentionModal,
|
|
711
|
+
onAcceptCarbohydrates: this.acceptCarbRecommendation,
|
|
712
|
+
onDeclineCarbohydrates: this.declineCarbRecommendation
|
|
713
|
+
})), /*#__PURE__*/_react.default.createElement(_ExitModal.default, {
|
|
714
|
+
isVisible: this.state.showExitModal,
|
|
715
|
+
title: (0, _translate.t)(`Save data before closing?`),
|
|
716
|
+
message: (0, _translate.t)(`Your saved data will be used for future calculations.`),
|
|
717
|
+
textFirstOption: (0, _translate.t)(`Save to logbook`),
|
|
718
|
+
textSecondOption: (0, _translate.t)(`Close calculation`),
|
|
719
|
+
firstOption: this.onPressTransferExitModal,
|
|
720
|
+
secondOption: this.onPressCloseExitModal,
|
|
721
|
+
onClose: this.onPressHideExitModal,
|
|
722
|
+
onModalHide: this.onExitModalDidHide
|
|
723
|
+
}), isRecommendationDisplayed ? /*#__PURE__*/_react.default.createElement(_TimeoutModal.default, {
|
|
724
|
+
isVisible: this.state.showTimeoutModal,
|
|
725
|
+
title: _AttentionMessages.Messages.TimeoutPrompTitle(),
|
|
726
|
+
message: _AttentionMessages.Messages.TimeoutRecommendationVisible(this.recommendationDate),
|
|
727
|
+
textFirstOption: (0, _translate.t)(`Yes, save to logbook`),
|
|
728
|
+
textSecondOption: (0, _translate.t)(`No, return to dashboard`),
|
|
729
|
+
firstOption: this.onPressTransferTimeoutModal,
|
|
730
|
+
secondOption: this.onPressCloseCalculationTimeoutModal,
|
|
731
|
+
onModalHide: this.onTimeoutModalDidHide
|
|
732
|
+
}) : /*#__PURE__*/_react.default.createElement(_TimeoutModal.default, {
|
|
733
|
+
isVisible: this.state.showTimeoutModal,
|
|
734
|
+
title: _AttentionMessages.Messages.TimeoutPrompTitle(),
|
|
735
|
+
message: _AttentionMessages.Messages.TimeoutRecommendationNotVisible(),
|
|
736
|
+
textFirstOption: (0, _translate.t)(`Start new calculation`),
|
|
737
|
+
textSecondOption: (0, _translate.t)(`Return to dashboard`),
|
|
738
|
+
firstOption: this.onPressRestartCalculationTimeoutModal,
|
|
739
|
+
secondOption: this.onPressCloseCalculationTimeoutModal,
|
|
740
|
+
onModalHide: this.onTimeoutModalDidHide
|
|
741
|
+
}));
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
exports.RecommendationScreen = RecommendationScreen;
|
|
745
|
+
const styles = _reactNative.StyleSheet.create({
|
|
746
|
+
container: {
|
|
747
|
+
flex: 1,
|
|
748
|
+
paddingHorizontal: 18,
|
|
749
|
+
backgroundColor: _Constants.colors.darkBlue
|
|
750
|
+
},
|
|
751
|
+
limitationModalContainer: {
|
|
752
|
+
..._reactNative.StyleSheet.absoluteFillObject,
|
|
753
|
+
justifyContent: `center`,
|
|
754
|
+
backgroundColor: _Constants.colors.transparentBlack
|
|
755
|
+
},
|
|
756
|
+
carbsBorder: {
|
|
757
|
+
borderWidth: 1,
|
|
758
|
+
borderRadius: 5,
|
|
759
|
+
padding: 16
|
|
760
|
+
},
|
|
761
|
+
header: {
|
|
762
|
+
..._fonts.FONTS.Poppins.medium_Base,
|
|
763
|
+
color: _Constants.colors.dustyBlue,
|
|
764
|
+
marginBottom: 22,
|
|
765
|
+
textAlign: `center`
|
|
766
|
+
}
|
|
767
|
+
});
|
|
768
|
+
//# sourceMappingURL=RecommendationScreen.js.map
|