@hedia/recommendation-screen 2.1.51 → 2.1.52-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.
@@ -83,6 +83,9 @@ export declare const stylesModal: {
83
83
  modalStyle: {
84
84
  margin: number;
85
85
  };
86
+ scrollViewContainer: {
87
+ flexGrow: number;
88
+ };
86
89
  container: {
87
90
  flex: number;
88
91
  backgroundColor: string;
@@ -1,6 +1,6 @@
1
1
  import { t } from "@lingui/macro";
2
2
  import * as React from "react";
3
- import { Dimensions, StyleSheet, TouchableOpacity, View } from "react-native";
3
+ import { Dimensions, ScrollView, StyleSheet, TouchableOpacity, View } from "react-native";
4
4
  import ReactNativeModal from "react-native-modal";
5
5
  import { i18n } from "../locale/i18nUtils";
6
6
  import { Testing } from "../types/enum";
@@ -98,7 +98,7 @@ export default class RecommendationModal extends React.Component {
98
98
  secondPage = () => {
99
99
  const { attentionMessage, suggestedCarbohydrates } = this.props;
100
100
  const willRecommendCarbs = suggestedCarbohydrates !== null && suggestedCarbohydrates > 0;
101
- return (<React.Fragment>
101
+ return (<View style={{ flex: 1 }}>
102
102
  <View style={stylesModal.container}>
103
103
  <View style={stylesModal.titleContainer}>
104
104
  <Text style={stylesModal.textTittleMessage}>{i18n._(t `Attention`)}</Text>
@@ -111,7 +111,7 @@ export default class RecommendationModal extends React.Component {
111
111
  <Text style={stylesModal.buttonText}>{i18n._(t `OK`)}</Text>
112
112
  </TouchableOpacity>
113
113
  </View>)}
114
- </React.Fragment>);
114
+ </View>);
115
115
  };
116
116
  /**
117
117
  * @returns JSX element for displaying the “first” page of the recommendation modal.
@@ -129,8 +129,10 @@ export default class RecommendationModal extends React.Component {
129
129
  render() {
130
130
  const { isVisible } = this.props;
131
131
  const { firstPageVisible } = this.state;
132
- return (<ReactNativeModal isVisible={isVisible} style={stylesModal.modalStyle}>
133
- {firstPageVisible ? this.firstPage() : this.secondPage()}
132
+ return (<ReactNativeModal isVisible={isVisible} style={stylesModal.modalStyle} backdropColor={colors.semiDarkBlue} backdropOpacity={1}>
133
+ <ScrollView contentContainerStyle={stylesModal.scrollViewContainer}>
134
+ {firstPageVisible ? this.firstPage() : this.secondPage()}
135
+ </ScrollView>
134
136
  </ReactNativeModal>);
135
137
  }
136
138
  }
@@ -142,6 +144,9 @@ const buttonBorderWidth = height / 500;
142
144
  /** @internal */
143
145
  export const stylesModal = StyleSheet.create({
144
146
  modalStyle: { margin: 0 },
147
+ scrollViewContainer: {
148
+ flexGrow: 1,
149
+ },
145
150
  container: {
146
151
  flex: 4,
147
152
  backgroundColor: colors.semiDarkBlue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedia/recommendation-screen",
3
- "version": "2.1.51",
3
+ "version": "2.1.52-alpha.0",
4
4
  "description": "Hedia Recommendation Screen for Bolus and Carbohydrates",
5
5
  "main": "dist/index.js",
6
6
  "files": [