@olea-bps/base 1.0.3 → 1.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olea-bps/base",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "OLEA base library",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -12,7 +12,12 @@
12
12
  * limitations under the License.
13
13
  */
14
14
 
15
- import { useState, useEffect, useMemo, useCallback } from 'react';
15
+ import {
16
+ useState,
17
+ useEffect,
18
+ useMemo,
19
+ useCallback,
20
+ } from 'react';
16
21
  import {
17
22
  AppState,
18
23
  SafeAreaView,
@@ -20,9 +25,9 @@ import {
20
25
  ScrollView,
21
26
  StyleSheet,
22
27
  Alert,
23
- useWindowDimensions,
24
28
  RefreshControl,
25
29
  Image,
30
+ useWindowDimensions,
26
31
  } from 'react-native';
27
32
 
28
33
  import { useTheme, Text, Button } from 'react-native-paper';
@@ -40,6 +45,7 @@ import componentStyles from './styles';
40
45
  */
41
46
  export default function PublicTransportTicketView() {
42
47
  const componentName = PublicTransportTicketView.name;
48
+ const { height: windowHeight } = useWindowDimensions();
43
49
  // Get theme from theme context
44
50
  const theme = useTheme();
45
51
  const { themeStyles } = theme;
@@ -48,7 +54,6 @@ export default function PublicTransportTicketView() {
48
54
 
49
55
  const [user, login] = useUser();
50
56
  const [ticketBarcode, ticketOwner, ticketValidFrom, ticketValidTo, refreshTicket] = usePublicTransportTicket();
51
- const { width } = useWindowDimensions();
52
57
 
53
58
  const [refreshingTicketScrollView, setRefreshingTicketScrollView] = useState(false);
54
59
 
@@ -124,7 +129,15 @@ export default function PublicTransportTicketView() {
124
129
  ? <>
125
130
  <View>
126
131
  <Image
132
+ style={{
133
+ // Der Barcode soll die Hälfte der Bildschirmhöhe ausfüllen.
134
+ height: windowHeight / 2,
135
+ width: '100%',
136
+ }}
127
137
  source={{ uri: ticketBarcode }}
138
+ // Barcode soll auf die passende Größe angepasst und zentriert werden.
139
+ // Beim anpassen, wird das Seitenverhältnis beibehalten.
140
+ resizeMode='center'
128
141
  />
129
142
  </View>
130
143
  <Text>