Skip to content

Commit

Permalink
fix: [IOAPPCOM-13] On iPhone 14 the CTA inside the message detail scr…
Browse files Browse the repository at this point in the history
…een does not respect the Safe Area (pagopa#4231)

* Add MessageDetailScreen safe area handling

* Bump react-native-device-info to 10.3.0

- Generate patch to match the previous one.
- Use the new getUniqueIdSync because now getUniqueId returns a promise.

Co-authored-by: Cristiano Tofani <[email protected]>
  • Loading branch information
shadowsheep1 and CrisTofani authored Dec 14, 2022
1 parent 09f11de commit a92bc54
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 29 deletions.
6 changes: 3 additions & 3 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ PODS:
- React-Core
- RNDateTimePicker (3.5.2):
- React-Core
- RNDeviceInfo (8.3.3):
- RNDeviceInfo (10.3.0):
- React-Core
- RNFS (2.18.0):
- React
Expand Down Expand Up @@ -916,7 +916,7 @@ SPEC CHECKSUMS:
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58
Protobuf: 3724efa50cb2846d7ccebc8691c574e85fd74471
RCT-Folly: 803a9cfd78114b2ec0f140cfa6fa2a6bafb2d685
RCT-Folly: b9d9fe1fc70114b751c076104e52f3b1b5e5a95a
RCTRequired: 85c60c4bde8241278be2c93420de4c65475a2151
RCTTypeSafety: 15990f289215eb0fc65c5eb6e2610faeeda8d5e1
React: 6cfa9367042a85f6235740420df017d51efc6494
Expand Down Expand Up @@ -969,7 +969,7 @@ SPEC CHECKSUMS:
RNCPicker: abc646b53a3d28ccfa3232c927a0ca52e0cf024d
RNCPushNotificationIOS: 61a7c72bd1ebad3568025957d001e0f0e7b32191
RNDateTimePicker: 7658208086d86d09e1627b5c34ba0cf237c60140
RNDeviceInfo: cc7de0772378f85d8f36ae439df20f05c590a651
RNDeviceInfo: 4701f0bf2a06b34654745053db0ce4cb0c53ada7
RNFS: 3ab21fa6c56d65566d1fb26c2228e2b6132e5e32
RNGestureHandler: e1ad51d31a580755079d5124d3ab66f0fcaa8311
RNI18n: e2f7e76389fcc6e84f2c8733ea89b92502351fd8
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"react-native-blob-util": "0.15.0",
"react-native-calendar-events": "2.2.0",
"react-native-config": "^1.4.5",
"react-native-device-info": "^8.3.3",
"react-native-device-info": "^10.3.0",
"react-native-exception-handler": "^2.10.8",
"react-native-fingerprint-scanner": "^6.0.0",
"react-native-flag-secure-android": "^1.0.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/node_modules/react-native-device-info/lib/typescript/internal/privateTypes.d.ts b/node_modules/react-native-device-info/lib/typescript/internal/privateTypes.d.ts
index 7ca9a81..9c274ab 100644
index f137e75..0f06706 100644
--- a/node_modules/react-native-device-info/lib/typescript/internal/privateTypes.d.ts
+++ b/node_modules/react-native-device-info/lib/typescript/internal/privateTypes.d.ts
@@ -79,12 +79,8 @@ interface ExposedNativeMethods {
@@ -78,12 +78,8 @@ interface ExposedNativeMethods {
getInstallReferrerSync: () => string;
getInstanceId: () => Promise<string>;
getInstanceIdSync: () => string;
Expand All @@ -16,10 +16,10 @@ index 7ca9a81..9c274ab 100644
getMaxMemorySync: () => number;
getPhoneNumber: () => Promise<string>;
diff --git a/node_modules/react-native-device-info/src/index.ts b/node_modules/react-native-device-info/src/index.ts
index b298fd9..c611f04 100644
index 4ec2138..2731038 100644
--- a/node_modules/react-native-device-info/src/index.ts
+++ b/node_modules/react-native-device-info/src/index.ts
@@ -58,13 +58,6 @@ export const [getAndroidId, getAndroidIdSync] = getSupportedPlatformInfoFunction
@@ -59,13 +59,6 @@ export const [getAndroidId, getAndroidIdSync] = getSupportedPlatformInfoFunction
defaultValue: 'unknown',
});

Expand All @@ -33,7 +33,7 @@ index b298fd9..c611f04 100644
export const [isCameraPresent, isCameraPresentSync] = getSupportedPlatformInfoFunctions({
supportedPlatforms: ['android', 'windows', 'web'],
getter: () => RNDeviceInfo.isCameraPresent(),
@@ -72,23 +65,6 @@ export const [isCameraPresent, isCameraPresentSync] = getSupportedPlatformInfoFu
@@ -73,24 +66,6 @@ export const [isCameraPresent, isCameraPresentSync] = getSupportedPlatformInfoFu
defaultValue: false,
});

Expand All @@ -54,10 +54,11 @@ index b298fd9..c611f04 100644
- }
- return 'unknown';
-}
-
export const getDeviceId = () =>
getSupportedPlatformInfoSync({
@@ -823,12 +799,8 @@ const deviceInfoModule: DeviceInfoModule = {
defaultValue: 'unknown',
@@ -895,12 +870,8 @@ const deviceInfoModule: DeviceInfoModule = {
getInstallReferrerSync,
getInstanceId,
getInstanceIdSync,
Expand All @@ -71,10 +72,10 @@ index b298fd9..c611f04 100644
getManufacturerSync,
getMaxMemory,
diff --git a/node_modules/react-native-device-info/src/internal/privateTypes.ts b/node_modules/react-native-device-info/src/internal/privateTypes.ts
index c345201..3032eb8 100644
index fb71735..0a9bb10 100644
--- a/node_modules/react-native-device-info/src/internal/privateTypes.ts
+++ b/node_modules/react-native-device-info/src/internal/privateTypes.ts
@@ -84,12 +84,8 @@ interface ExposedNativeMethods {
@@ -83,12 +83,8 @@ interface ExposedNativeMethods {
getInstallReferrerSync: () => string;
getInstanceId: () => Promise<string>;
getInstanceIdSync: () => string;
Expand All @@ -86,4 +87,4 @@ index c345201..3032eb8 100644
- getMacAddressSync: () => string;
getMaxMemory: () => Promise<number>;
getMaxMemorySync: () => number;
getPhoneNumber: () => Promise<string>;
getPhoneNumber: () => Promise<string>;
1 change: 0 additions & 1 deletion ts/components/messages/paginated/MessageDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ const MessageDetailsComponent = ({
messageDetails={messageDetails}
service={service}
serviceMetadata={serviceMetadata}
legacySafeArea={true}
/>
</>
</>
Expand Down
21 changes: 12 additions & 9 deletions ts/screens/messages/paginated/MessageDetailScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { pipe } from "fp-ts/lib/function";
import * as O from "fp-ts/lib/Option";
import { Text as NBText, View } from "native-base";
import React from "react";
import { ActivityIndicator, StyleSheet } from "react-native";
import { ActivityIndicator, SafeAreaView, StyleSheet } from "react-native";
import { connect } from "react-redux";
import { ServiceId } from "../../../../definitions/backend/ServiceId";
import { IOStyles } from "../../../components/core/variables/IOStyles";
import WorkunitGenericFailure from "../../../components/error/WorkunitGenericFailure";
import MessageDetailComponent from "../../../components/messages/paginated/MessageDetail";

Expand Down Expand Up @@ -133,14 +134,16 @@ const MessageDetailScreen = ({
contextualHelpMarkdown={contextualHelpMarkdown}
faqCategories={["messages_detail"]}
>
<MessageDetailComponent
hasPaidBadge={hasPaidBadge}
message={message}
messageDetails={details}
service={service}
serviceMetadata={maybeServiceMetadata}
onServiceLinkPress={onServiceLinkPressHandler}
/>
<SafeAreaView style={IOStyles.flex}>
<MessageDetailComponent
hasPaidBadge={hasPaidBadge}
message={message}
messageDetails={details}
service={service}
serviceMetadata={maybeServiceMetadata}
onServiceLinkPress={onServiceLinkPressHandler}
/>
</SafeAreaView>
</BaseScreenComponent>
),
() => renderLoadingState(),
Expand Down
2 changes: 1 addition & 1 deletion ts/utils/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
import DeviceInfo from "react-native-device-info";

export const getDeviceId = (): string => DeviceInfo.getUniqueId();
export const getDeviceId = (): string => DeviceInfo.getUniqueIdSync();

export const getFontScale = (): Promise<number> => DeviceInfo.getFontScale();

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13844,10 +13844,10 @@ react-native-config@^1.4.5:
resolved "https://registry.yarnpkg.com/react-native-config/-/react-native-config-1.4.5.tgz#6fe5895410b75e44fe4f4bf00caaf894a0981f3a"
integrity sha512-5oiAsoW88SOYDg/0cleJ2vJDqv98FJUbFQYEnH4sdMtEn3AAT3lb7BkTGW8HO/t3Vk9VOruwxUUnO4tzuxzCsw==

react-native-device-info@^8.3.3:
version "8.3.3"
resolved "https://registry.yarnpkg.com/react-native-device-info/-/react-native-device-info-8.3.3.tgz#05c1900602d174b58c6ac927d748a785d76d0898"
integrity sha512-l8/3MHq6O9PRWSrKwy63WvDCnt8IXOce86AEkJFVVtKR9cAGLLaFyXUGyqIc5T/kpCyOqofOattVDjZGUn/zAQ==
react-native-device-info@^10.3.0:
version "10.3.0"
resolved "https://registry.yarnpkg.com/react-native-device-info/-/react-native-device-info-10.3.0.tgz#6bab64d84d3415dd00cc446c73ec5e2e61fddbe7"
integrity sha512-/ziZN1sA1REbJTv5mQZ4tXggcTvSbct+u5kCaze8BmN//lbxcTvWsU6NQd4IihLt89VkbX+14IGc9sVApSxd/w==

[email protected]:
version "2.5.1"
Expand Down

0 comments on commit a92bc54

Please sign in to comment.