@hedia/recommendation-screen 2.1.75-alpha.0 → 2.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/{lib/typescript → dist/src}/RecommendationScreen.d.ts +68 -82
- package/dist/src/RecommendationScreen.js +522 -0
- package/dist/src/assets/assets/activity/Cyclist.png +0 -0
- package/dist/src/assets/assets/activity/Other.png +0 -0
- package/dist/src/assets/assets/activity/Runner.png +0 -0
- package/dist/src/assets/assets/activity/Swimmer.png +0 -0
- package/dist/src/assets/assets/activity/Walk.png +0 -0
- package/dist/src/assets/assets/fonts/Poppins-Bold.ttf +0 -0
- package/dist/src/assets/assets/fonts/Poppins-SemiBold.ttf +0 -0
- package/dist/src/assets/assets/icons/Edit.tsx +22 -0
- package/dist/src/assets/assets/icons/X.tsx +14 -0
- package/dist/src/assets/assets/mood/happy.png +0 -0
- package/dist/src/assets/assets/mood/happy_active.png +0 -0
- package/dist/src/assets/assets/mood/neutral.png +0 -0
- package/dist/src/assets/assets/mood/neutral_active.png +0 -0
- package/dist/src/assets/assets/mood/sad.png +0 -0
- package/dist/src/assets/assets/mood/sad_active.png +0 -0
- package/dist/src/assets/assets/mood/semi_happy.png +0 -0
- package/dist/src/assets/assets/mood/semi_happy_active.png +0 -0
- package/dist/src/assets/assets/mood/semi_sad.png +0 -0
- package/dist/src/assets/assets/mood/semi_sad_active.png +0 -0
- package/dist/src/assets/icons/Edit.d.ts +4 -0
- package/dist/src/assets/icons/Edit.js +7 -0
- package/dist/src/assets/icons/X.d.ts +4 -0
- package/dist/src/assets/icons/X.js +6 -0
- package/dist/src/components/ForecastInfoBar.d.ts +109 -0
- package/dist/src/components/ForecastInfoBar.js +138 -0
- package/dist/src/components/Header.d.ts +8 -0
- package/dist/src/components/Header.js +54 -0
- package/dist/src/components/Icon.d.ts +20 -0
- package/dist/src/components/Icon.js +43 -0
- package/{lib/typescript → dist/src}/components/InfoBars.d.ts +28 -14
- package/dist/src/components/InfoBars.js +128 -0
- package/{lib/typescript → dist/src}/components/InvisibleNumberInput.d.ts +3 -9
- package/dist/src/components/InvisibleNumberInput.js +121 -0
- package/dist/src/components/LimitationMessage.d.ts +14 -0
- package/dist/src/components/LimitationMessage.js +30 -0
- package/{lib/typescript → dist/src}/components/LineSeparator.d.ts +1 -6
- package/dist/src/components/LineSeparator.js +18 -0
- package/{lib/typescript → dist/src}/components/RecentInsulin.d.ts +1 -3
- package/dist/src/components/RecentInsulin.js +73 -0
- package/{lib/typescript → dist/src}/components/RecommendationModal.d.ts +63 -63
- package/dist/src/components/RecommendationModal.js +226 -0
- package/{lib/typescript → dist/src}/components/RecommendedCarbs.d.ts +0 -3
- package/dist/src/components/RecommendedCarbs.js +251 -0
- package/{lib/typescript → dist/src}/components/RecommendedInsulin.d.ts +1 -2
- package/dist/src/components/RecommendedInsulin.js +180 -0
- package/{lib/typescript → dist/src}/components/Remeasure.d.ts +15 -6
- package/dist/src/components/Remeasure.js +130 -0
- package/{lib/typescript/components/TransferToLogbook.d.ts → dist/src/components/SaveButton.d.ts} +2 -3
- package/dist/src/components/SaveButton.js +71 -0
- package/dist/src/components/TwoOptionModal.d.ts +136 -0
- package/dist/src/components/TwoOptionModal.js +141 -0
- package/{lib/typescript → dist/src}/components/activity/Activity.d.ts +2 -3
- package/dist/src/components/activity/Activity.js +84 -0
- package/{lib/typescript → dist/src}/components/activity/ActivityIcon.d.ts +7 -8
- package/dist/src/components/activity/ActivityIcon.js +58 -0
- package/{lib/typescript → dist/src}/components/activity/ActivityIntensity.d.ts +1 -2
- package/dist/src/components/activity/ActivityIntensity.js +58 -0
- package/{lib/typescript → dist/src}/components/mood/Emotion.d.ts +1 -2
- package/dist/src/components/mood/Emotion.js +64 -0
- package/{lib/typescript → dist/src}/components/mood/MoodIcon.d.ts +5 -5
- package/dist/src/components/mood/MoodIcon.js +63 -0
- package/dist/src/components/text/TextBold.d.ts +8 -0
- package/dist/src/components/text/TextBold.js +12 -0
- package/dist/src/components/text/TextRegular.d.ts +8 -0
- package/dist/src/components/text/TextRegular.js +12 -0
- package/dist/src/locale/da/messages.js +1 -0
- package/dist/src/locale/da/messages.po +349 -0
- package/dist/src/locale/de/messages.js +1 -0
- package/dist/src/locale/de/messages.po +349 -0
- package/dist/src/locale/en/messages.js +1 -0
- package/dist/src/locale/en/messages.po +349 -0
- package/dist/src/locale/es/messages.js +1 -0
- package/dist/src/locale/es/messages.po +349 -0
- package/dist/src/locale/fr/messages.js +1 -0
- package/dist/src/locale/fr/messages.po +349 -0
- package/dist/src/locale/i18nUtils.d.ts +18 -0
- package/dist/src/locale/i18nUtils.js +39 -0
- package/dist/src/locale/it/messages.js +1 -0
- package/dist/src/locale/it/messages.po +349 -0
- package/{lib/typescript → dist/src}/types/enum.d.ts +15 -22
- package/dist/src/types/enum.js +145 -0
- package/{lib/typescript → dist/src}/types/types.d.ts +0 -1
- package/dist/src/types/types.js +1 -0
- package/{lib/typescript → dist/src}/utils/AttentionMessages.d.ts +0 -1
- package/dist/src/utils/AttentionMessages.js +118 -0
- package/{lib/typescript → dist/src}/utils/Constants.d.ts +3 -18
- package/{lib/module → dist/src}/utils/Constants.js +21 -79
- package/{lib/typescript → dist/src}/utils/RecommendationError.d.ts +0 -1
- package/dist/src/utils/RecommendationError.js +63 -0
- package/{lib/typescript → dist/src}/utils/RecommendationUtils.d.ts +0 -1
- package/{lib/module → dist/src}/utils/RecommendationUtils.js +88 -90
- package/{lib/typescript → dist/src}/utils/Translations.d.ts +0 -1
- package/{lib/module → dist/src}/utils/Translations.js +5 -7
- package/{lib/typescript → dist/src}/utils/Utils.d.ts +1 -2
- package/dist/src/utils/Utils.js +141 -0
- package/{lib/typescript → dist/src}/utils/Validations.d.ts +1 -2
- package/{lib/module → dist/src}/utils/Validations.js +128 -156
- package/package.json +96 -109
- package/lib/commonjs/RecommendationScreen.js +0 -778
- package/lib/commonjs/RecommendationScreen.js.map +0 -1
- package/lib/commonjs/assets/IconsSVG/Close.js +0 -20
- package/lib/commonjs/assets/IconsSVG/Close.js.map +0 -1
- package/lib/commonjs/assets/IconsSVG/CloseOutlined.js +0 -28
- package/lib/commonjs/assets/IconsSVG/CloseOutlined.js.map +0 -1
- package/lib/commonjs/assets/IconsSVG/Edit.js +0 -23
- package/lib/commonjs/assets/IconsSVG/Edit.js.map +0 -1
- package/lib/commonjs/assets/IconsSVG/activity/Cycling.js +0 -43
- package/lib/commonjs/assets/IconsSVG/activity/Cycling.js.map +0 -1
- package/lib/commonjs/assets/IconsSVG/activity/Running.js +0 -33
- package/lib/commonjs/assets/IconsSVG/activity/Running.js.map +0 -1
- package/lib/commonjs/assets/IconsSVG/activity/Stretching.js +0 -33
- package/lib/commonjs/assets/IconsSVG/activity/Stretching.js.map +0 -1
- package/lib/commonjs/assets/IconsSVG/activity/Swimming.js +0 -48
- package/lib/commonjs/assets/IconsSVG/activity/Swimming.js.map +0 -1
- package/lib/commonjs/assets/IconsSVG/activity/Walking.js +0 -38
- package/lib/commonjs/assets/IconsSVG/activity/Walking.js.map +0 -1
- package/lib/commonjs/assets/IconsSVG/mood/Happy.js +0 -34
- package/lib/commonjs/assets/IconsSVG/mood/Happy.js.map +0 -1
- package/lib/commonjs/assets/IconsSVG/mood/Neutral.js +0 -34
- package/lib/commonjs/assets/IconsSVG/mood/Neutral.js.map +0 -1
- package/lib/commonjs/assets/IconsSVG/mood/Sad.js +0 -34
- package/lib/commonjs/assets/IconsSVG/mood/Sad.js.map +0 -1
- package/lib/commonjs/assets/IconsSVG/mood/SemiHappy.js +0 -34
- package/lib/commonjs/assets/IconsSVG/mood/SemiHappy.js.map +0 -1
- package/lib/commonjs/assets/IconsSVG/mood/SemiSad.js +0 -34
- package/lib/commonjs/assets/IconsSVG/mood/SemiSad.js.map +0 -1
- package/lib/commonjs/components/ExitModal.js +0 -124
- package/lib/commonjs/components/ExitModal.js.map +0 -1
- package/lib/commonjs/components/InfoBars.js +0 -123
- package/lib/commonjs/components/InfoBars.js.map +0 -1
- package/lib/commonjs/components/InvisibleNumberInput.js +0 -150
- package/lib/commonjs/components/InvisibleNumberInput.js.map +0 -1
- package/lib/commonjs/components/LineSeparator.js +0 -27
- package/lib/commonjs/components/LineSeparator.js.map +0 -1
- package/lib/commonjs/components/RecentInsulin.js +0 -105
- package/lib/commonjs/components/RecentInsulin.js.map +0 -1
- package/lib/commonjs/components/RecommendationModal.js +0 -302
- package/lib/commonjs/components/RecommendationModal.js.map +0 -1
- package/lib/commonjs/components/RecommendedCarbs.js +0 -289
- package/lib/commonjs/components/RecommendedCarbs.js.map +0 -1
- package/lib/commonjs/components/RecommendedInsulin.js +0 -209
- package/lib/commonjs/components/RecommendedInsulin.js.map +0 -1
- package/lib/commonjs/components/Remeasure.js +0 -131
- package/lib/commonjs/components/Remeasure.js.map +0 -1
- package/lib/commonjs/components/Text.js +0 -25
- package/lib/commonjs/components/Text.js.map +0 -1
- package/lib/commonjs/components/TimeoutModal.js +0 -113
- package/lib/commonjs/components/TimeoutModal.js.map +0 -1
- package/lib/commonjs/components/TransferToLogbook.js +0 -83
- package/lib/commonjs/components/TransferToLogbook.js.map +0 -1
- package/lib/commonjs/components/activity/Activity.js +0 -112
- package/lib/commonjs/components/activity/Activity.js.map +0 -1
- package/lib/commonjs/components/activity/ActivityIcon.js +0 -86
- package/lib/commonjs/components/activity/ActivityIcon.js.map +0 -1
- package/lib/commonjs/components/activity/ActivityIntensity.js +0 -65
- package/lib/commonjs/components/activity/ActivityIntensity.js.map +0 -1
- package/lib/commonjs/components/mood/Emotion.js +0 -86
- package/lib/commonjs/components/mood/Emotion.js.map +0 -1
- package/lib/commonjs/components/mood/MoodIcon.js +0 -107
- package/lib/commonjs/components/mood/MoodIcon.js.map +0 -1
- package/lib/commonjs/components/styles/fonts.js +0 -160
- package/lib/commonjs/components/styles/fonts.js.map +0 -1
- package/lib/commonjs/index.js +0 -21
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/locales/da/translations.json +0 -82
- package/lib/commonjs/locales/de/translations.json +0 -81
- package/lib/commonjs/locales/en/translations.json +0 -84
- package/lib/commonjs/locales/es/translations.json +0 -81
- package/lib/commonjs/locales/fr/translations.json +0 -81
- package/lib/commonjs/locales/it/translations.json +0 -81
- package/lib/commonjs/locales/translate.js +0 -63
- package/lib/commonjs/locales/translate.js.map +0 -1
- package/lib/commonjs/types/enum.js +0 -179
- package/lib/commonjs/types/enum.js.map +0 -1
- package/lib/commonjs/types/types.js +0 -6
- package/lib/commonjs/types/types.js.map +0 -1
- package/lib/commonjs/utils/AttentionMessages.js +0 -141
- package/lib/commonjs/utils/AttentionMessages.js.map +0 -1
- package/lib/commonjs/utils/Constants.js +0 -138
- package/lib/commonjs/utils/Constants.js.map +0 -1
- package/lib/commonjs/utils/RecommendationError.js +0 -116
- package/lib/commonjs/utils/RecommendationError.js.map +0 -1
- package/lib/commonjs/utils/RecommendationUtils.js +0 -212
- package/lib/commonjs/utils/RecommendationUtils.js.map +0 -1
- package/lib/commonjs/utils/Translations.js +0 -22
- package/lib/commonjs/utils/Translations.js.map +0 -1
- package/lib/commonjs/utils/Utils.js +0 -162
- package/lib/commonjs/utils/Utils.js.map +0 -1
- package/lib/commonjs/utils/Validations.js +0 -468
- package/lib/commonjs/utils/Validations.js.map +0 -1
- package/lib/module/RecommendationScreen.js +0 -768
- package/lib/module/RecommendationScreen.js.map +0 -1
- package/lib/module/assets/IconsSVG/Close.js +0 -11
- package/lib/module/assets/IconsSVG/Close.js.map +0 -1
- package/lib/module/assets/IconsSVG/CloseOutlined.js +0 -19
- package/lib/module/assets/IconsSVG/CloseOutlined.js.map +0 -1
- package/lib/module/assets/IconsSVG/Edit.js +0 -14
- package/lib/module/assets/IconsSVG/Edit.js.map +0 -1
- package/lib/module/assets/IconsSVG/activity/Cycling.js +0 -34
- package/lib/module/assets/IconsSVG/activity/Cycling.js.map +0 -1
- package/lib/module/assets/IconsSVG/activity/Running.js +0 -24
- package/lib/module/assets/IconsSVG/activity/Running.js.map +0 -1
- package/lib/module/assets/IconsSVG/activity/Stretching.js +0 -24
- package/lib/module/assets/IconsSVG/activity/Stretching.js.map +0 -1
- package/lib/module/assets/IconsSVG/activity/Swimming.js +0 -39
- package/lib/module/assets/IconsSVG/activity/Swimming.js.map +0 -1
- package/lib/module/assets/IconsSVG/activity/Walking.js +0 -29
- package/lib/module/assets/IconsSVG/activity/Walking.js.map +0 -1
- package/lib/module/assets/IconsSVG/mood/Happy.js +0 -25
- package/lib/module/assets/IconsSVG/mood/Happy.js.map +0 -1
- package/lib/module/assets/IconsSVG/mood/Neutral.js +0 -25
- package/lib/module/assets/IconsSVG/mood/Neutral.js.map +0 -1
- package/lib/module/assets/IconsSVG/mood/Sad.js +0 -25
- package/lib/module/assets/IconsSVG/mood/Sad.js.map +0 -1
- package/lib/module/assets/IconsSVG/mood/SemiHappy.js +0 -25
- package/lib/module/assets/IconsSVG/mood/SemiHappy.js.map +0 -1
- package/lib/module/assets/IconsSVG/mood/SemiSad.js +0 -25
- package/lib/module/assets/IconsSVG/mood/SemiSad.js.map +0 -1
- package/lib/module/components/ExitModal.js +0 -114
- package/lib/module/components/ExitModal.js.map +0 -1
- package/lib/module/components/InfoBars.js +0 -114
- package/lib/module/components/InfoBars.js.map +0 -1
- package/lib/module/components/InvisibleNumberInput.js +0 -142
- package/lib/module/components/InvisibleNumberInput.js.map +0 -1
- package/lib/module/components/LineSeparator.js +0 -19
- package/lib/module/components/LineSeparator.js.map +0 -1
- package/lib/module/components/RecentInsulin.js +0 -97
- package/lib/module/components/RecentInsulin.js.map +0 -1
- package/lib/module/components/RecommendationModal.js +0 -291
- package/lib/module/components/RecommendationModal.js.map +0 -1
- package/lib/module/components/RecommendedCarbs.js +0 -281
- package/lib/module/components/RecommendedCarbs.js.map +0 -1
- package/lib/module/components/RecommendedInsulin.js +0 -201
- package/lib/module/components/RecommendedInsulin.js.map +0 -1
- package/lib/module/components/Remeasure.js +0 -123
- package/lib/module/components/Remeasure.js.map +0 -1
- package/lib/module/components/Text.js +0 -16
- package/lib/module/components/Text.js.map +0 -1
- package/lib/module/components/TimeoutModal.js +0 -103
- package/lib/module/components/TimeoutModal.js.map +0 -1
- package/lib/module/components/TransferToLogbook.js +0 -75
- package/lib/module/components/TransferToLogbook.js.map +0 -1
- package/lib/module/components/activity/Activity.js +0 -104
- package/lib/module/components/activity/Activity.js.map +0 -1
- package/lib/module/components/activity/ActivityIcon.js +0 -78
- package/lib/module/components/activity/ActivityIcon.js.map +0 -1
- package/lib/module/components/activity/ActivityIntensity.js +0 -57
- package/lib/module/components/activity/ActivityIntensity.js.map +0 -1
- package/lib/module/components/mood/Emotion.js +0 -78
- package/lib/module/components/mood/Emotion.js.map +0 -1
- package/lib/module/components/mood/MoodIcon.js +0 -97
- package/lib/module/components/mood/MoodIcon.js.map +0 -1
- package/lib/module/components/styles/fonts.js +0 -152
- package/lib/module/components/styles/fonts.js.map +0 -1
- package/lib/module/index.js +0 -5
- package/lib/module/index.js.map +0 -1
- package/lib/module/locales/da/translations.json +0 -82
- package/lib/module/locales/de/translations.json +0 -81
- package/lib/module/locales/en/translations.json +0 -84
- package/lib/module/locales/es/translations.json +0 -81
- package/lib/module/locales/fr/translations.json +0 -81
- package/lib/module/locales/it/translations.json +0 -81
- package/lib/module/locales/translate.js +0 -55
- package/lib/module/locales/translate.js.map +0 -1
- package/lib/module/types/enum.js +0 -170
- package/lib/module/types/enum.js.map +0 -1
- package/lib/module/types/types.js +0 -2
- package/lib/module/types/types.js.map +0 -1
- package/lib/module/utils/AttentionMessages.js +0 -131
- package/lib/module/utils/AttentionMessages.js.map +0 -1
- package/lib/module/utils/Constants.js.map +0 -1
- package/lib/module/utils/RecommendationError.js +0 -87
- package/lib/module/utils/RecommendationError.js.map +0 -1
- package/lib/module/utils/RecommendationUtils.js.map +0 -1
- package/lib/module/utils/Translations.js.map +0 -1
- package/lib/module/utils/Utils.js +0 -155
- package/lib/module/utils/Utils.js.map +0 -1
- package/lib/module/utils/Validations.js.map +0 -1
- package/lib/typescript/RecommendationScreen.d.ts.map +0 -1
- package/lib/typescript/assets/IconsSVG/Close.d.ts +0 -5
- package/lib/typescript/assets/IconsSVG/Close.d.ts.map +0 -1
- package/lib/typescript/assets/IconsSVG/CloseOutlined.d.ts +0 -5
- package/lib/typescript/assets/IconsSVG/CloseOutlined.d.ts.map +0 -1
- package/lib/typescript/assets/IconsSVG/Edit.d.ts +0 -5
- package/lib/typescript/assets/IconsSVG/Edit.d.ts.map +0 -1
- package/lib/typescript/assets/IconsSVG/activity/Cycling.d.ts +0 -5
- package/lib/typescript/assets/IconsSVG/activity/Cycling.d.ts.map +0 -1
- package/lib/typescript/assets/IconsSVG/activity/Running.d.ts +0 -5
- package/lib/typescript/assets/IconsSVG/activity/Running.d.ts.map +0 -1
- package/lib/typescript/assets/IconsSVG/activity/Stretching.d.ts +0 -5
- package/lib/typescript/assets/IconsSVG/activity/Stretching.d.ts.map +0 -1
- package/lib/typescript/assets/IconsSVG/activity/Swimming.d.ts +0 -5
- package/lib/typescript/assets/IconsSVG/activity/Swimming.d.ts.map +0 -1
- package/lib/typescript/assets/IconsSVG/activity/Walking.d.ts +0 -5
- package/lib/typescript/assets/IconsSVG/activity/Walking.d.ts.map +0 -1
- package/lib/typescript/assets/IconsSVG/mood/Happy.d.ts +0 -5
- package/lib/typescript/assets/IconsSVG/mood/Happy.d.ts.map +0 -1
- package/lib/typescript/assets/IconsSVG/mood/Neutral.d.ts +0 -5
- package/lib/typescript/assets/IconsSVG/mood/Neutral.d.ts.map +0 -1
- package/lib/typescript/assets/IconsSVG/mood/Sad.d.ts +0 -5
- package/lib/typescript/assets/IconsSVG/mood/Sad.d.ts.map +0 -1
- package/lib/typescript/assets/IconsSVG/mood/SemiHappy.d.ts +0 -5
- package/lib/typescript/assets/IconsSVG/mood/SemiHappy.d.ts.map +0 -1
- package/lib/typescript/assets/IconsSVG/mood/SemiSad.d.ts +0 -5
- package/lib/typescript/assets/IconsSVG/mood/SemiSad.d.ts.map +0 -1
- package/lib/typescript/components/ExitModal.d.ts +0 -26
- package/lib/typescript/components/ExitModal.d.ts.map +0 -1
- package/lib/typescript/components/InfoBars.d.ts.map +0 -1
- package/lib/typescript/components/InvisibleNumberInput.d.ts.map +0 -1
- package/lib/typescript/components/LineSeparator.d.ts.map +0 -1
- package/lib/typescript/components/RecentInsulin.d.ts.map +0 -1
- package/lib/typescript/components/RecommendationModal.d.ts.map +0 -1
- package/lib/typescript/components/RecommendedCarbs.d.ts.map +0 -1
- package/lib/typescript/components/RecommendedInsulin.d.ts.map +0 -1
- package/lib/typescript/components/Remeasure.d.ts.map +0 -1
- package/lib/typescript/components/Text.d.ts +0 -14
- package/lib/typescript/components/Text.d.ts.map +0 -1
- package/lib/typescript/components/TimeoutModal.d.ts +0 -25
- package/lib/typescript/components/TimeoutModal.d.ts.map +0 -1
- package/lib/typescript/components/TransferToLogbook.d.ts.map +0 -1
- package/lib/typescript/components/activity/Activity.d.ts.map +0 -1
- package/lib/typescript/components/activity/ActivityIcon.d.ts.map +0 -1
- package/lib/typescript/components/activity/ActivityIntensity.d.ts.map +0 -1
- package/lib/typescript/components/mood/Emotion.d.ts.map +0 -1
- package/lib/typescript/components/mood/MoodIcon.d.ts.map +0 -1
- package/lib/typescript/components/styles/fonts.d.ts +0 -151
- package/lib/typescript/components/styles/fonts.d.ts.map +0 -1
- package/lib/typescript/index.d.ts +0 -5
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/locales/translate.d.ts +0 -20
- package/lib/typescript/locales/translate.d.ts.map +0 -1
- package/lib/typescript/types/enum.d.ts.map +0 -1
- package/lib/typescript/types/types.d.ts.map +0 -1
- package/lib/typescript/utils/AttentionMessages.d.ts.map +0 -1
- package/lib/typescript/utils/Constants.d.ts.map +0 -1
- package/lib/typescript/utils/RecommendationError.d.ts.map +0 -1
- package/lib/typescript/utils/RecommendationUtils.d.ts.map +0 -1
- package/lib/typescript/utils/Translations.d.ts.map +0 -1
- package/lib/typescript/utils/Utils.d.ts.map +0 -1
- package/lib/typescript/utils/Validations.d.ts.map +0 -1
- package/src/RecommendationScreen.tsx +0 -854
- package/src/assets/IconsSVG/Close.tsx +0 -13
- package/src/assets/IconsSVG/CloseOutlined.tsx +0 -23
- package/src/assets/IconsSVG/Edit.tsx +0 -16
- package/src/assets/IconsSVG/activity/Cycling.tsx +0 -41
- package/src/assets/IconsSVG/activity/Running.tsx +0 -29
- package/src/assets/IconsSVG/activity/Stretching.tsx +0 -29
- package/src/assets/IconsSVG/activity/Swimming.tsx +0 -47
- package/src/assets/IconsSVG/activity/Walking.tsx +0 -35
- package/src/assets/IconsSVG/mood/Happy.tsx +0 -30
- package/src/assets/IconsSVG/mood/Neutral.tsx +0 -30
- package/src/assets/IconsSVG/mood/Sad.tsx +0 -30
- package/src/assets/IconsSVG/mood/SemiHappy.tsx +0 -30
- package/src/assets/IconsSVG/mood/SemiSad.tsx +0 -30
- package/src/components/ExitModal.tsx +0 -134
- package/src/components/InfoBars.tsx +0 -122
- package/src/components/InvisibleNumberInput.tsx +0 -170
- package/src/components/LineSeparator.tsx +0 -29
- package/src/components/RecentInsulin.tsx +0 -109
- package/src/components/RecommendationModal.tsx +0 -319
- package/src/components/RecommendedCarbs.tsx +0 -303
- package/src/components/RecommendedInsulin.tsx +0 -220
- package/src/components/Remeasure.tsx +0 -135
- package/src/components/Text.tsx +0 -27
- package/src/components/TimeoutModal.tsx +0 -121
- package/src/components/TransferToLogbook.tsx +0 -92
- package/src/components/activity/Activity.tsx +0 -107
- package/src/components/activity/ActivityIcon.tsx +0 -77
- package/src/components/activity/ActivityIntensity.tsx +0 -67
- package/src/components/mood/Emotion.tsx +0 -97
- package/src/components/mood/MoodIcon.tsx +0 -91
- package/src/components/styles/fonts.ts +0 -151
- package/src/index.ts +0 -5
- package/src/locales/da/translations.json +0 -82
- package/src/locales/de/translations.json +0 -81
- package/src/locales/en/translations.json +0 -84
- package/src/locales/es/translations.json +0 -81
- package/src/locales/fr/translations.json +0 -81
- package/src/locales/it/translations.json +0 -81
- package/src/locales/translate.ts +0 -62
- package/src/types/enum.ts +0 -164
- package/src/types/types.ts +0 -19
- package/src/utils/AttentionMessages.ts +0 -167
- package/src/utils/Constants.ts +0 -77
- package/src/utils/RecommendationError.ts +0 -182
- package/src/utils/RecommendationUtils.ts +0 -232
- package/src/utils/Translations.ts +0 -17
- package/src/utils/Utils.ts +0 -156
- package/src/utils/Validations.ts +0 -490
|
@@ -8,15 +8,25 @@ export interface IProps {
|
|
|
8
8
|
*/
|
|
9
9
|
onSliderChange(value: number): void;
|
|
10
10
|
}
|
|
11
|
-
export interface IState {
|
|
12
|
-
remeasureTime: number;
|
|
13
|
-
}
|
|
14
11
|
/**
|
|
15
12
|
* The Remeasure component has a slider child component that the user can drag to change
|
|
16
13
|
* when they will get a reminder notification about measuring their BGL again.
|
|
17
14
|
*/
|
|
18
|
-
export default class Remeasure extends React.Component<IProps
|
|
19
|
-
|
|
15
|
+
export default class Remeasure extends React.Component<IProps> {
|
|
16
|
+
/** For holding a reference to the slider component so its initial value can be set (only one time) when the Remeasure component has been mounted. */
|
|
17
|
+
private slider?;
|
|
18
|
+
/**
|
|
19
|
+
* Called immediately after a component is mounted. Setting state here will trigger re-rendering.
|
|
20
|
+
*
|
|
21
|
+
* If the value of a slider component in React Native is set to track an outside state,
|
|
22
|
+
* the slider indicator may jump back and forth while updates to the value are propagated through the affected objects and components.
|
|
23
|
+
* Since we don’t need to change the value of the slider from the outside after initialising it to the default value,
|
|
24
|
+
* we simply set the default value (using setNativeProp) upon initialisation instead of using the slider’s normal value prop to set it.
|
|
25
|
+
*
|
|
26
|
+
* Steps:
|
|
27
|
+
* 1. Call the setNativeProps() method on the slider to set its value to the remeasureTime prop.
|
|
28
|
+
*/
|
|
29
|
+
componentDidMount(): void;
|
|
20
30
|
/**
|
|
21
31
|
* Steps:
|
|
22
32
|
* 1. Use limitTime() to limit/clamp the value of remeasureTime in the range 0 to 6.
|
|
@@ -37,4 +47,3 @@ export default class Remeasure extends React.Component<IProps, IState> {
|
|
|
37
47
|
*/
|
|
38
48
|
render(): JSX.Element;
|
|
39
49
|
}
|
|
40
|
-
//# sourceMappingURL=Remeasure.d.ts.map
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { t } from "@lingui/macro";
|
|
2
|
+
import Slider from "@react-native-community/slider";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Dimensions, Platform, StyleSheet, View } from "react-native";
|
|
5
|
+
import { i18n } from "../locale/i18nUtils";
|
|
6
|
+
import { Testing } from "../types/enum";
|
|
7
|
+
import { colors } from "../utils/Constants";
|
|
8
|
+
import { infoStyles } from "./InfoBars";
|
|
9
|
+
import TextBold from "./text/TextBold";
|
|
10
|
+
import TextRegular from "./text/TextRegular";
|
|
11
|
+
/**
|
|
12
|
+
* The Remeasure component has a slider child component that the user can drag to change
|
|
13
|
+
* when they will get a reminder notification about measuring their BGL again.
|
|
14
|
+
*/
|
|
15
|
+
export default class Remeasure extends React.Component {
|
|
16
|
+
/** For holding a reference to the slider component so its initial value can be set (only one time) when the Remeasure component has been mounted. */
|
|
17
|
+
slider;
|
|
18
|
+
/**
|
|
19
|
+
* Called immediately after a component is mounted. Setting state here will trigger re-rendering.
|
|
20
|
+
*
|
|
21
|
+
* If the value of a slider component in React Native is set to track an outside state,
|
|
22
|
+
* the slider indicator may jump back and forth while updates to the value are propagated through the affected objects and components.
|
|
23
|
+
* Since we don’t need to change the value of the slider from the outside after initialising it to the default value,
|
|
24
|
+
* we simply set the default value (using setNativeProp) upon initialisation instead of using the slider’s normal value prop to set it.
|
|
25
|
+
*
|
|
26
|
+
* Steps:
|
|
27
|
+
* 1. Call the setNativeProps() method on the slider to set its value to the remeasureTime prop.
|
|
28
|
+
*/
|
|
29
|
+
componentDidMount() {
|
|
30
|
+
this.slider?.setNativeProps({
|
|
31
|
+
value: this.props.remeasureTime,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Steps:
|
|
36
|
+
* 1. Use limitTime() to limit/clamp the value of remeasureTime in the range 0 to 6.
|
|
37
|
+
* 2. Call the onSliderChange prop callback function with the limited value as argument.
|
|
38
|
+
* @param remeasureTime The value of the remeasurement slider.
|
|
39
|
+
*/
|
|
40
|
+
handleSliderChange = (remeasureTime) => {
|
|
41
|
+
const limited = this.limitTime(remeasureTime);
|
|
42
|
+
this.props.onSliderChange(limited);
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Steps:
|
|
46
|
+
* 1.Use Math.min() and Math.max() to clamp remeasureTime in the range 0 to 6 and return the result.
|
|
47
|
+
* @param remeasureTime The value of the remeasurement slider.
|
|
48
|
+
* @returns The limited remeasurement time in hours
|
|
49
|
+
*/
|
|
50
|
+
limitTime = (remeasureTime) => {
|
|
51
|
+
return Math.min(Math.max(0, remeasureTime), 6);
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Compose a JSX element for displaying the currently selected remeasurement time along
|
|
55
|
+
* with a horizontal slider for changing it in increments of 0.5 hours in the range 0 to 6.
|
|
56
|
+
*/
|
|
57
|
+
render() {
|
|
58
|
+
const measure = this.props.remeasureTime > 0;
|
|
59
|
+
const limited = this.limitTime(this.props.remeasureTime);
|
|
60
|
+
const marginHorizontal = Platform.OS === `ios` ? `3%` : `0%`;
|
|
61
|
+
const valueContainer = measure ? remeasureStyles.valueContainer : variantStyles.centeredValueContainer;
|
|
62
|
+
return (<View style={remeasureStyles.container}>
|
|
63
|
+
<View style={remeasureStyles.borderContainer}>
|
|
64
|
+
<View style={remeasureStyles.remeasureContainer}>
|
|
65
|
+
<TextBold style={remeasureStyles.remeasureLabel}>
|
|
66
|
+
{i18n._(t `Remind me to remeasure in`)}
|
|
67
|
+
</TextBold>
|
|
68
|
+
</View>
|
|
69
|
+
<View style={remeasureStyles.valueUnitContainer}>
|
|
70
|
+
<View style={valueContainer}>
|
|
71
|
+
<TextBold style={remeasureStyles.value} testID={Testing.Id.RemeasureTestIds.RemeasureHours}>
|
|
72
|
+
{measure ? limited : i18n._(t `OFF`)}
|
|
73
|
+
</TextBold>
|
|
74
|
+
</View>
|
|
75
|
+
{measure ? (<View style={remeasureStyles.unitContainer}>
|
|
76
|
+
<TextRegular style={remeasureStyles.units}>{i18n._(t `hours`)}</TextRegular>
|
|
77
|
+
</View>) : null}
|
|
78
|
+
</View>
|
|
79
|
+
</View>
|
|
80
|
+
<Slider ref={(slider) => {
|
|
81
|
+
if (slider !== null) {
|
|
82
|
+
this.slider = slider;
|
|
83
|
+
}
|
|
84
|
+
}} testID={Testing.Id.RemeasureTestIds.RemeasureSlider} maximumTrackTintColor={colors.mistBlue} minimumTrackTintColor={colors.teal} thumbTintColor={colors.teal} maximumValue={6} minimumValue={0} step={0.5} style={[remeasureStyles.sliderStyle, { marginHorizontal }]} onValueChange={this.handleSliderChange}/>
|
|
85
|
+
</View>);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const remeasureStyles = StyleSheet.create({
|
|
89
|
+
container: {
|
|
90
|
+
flexDirection: `column`,
|
|
91
|
+
padding: `3%`,
|
|
92
|
+
},
|
|
93
|
+
borderContainer: {
|
|
94
|
+
...infoStyles.borderContainer,
|
|
95
|
+
alignItems: `center`,
|
|
96
|
+
},
|
|
97
|
+
remeasureContainer: {
|
|
98
|
+
flex: 7,
|
|
99
|
+
},
|
|
100
|
+
remeasureLabel: {
|
|
101
|
+
color: `white`,
|
|
102
|
+
fontSize: Dimensions.get(`screen`).width / 28,
|
|
103
|
+
},
|
|
104
|
+
valueUnitContainer: {
|
|
105
|
+
...infoStyles.valueUnitContainer,
|
|
106
|
+
},
|
|
107
|
+
valueContainer: {
|
|
108
|
+
...infoStyles.valueContainer,
|
|
109
|
+
},
|
|
110
|
+
value: {
|
|
111
|
+
...infoStyles.value,
|
|
112
|
+
},
|
|
113
|
+
unitContainer: {
|
|
114
|
+
...infoStyles.unitContainer,
|
|
115
|
+
marginRight: `7%`,
|
|
116
|
+
},
|
|
117
|
+
units: {
|
|
118
|
+
...infoStyles.units,
|
|
119
|
+
},
|
|
120
|
+
sliderStyle: {
|
|
121
|
+
marginTop: `3%`,
|
|
122
|
+
marginBottom: `2%`,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
const variantStyles = StyleSheet.create({
|
|
126
|
+
centeredValueContainer: {
|
|
127
|
+
...remeasureStyles.valueContainer,
|
|
128
|
+
alignItems: `center`,
|
|
129
|
+
},
|
|
130
|
+
});
|
package/{lib/typescript/components/TransferToLogbook.d.ts → dist/src/components/SaveButton.d.ts}
RENAMED
|
@@ -13,7 +13,7 @@ export interface IState {
|
|
|
13
13
|
* Render a button for transferring the recommendation to a logbook entry.
|
|
14
14
|
* The button has a visually distinct pressed state to signal to the user that the button was actually activated before returning to the dashboard screen.
|
|
15
15
|
*/
|
|
16
|
-
export default class
|
|
16
|
+
export default class SaveButton extends React.Component<IProps, IState> {
|
|
17
17
|
/** Initialise the state pressed variable with false */
|
|
18
18
|
state: IState;
|
|
19
19
|
/**
|
|
@@ -30,6 +30,5 @@ export default class TransferToLogbook extends React.Component<IProps, IState> {
|
|
|
30
30
|
* 2. Return a JSX element to display a touchable button (that is disabled when the pressed state is true)
|
|
31
31
|
* @returns JSX element for displaying the transfer button
|
|
32
32
|
*/
|
|
33
|
-
render(): JSX.Element
|
|
33
|
+
render(): JSX.Element;
|
|
34
34
|
}
|
|
35
|
-
//# sourceMappingURL=TransferToLogbook.d.ts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Dimensions, StyleSheet, TouchableOpacity, View } from "react-native";
|
|
3
|
+
import { t } from "@lingui/macro";
|
|
4
|
+
import { i18n } from "../locale/i18nUtils";
|
|
5
|
+
import { Testing } from "../types/enum";
|
|
6
|
+
import { colors } from "../utils/Constants";
|
|
7
|
+
import TextBold from "./text/TextBold";
|
|
8
|
+
/**
|
|
9
|
+
* Render a button for transferring the recommendation to a logbook entry.
|
|
10
|
+
* The button has a visually distinct pressed state to signal to the user that the button was actually activated before returning to the dashboard screen.
|
|
11
|
+
*/
|
|
12
|
+
export default class SaveButton extends React.Component {
|
|
13
|
+
/** Initialise the state pressed variable with false */
|
|
14
|
+
state = {
|
|
15
|
+
pressed: false,
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Handle what happens when the button is pressed.
|
|
19
|
+
*
|
|
20
|
+
* Steps:
|
|
21
|
+
* 1. Toggle the pressed state to the opposite of its current value.
|
|
22
|
+
* 2. Call the transfer prop callback function.
|
|
23
|
+
*/
|
|
24
|
+
handlePress = () => {
|
|
25
|
+
this.setState({
|
|
26
|
+
pressed: !this.state.pressed,
|
|
27
|
+
});
|
|
28
|
+
this.props.transfer();
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Steps:
|
|
32
|
+
* 1. If the visible prop is false, display an empty space to keep the correct margins in the screen.
|
|
33
|
+
* 2. Return a JSX element to display a touchable button (that is disabled when the pressed state is true)
|
|
34
|
+
* @returns JSX element for displaying the transfer button
|
|
35
|
+
*/
|
|
36
|
+
render() {
|
|
37
|
+
if (!this.props.visible) {
|
|
38
|
+
return <View style={styles.marginContainer}/>;
|
|
39
|
+
}
|
|
40
|
+
return (<View style={styles.wrapper}>
|
|
41
|
+
<TouchableOpacity testID={Testing.Id.TransferToLogbookTestIds.TransferButton} onPress={this.handlePress} disabled={this.state.pressed} style={styles.button}>
|
|
42
|
+
<TextBold style={styles.text}>{i18n._(t `Save to logbook`)}</TextBold>
|
|
43
|
+
</TouchableOpacity>
|
|
44
|
+
</View>);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const { width } = Dimensions.get(`screen`);
|
|
48
|
+
const styles = StyleSheet.create({
|
|
49
|
+
marginContainer: {
|
|
50
|
+
marginVertical: `3%`,
|
|
51
|
+
},
|
|
52
|
+
wrapper: {
|
|
53
|
+
flexDirection: `row`,
|
|
54
|
+
alignSelf: `center`,
|
|
55
|
+
},
|
|
56
|
+
button: {
|
|
57
|
+
backgroundColor: colors.teal,
|
|
58
|
+
borderRadius: 40,
|
|
59
|
+
marginTop: width / 5,
|
|
60
|
+
marginBottom: width / 18,
|
|
61
|
+
},
|
|
62
|
+
text: {
|
|
63
|
+
fontFamily: `Poppins-Bold`,
|
|
64
|
+
paddingVertical: width / 26,
|
|
65
|
+
paddingHorizontal: width / 10,
|
|
66
|
+
textAlign: `center`,
|
|
67
|
+
color: colors.semiDarkBlue,
|
|
68
|
+
fontSize: width / 22,
|
|
69
|
+
lineHeight: width / 16,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ITwoOptionModalProps {
|
|
3
|
+
/** The title of the modal. */
|
|
4
|
+
title: string;
|
|
5
|
+
/** The message to show in the modal. */
|
|
6
|
+
message: string;
|
|
7
|
+
/** The label of the first option. */
|
|
8
|
+
textFirstOption: string;
|
|
9
|
+
/** The label of the second option. */
|
|
10
|
+
textSecondOption: string;
|
|
11
|
+
/** Whether or not the modal shall have a cancel button in the corner to close the modal. */
|
|
12
|
+
isCancelable?: boolean;
|
|
13
|
+
/** If true the buttons will be displayed side-by-side. If false the buttons will be displayed on top of each other. */
|
|
14
|
+
rowAsButtonLayout: boolean;
|
|
15
|
+
/** To be called if the user taps the first option button. */
|
|
16
|
+
firstOption(): void;
|
|
17
|
+
/** To be called if the user taps the second option button. */
|
|
18
|
+
secondOption(): void;
|
|
19
|
+
/** To be called if the user taps the optionally shown close button. */
|
|
20
|
+
onClose?(): void;
|
|
21
|
+
}
|
|
22
|
+
/** Display a modal with two buttons for the user to choose between. */
|
|
23
|
+
export default class TwoOptionModal extends React.Component<ITwoOptionModalProps> {
|
|
24
|
+
/** Compose a JSX element for displaying the modal. */
|
|
25
|
+
render(): JSX.Element;
|
|
26
|
+
}
|
|
27
|
+
/** @internal */
|
|
28
|
+
export declare const modalStyle: {
|
|
29
|
+
container: {
|
|
30
|
+
justifyContent: "center";
|
|
31
|
+
backgroundColor: string;
|
|
32
|
+
height: number;
|
|
33
|
+
position: "absolute";
|
|
34
|
+
left: 0;
|
|
35
|
+
right: 0;
|
|
36
|
+
top: 0;
|
|
37
|
+
bottom: 0;
|
|
38
|
+
};
|
|
39
|
+
modalContainer: {
|
|
40
|
+
margin: string;
|
|
41
|
+
backgroundColor: string;
|
|
42
|
+
borderRadius: number;
|
|
43
|
+
};
|
|
44
|
+
iconWrapper: {
|
|
45
|
+
alignSelf: "flex-end";
|
|
46
|
+
marginRight: string;
|
|
47
|
+
marginTop: string;
|
|
48
|
+
};
|
|
49
|
+
icon: {
|
|
50
|
+
color: string;
|
|
51
|
+
fontSize: number;
|
|
52
|
+
};
|
|
53
|
+
textContainer: {
|
|
54
|
+
marginHorizontal: string;
|
|
55
|
+
marginBottom: string;
|
|
56
|
+
marginTop: string;
|
|
57
|
+
alignSelf: "flex-start";
|
|
58
|
+
};
|
|
59
|
+
textContainerNotCancelable: {
|
|
60
|
+
marginHorizontal: string;
|
|
61
|
+
marginVertical: string;
|
|
62
|
+
alignSelf: "flex-start";
|
|
63
|
+
};
|
|
64
|
+
titleRowLayout: {
|
|
65
|
+
color: string;
|
|
66
|
+
fontSize: number;
|
|
67
|
+
textAlign: "center";
|
|
68
|
+
marginBottom: string;
|
|
69
|
+
};
|
|
70
|
+
titleColumnLayout: {
|
|
71
|
+
color: string;
|
|
72
|
+
fontSize: number;
|
|
73
|
+
textAlign: "center";
|
|
74
|
+
marginBottom: string;
|
|
75
|
+
};
|
|
76
|
+
message: {
|
|
77
|
+
color: string;
|
|
78
|
+
fontSize: number;
|
|
79
|
+
textAlign: "center";
|
|
80
|
+
};
|
|
81
|
+
buttonContainerRow: {
|
|
82
|
+
flexDirection: "row";
|
|
83
|
+
justifyContent: "space-around";
|
|
84
|
+
marginHorizontal: string;
|
|
85
|
+
marginVertical: string;
|
|
86
|
+
};
|
|
87
|
+
buttonContainerColumn: {
|
|
88
|
+
flexDirection: "column";
|
|
89
|
+
justifyContent: "space-around";
|
|
90
|
+
margin: string;
|
|
91
|
+
};
|
|
92
|
+
buttonRow: {
|
|
93
|
+
height: number;
|
|
94
|
+
marginTop: number;
|
|
95
|
+
borderRadius: number;
|
|
96
|
+
borderWidth: number;
|
|
97
|
+
borderColor: string;
|
|
98
|
+
width: number;
|
|
99
|
+
alignSelf: "center";
|
|
100
|
+
justifyContent: "center";
|
|
101
|
+
};
|
|
102
|
+
firstButtonColumn: {
|
|
103
|
+
height: number;
|
|
104
|
+
width: number;
|
|
105
|
+
marginTop: number;
|
|
106
|
+
backgroundColor: string;
|
|
107
|
+
borderRadius: number;
|
|
108
|
+
borderWidth: number;
|
|
109
|
+
borderColor: string;
|
|
110
|
+
alignSelf: "center";
|
|
111
|
+
justifyContent: "center";
|
|
112
|
+
};
|
|
113
|
+
secondButtonColumn: {
|
|
114
|
+
alignSelf: "center";
|
|
115
|
+
justifyContent: "center";
|
|
116
|
+
height: number;
|
|
117
|
+
width: number;
|
|
118
|
+
marginTop: string;
|
|
119
|
+
};
|
|
120
|
+
textButtonRow: {
|
|
121
|
+
textAlign: "center";
|
|
122
|
+
fontSize: number;
|
|
123
|
+
color: string;
|
|
124
|
+
};
|
|
125
|
+
textFirstButtonColumn: {
|
|
126
|
+
textAlign: "center";
|
|
127
|
+
fontSize: number;
|
|
128
|
+
paddingHorizontal: number;
|
|
129
|
+
color: string;
|
|
130
|
+
};
|
|
131
|
+
textSecondButtonColumn: {
|
|
132
|
+
textAlign: "center";
|
|
133
|
+
fontSize: number;
|
|
134
|
+
color: string;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Dimensions, StatusBar, StyleSheet, TouchableOpacity, View } from "react-native";
|
|
3
|
+
import { Testing } from "../types/enum";
|
|
4
|
+
import { colors } from "../utils/Constants";
|
|
5
|
+
import Icon from "./Icon";
|
|
6
|
+
import { stylesModal } from "./RecommendationModal";
|
|
7
|
+
import TextBold from "./text/TextBold";
|
|
8
|
+
import TextRegular from "./text/TextRegular";
|
|
9
|
+
const { TwoOptionModalTestIds } = Testing.Id;
|
|
10
|
+
/** Display a modal with two buttons for the user to choose between. */
|
|
11
|
+
export default class TwoOptionModal extends React.Component {
|
|
12
|
+
/** Compose a JSX element for displaying the modal. */
|
|
13
|
+
render() {
|
|
14
|
+
const { rowAsButtonLayout, isCancelable } = this.props;
|
|
15
|
+
return (<View style={modalStyle.container}>
|
|
16
|
+
<StatusBar backgroundColor={`rgba(0, 0, 0, 1)`}/>
|
|
17
|
+
<View style={modalStyle.modalContainer}>
|
|
18
|
+
{isCancelable ? (<TouchableOpacity onPress={this.props.onClose} testID={TwoOptionModalTestIds.ExitButton} style={modalStyle.iconWrapper}>
|
|
19
|
+
<Icon iconIdentifier={`Ionicons/ios-close-circle-outline`} style={modalStyle.icon}/>
|
|
20
|
+
</TouchableOpacity>) : null}
|
|
21
|
+
|
|
22
|
+
<View style={isCancelable ? modalStyle.textContainer : modalStyle.textContainerNotCancelable}>
|
|
23
|
+
<TextBold style={rowAsButtonLayout ? modalStyle.titleRowLayout : modalStyle.titleColumnLayout}>
|
|
24
|
+
{this.props.title}
|
|
25
|
+
</TextBold>
|
|
26
|
+
<TextRegular style={modalStyle.message}>{this.props.message}</TextRegular>
|
|
27
|
+
</View>
|
|
28
|
+
<View style={rowAsButtonLayout ? modalStyle.buttonContainerRow : modalStyle.buttonContainerColumn}>
|
|
29
|
+
<TouchableOpacity testID={TwoOptionModalTestIds.FirstOption} onPress={this.props.firstOption} style={rowAsButtonLayout ? modalStyle.buttonRow : modalStyle.firstButtonColumn}>
|
|
30
|
+
<TextBold style={rowAsButtonLayout ? modalStyle.textButtonRow : modalStyle.textFirstButtonColumn}>
|
|
31
|
+
{this.props.textFirstOption}
|
|
32
|
+
</TextBold>
|
|
33
|
+
</TouchableOpacity>
|
|
34
|
+
<TouchableOpacity testID={TwoOptionModalTestIds.SecondOption} onPress={this.props.secondOption} style={rowAsButtonLayout ? modalStyle.buttonRow : modalStyle.secondButtonColumn}>
|
|
35
|
+
<TextBold style={rowAsButtonLayout ? modalStyle.textButtonRow : modalStyle.textSecondButtonColumn}>
|
|
36
|
+
{this.props.textSecondOption}
|
|
37
|
+
</TextBold>
|
|
38
|
+
</TouchableOpacity>
|
|
39
|
+
</View>
|
|
40
|
+
</View>
|
|
41
|
+
</View>);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const { height, width } = Dimensions.get(`screen`);
|
|
45
|
+
/** @internal */
|
|
46
|
+
export const modalStyle = StyleSheet.create({
|
|
47
|
+
container: {
|
|
48
|
+
...StyleSheet.absoluteFillObject,
|
|
49
|
+
justifyContent: `center`,
|
|
50
|
+
backgroundColor: `rgba(0, 0, 0, 0.9)`,
|
|
51
|
+
height,
|
|
52
|
+
},
|
|
53
|
+
modalContainer: {
|
|
54
|
+
margin: `4%`,
|
|
55
|
+
backgroundColor: colors.darkBlue,
|
|
56
|
+
borderRadius: width / 25,
|
|
57
|
+
},
|
|
58
|
+
iconWrapper: {
|
|
59
|
+
alignSelf: `flex-end`,
|
|
60
|
+
marginRight: `4%`,
|
|
61
|
+
marginTop: `3%`,
|
|
62
|
+
},
|
|
63
|
+
icon: {
|
|
64
|
+
color: colors.mistBlue,
|
|
65
|
+
fontSize: width / 12,
|
|
66
|
+
},
|
|
67
|
+
textContainer: {
|
|
68
|
+
marginHorizontal: `4%`,
|
|
69
|
+
marginBottom: `5%`,
|
|
70
|
+
marginTop: `2%`,
|
|
71
|
+
alignSelf: `flex-start`,
|
|
72
|
+
},
|
|
73
|
+
textContainerNotCancelable: {
|
|
74
|
+
marginHorizontal: `4%`,
|
|
75
|
+
marginVertical: `5%`,
|
|
76
|
+
alignSelf: `flex-start`,
|
|
77
|
+
},
|
|
78
|
+
titleRowLayout: {
|
|
79
|
+
color: colors.fadeBlue,
|
|
80
|
+
fontSize: width / 17,
|
|
81
|
+
textAlign: `center`,
|
|
82
|
+
marginBottom: `10%`,
|
|
83
|
+
},
|
|
84
|
+
titleColumnLayout: {
|
|
85
|
+
color: colors.fadeBlue,
|
|
86
|
+
fontSize: width / 17,
|
|
87
|
+
textAlign: `center`,
|
|
88
|
+
marginBottom: `5%`,
|
|
89
|
+
},
|
|
90
|
+
message: {
|
|
91
|
+
color: `white`,
|
|
92
|
+
fontSize: width / 22,
|
|
93
|
+
textAlign: `center`,
|
|
94
|
+
},
|
|
95
|
+
buttonContainerRow: {
|
|
96
|
+
flexDirection: `row`,
|
|
97
|
+
justifyContent: `space-around`,
|
|
98
|
+
marginHorizontal: `4%`,
|
|
99
|
+
marginVertical: `6%`,
|
|
100
|
+
},
|
|
101
|
+
buttonContainerColumn: {
|
|
102
|
+
flexDirection: `column`,
|
|
103
|
+
justifyContent: `space-around`,
|
|
104
|
+
margin: `4%`,
|
|
105
|
+
},
|
|
106
|
+
buttonRow: {
|
|
107
|
+
...stylesModal.okButton,
|
|
108
|
+
height: height / 16,
|
|
109
|
+
marginTop: 0,
|
|
110
|
+
},
|
|
111
|
+
firstButtonColumn: {
|
|
112
|
+
...stylesModal.okButton,
|
|
113
|
+
height: height / 18,
|
|
114
|
+
width: width / 1.5,
|
|
115
|
+
marginTop: 0,
|
|
116
|
+
backgroundColor: colors.teal,
|
|
117
|
+
},
|
|
118
|
+
secondButtonColumn: {
|
|
119
|
+
alignSelf: `center`,
|
|
120
|
+
justifyContent: `center`,
|
|
121
|
+
height: height / 18,
|
|
122
|
+
width: width / 1.5,
|
|
123
|
+
marginTop: `2%`,
|
|
124
|
+
},
|
|
125
|
+
textButtonRow: {
|
|
126
|
+
textAlign: `center`,
|
|
127
|
+
fontSize: width / 24,
|
|
128
|
+
color: `white`,
|
|
129
|
+
},
|
|
130
|
+
textFirstButtonColumn: {
|
|
131
|
+
textAlign: `center`,
|
|
132
|
+
fontSize: width / 22,
|
|
133
|
+
paddingHorizontal: 15,
|
|
134
|
+
color: colors.semiDarkBlue,
|
|
135
|
+
},
|
|
136
|
+
textSecondButtonColumn: {
|
|
137
|
+
textAlign: `center`,
|
|
138
|
+
fontSize: width / 26,
|
|
139
|
+
color: colors.teal,
|
|
140
|
+
},
|
|
141
|
+
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { Activity as ActivityTypes, BolusCalculator } from "@hedia/types";
|
|
1
2
|
import React from "react";
|
|
2
|
-
import { Activity as ActivitySettings, BolusCalculator } from "@hedia/types";
|
|
3
3
|
import { IActivityDisplayProps } from "../../types/types";
|
|
4
4
|
export interface IProps extends IActivityDisplayProps {
|
|
5
5
|
/** Details about the activity that affect the calculation */
|
|
6
6
|
activity: BolusCalculator.Types.IActivityParams;
|
|
7
7
|
/** The fraction (in the interval [0; 1]) by which the insulin recommendation is being reduced due to physical activity */
|
|
8
|
-
activityReduction:
|
|
8
|
+
activityReduction: ActivityTypes.Types.ReductionType;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Component for displaying a summary of the entered physical activity along with the effect it has on the insulin recommendation.
|
|
@@ -24,4 +24,3 @@ export default class Activity extends React.Component<IProps> {
|
|
|
24
24
|
*/
|
|
25
25
|
render(): JSX.Element;
|
|
26
26
|
}
|
|
27
|
-
//# sourceMappingURL=Activity.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { t } from "@lingui/macro";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Dimensions, StyleSheet, View } from "react-native";
|
|
4
|
+
import { i18n } from "../../locale/i18nUtils";
|
|
5
|
+
import { Testing } from "../../types/enum";
|
|
6
|
+
import { infoStyles } from "../InfoBars";
|
|
7
|
+
import TextBold from "../text/TextBold";
|
|
8
|
+
import TextRegular from "../text/TextRegular";
|
|
9
|
+
import ActivityIcon from "./ActivityIcon";
|
|
10
|
+
import ActivityIntensity from "./ActivityIntensity";
|
|
11
|
+
/**
|
|
12
|
+
* Component for displaying a summary of the entered physical activity along with the effect it has on the insulin recommendation.
|
|
13
|
+
*/
|
|
14
|
+
export default class Activity extends React.Component {
|
|
15
|
+
/**
|
|
16
|
+
* Steps:
|
|
17
|
+
* 1. Unpack activity, activityType, activityReduction, and activityTitle from props.
|
|
18
|
+
* 2. Compute the reductionPercentage by multiplying the activityReduction prop by 100 and rounding to the nearest integer.
|
|
19
|
+
* 3. Generate and return the JSX element to display the following on the screen:
|
|
20
|
+
* - Print the activity duration.
|
|
21
|
+
* - Display the ActivityIcon that corresponds to the type of activity.
|
|
22
|
+
* - Display the ActivityIntensity for the activity.
|
|
23
|
+
* - Print the reductionPercentage.
|
|
24
|
+
* @returns JSX Element containing all the user's physical activity details
|
|
25
|
+
*/
|
|
26
|
+
render() {
|
|
27
|
+
const { activity, activityType, activityReduction, activityTitle } = this.props;
|
|
28
|
+
const reductionPercentage = ((activityReduction ?? 0) * 100).toFixed(0);
|
|
29
|
+
return (<View style={[infoStyles.container, activityStyles.botMargin]}>
|
|
30
|
+
<View style={infoStyles.margin}>
|
|
31
|
+
<View style={infoStyles.border}>
|
|
32
|
+
<View style={infoStyles.borderContainer}>
|
|
33
|
+
<View style={infoStyles.labelContainer}>
|
|
34
|
+
<TextBold style={infoStyles.label}>{i18n._(t `Activity`)}</TextBold>
|
|
35
|
+
</View>
|
|
36
|
+
<View style={infoStyles.valueUnitContainer}>
|
|
37
|
+
<View style={infoStyles.valueContainer}>
|
|
38
|
+
<TextBold style={infoStyles.value} testID={Testing.Id.ActivityTestIds.ActivityDuration}>
|
|
39
|
+
{activity.activityDuration}
|
|
40
|
+
</TextBold>
|
|
41
|
+
</View>
|
|
42
|
+
<View style={infoStyles.unitContainer}>
|
|
43
|
+
<TextRegular style={infoStyles.units}>{i18n._(t `min`)}</TextRegular>
|
|
44
|
+
</View>
|
|
45
|
+
</View>
|
|
46
|
+
</View>
|
|
47
|
+
<ActivityIcon activityType={activityType} activityTitle={activityTitle}/>
|
|
48
|
+
<ActivityIntensity activityIntensity={activity.activityIntensity}/>
|
|
49
|
+
<View style={[infoStyles.borderContainer, activityStyles.topMargin]}>
|
|
50
|
+
<TextRegular style={activityStyles.infoText}>
|
|
51
|
+
{i18n._(t `Based on the selected activity your insulin recommendation is reduced by:`)}
|
|
52
|
+
</TextRegular>
|
|
53
|
+
</View>
|
|
54
|
+
<View style={[infoStyles.borderContainer, activityStyles.verticalMargin]}>
|
|
55
|
+
<TextBold style={activityStyles.reductionPercentage} testID={Testing.Id.ActivityTestIds.ActivityReduction}>
|
|
56
|
+
{reductionPercentage}%
|
|
57
|
+
</TextBold>
|
|
58
|
+
</View>
|
|
59
|
+
</View>
|
|
60
|
+
</View>
|
|
61
|
+
</View>);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const { width } = Dimensions.get(`screen`);
|
|
65
|
+
const activityStyles = StyleSheet.create({
|
|
66
|
+
topMargin: {
|
|
67
|
+
marginTop: `2%`,
|
|
68
|
+
},
|
|
69
|
+
botMargin: {
|
|
70
|
+
marginBottom: `2%`,
|
|
71
|
+
},
|
|
72
|
+
verticalMargin: {
|
|
73
|
+
marginBottom: `2%`,
|
|
74
|
+
},
|
|
75
|
+
infoText: {
|
|
76
|
+
color: `rgba(160, 180, 240, 1)`,
|
|
77
|
+
fontSize: width / 24,
|
|
78
|
+
},
|
|
79
|
+
reductionPercentage: {
|
|
80
|
+
color: `white`,
|
|
81
|
+
marginTop: `2%`,
|
|
82
|
+
fontSize: width / 18,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
+
import { Activity } from "@hedia/types";
|
|
1
2
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
+
import { ImageURISource } from "react-native";
|
|
3
4
|
import { IActivityDisplayProps } from "../../types/types";
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
5
|
+
/** Mapping from ActivityEnums to corresponding image resource. */
|
|
6
|
+
export declare const ACTIVITY_ICONS: Record<Activity.Enums.ActivityEnum, ImageURISource>;
|
|
7
|
+
/** Component used to displat the user's physical activity type icon */
|
|
8
8
|
export default class ActivityIcon extends React.Component<IActivityDisplayProps> {
|
|
9
9
|
/**
|
|
10
10
|
* @returns The value from the ACTIVITY_ICONS constant that corresponds to the value of the activityType prop.
|
|
11
11
|
*/
|
|
12
|
-
getActivityIcon: (
|
|
12
|
+
getActivityIcon: () => ImageURISource;
|
|
13
13
|
/**
|
|
14
14
|
* Steps:
|
|
15
15
|
* 1. Unpack activityType and activityTitle from props.
|
|
16
16
|
* 2. Create a testID string by appending ‘_activity’ to the enum label corresponding to the activityType prop.
|
|
17
17
|
* @returns A JSX element including the following:
|
|
18
|
-
* 1. An
|
|
18
|
+
* 1. An image component with the generated testID displaying the icon from getActivityIcon().
|
|
19
19
|
* 2. The activityTitle if it is truthy or the string “Untitled Activity” otherwise
|
|
20
20
|
*/
|
|
21
21
|
render(): JSX.Element | null;
|
|
22
22
|
}
|
|
23
|
-
//# sourceMappingURL=ActivityIcon.d.ts.map
|