@hedia/recommendation-screen 2.2.0-alpha.22 → 2.2.0-alpha.24

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.
@@ -16,15 +16,13 @@ export interface IForecast {
16
16
  forecastedGlucose: number;
17
17
  /** Forecasted time value to display. */
18
18
  forecastTime: string;
19
- /** Latest CGM reading. */
20
- latestCGMReading: ICGMReading;
21
19
  }
22
20
  /** Represents CGM data */
23
21
  export interface ICGMReading {
24
22
  /** Latest CGM reading time value. */
25
23
  CGMTime: string;
26
24
  /** Latest CGM reading value to display. */
27
- glucoseMmoll: number;
25
+ latestCGMReading: number;
28
26
  }
29
27
  export interface IRecommendationProps {
30
28
  /** The blood glucose measurement unit that the user prefers. */
@@ -47,6 +45,8 @@ export interface IRecommendationProps {
47
45
  activityDisplayProps: IActivityDisplayProps | null;
48
46
  /** Forecast data received from the app */
49
47
  forecast: IForecast | null;
48
+ /** CGM data received from the app */
49
+ cgm: ICGMReading | null;
50
50
  /**
51
51
  * Callback function taking a single boolean argument and returning nothing.
52
52
  * To be called when the user decides on a presented carbohydrate recommendation.
@@ -460,7 +460,7 @@ export default class RecommendationScreen extends React.Component {
460
460
  const carbRecommendation = carbRecommendationProp !== null ? Math.round(carbRecommendationProp) : null;
461
461
  const recommendedCarbs = enteredCarbs ?? carbRecommendation;
462
462
  const isModalOpen = showExitModal || showLimitationMessage || showTimeoutModal;
463
- const { activityDisplayProps, bloodGlucoseUnit, bloodKetoneUnit, calculatorParams, currentBKL, injectionMethod, language, onRecentInsulinYes, forecast, } = this.props;
463
+ const { activityDisplayProps, bloodGlucoseUnit, bloodKetoneUnit, calculatorParams, cgm, currentBKL, injectionMethod, language, onRecentInsulinYes, forecast, } = this.props;
464
464
  const { activity, currentBGL, carbohydrates: providedCarbs } = calculatorParams;
465
465
  const displayedBGL = currentBGL ? Utils.displayedBGLValue(currentBGL, bloodGlucoseUnit) : null;
466
466
  const displayedBKL = currentBKL !== null && bloodKetoneUnit ? Utils.displayedBKLValue(currentBKL, bloodKetoneUnit) : null;
@@ -474,7 +474,7 @@ export default class RecommendationScreen extends React.Component {
474
474
  }}>
475
475
  <Header exitCallback={this.onExit}/>
476
476
  <InfoBars label={i18n._(t `Active Insulin`)} value={activeInsulin ? `${activeInsulin.toFixed(1)}` : null} unit={i18n._(t `units`)} showNullAsDash={false} testID={{ unitID: ActiveInsulinUnitTestID, valueID: ActiveInsulinValueTestID }}/>
477
- {forecast ? (<ForecastInfoBar label={i18n._(t `Forecasted Glucose`)} forecast={forecast} unit={bloodGlucoseUnit} testID={{ unitID: FGUnitTestID, valueID: FGValueTestID }}/>) : (<InfoBars label={i18n._(t `Blood Glucose Level`)} value={displayedBGL} unit={bloodGlucoseUnit} showNullAsDash={true} testID={{ unitID: BGUnitTestID, valueID: BGValueTestID }}/>)}
477
+ {forecast && cgm ? (<ForecastInfoBar label={i18n._(t `Forecasted Glucose`)} forecast={forecast} cgm={cgm} unit={bloodGlucoseUnit} testID={{ unitID: FGUnitTestID, valueID: FGValueTestID }}/>) : (<InfoBars label={i18n._(t `Blood Glucose Level`)} value={displayedBGL} unit={bloodGlucoseUnit} showNullAsDash={true} testID={{ unitID: BGUnitTestID, valueID: BGValueTestID }}/>)}
478
478
  <InfoBars label={i18n._(t `Blood Ketone Level`)} value={displayedBKL} unit={bloodKetoneUnit} showNullAsDash={true} testID={{ unitID: BKUnitTestID, valueID: BKValueTestID }}/>
479
479
  <View style={containerStyles.calcContainer}>
480
480
  <View style={containerStyles.calcMargin}>
@@ -1,12 +1,14 @@
1
1
  /// <reference types="react" />
2
2
  import { BloodGlucoseUnit } from "@hedia/types";
3
- import { IForecast } from "../RecommendationScreen";
3
+ import { ICGMReading, IForecast } from "../RecommendationScreen";
4
4
  import { Testing } from "../types/enum";
5
5
  export interface IProps {
6
6
  /** The display label that describes the value to the user. */
7
7
  label: string;
8
- /** The value to display. */
8
+ /** The forecast value to display. */
9
9
  forecast: IForecast;
10
+ /** The cgm value to display. */
11
+ cgm: ICGMReading;
10
12
  /** Unit label to print after the value. */
11
13
  unit: BloodGlucoseUnit;
12
14
  /** optional object that contains as properties a valueID and a unitID */
@@ -9,7 +9,7 @@ import TextBold from "./text/TextBold";
9
9
  import TextRegular from "./text/TextRegular";
10
10
  /** A standard panel to display some data that the user entered. */
11
11
  const ForecastInfoBar = (props) => {
12
- const { testID, label, unit, forecast } = props;
12
+ const { testID, label, unit, cgm, forecast } = props;
13
13
  /**
14
14
  * Determine the unit string to be displayed in the infobar.
15
15
  *
@@ -52,7 +52,7 @@ const ForecastInfoBar = (props) => {
52
52
 
53
53
  <View style={row}>
54
54
  <TextRegular style={infoStyles.currentCGM}>
55
- {i18n._(t `Current glucose: ${forecast.latestCGMReading.glucoseMmoll} ${displayUnit(unit)}`)}
55
+ {i18n._(t `Current glucose: ${cgm.latestCGMReading} ${displayUnit(unit)}`)}
56
56
  </TextRegular>
57
57
  </View>
58
58
  </View>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedia/recommendation-screen",
3
- "version": "2.2.0-alpha.22",
3
+ "version": "2.2.0-alpha.24",
4
4
  "description": "Hedia Recommendation Screen for Bolus and Carbohydrates",
5
5
  "main": "dist/index.js",
6
6
  "files": [