Skip to content

Commit 090efa4

Browse files
committed
isIPhoneXFamily function is added for backward compatibility
1 parent e652cce commit 090efa4

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -122,22 +122,23 @@ import { numberFormat } from "@freakycoder/react-native-helpers";
122122
123123
## DeviceInfo Props
124124
125-
| Property | Type | Description |
126-
| ------------------- | :-----------: | -------------------------------------------------------------------------- |
127-
| hasNotch | function | returns if the device has notch or not |
128-
| isIPhoneNotchFamily | function | returns if it the iPhone has in the notch family (iPhone X, 11, 12 Series) |
129-
| isIPhoneSE | function(dim) | returns if device is iPhone SE or not |
130-
| isIPhoneX | function(dim) | returns if device is iPhone X or not |
131-
| isIPhoneXr | function(dim) | returns if device is iPhone Xr or not |
132-
| isIPhoneXs | function(dim) | returns if device is iPhone Xs or not |
133-
| isIPhoneXsMax | function(dim) | returns if device is iPhone Xs Max or not |
134-
| isIPhone11 | function(dim) | returns if device is iPhone 11 or not |
135-
| isIPhone11Pro | function(dim) | returns if device is iPhone 11 Pro or not |
136-
| isIPhone11ProMax | function(dim) | returns if device is iPhone 11 Pro Max or not |
137-
| isIPhone12 | function(dim) | returns if device is iPhone 12 or not |
138-
| isIPhone12Pro | function(dim) | returns if device is iPhone 12 Pro or not |
139-
| isIPhone12ProMax | function(dim) | returns if device is iPhone 12 Pro Max or not |
140-
| isIPhone12Mini | function(dim) | returns if device is iPhone 12 Mini or not |
125+
| Property | Type | Description |
126+
| ------------------- | :-----------: | --------------------------------------------------------------------------------------------------- |
127+
| hasNotch | function | returns if the device has notch or not |
128+
| isIPhoneNotchFamily | function | returns if it the iPhone has in the notch family (iPhone X, 11, 12 Series) |
129+
| isIPhoneXFamily | function | returns if it the iPhone has in the notch family (iPhone X, 11, 12 Series) (Backward compatibility) |
130+
| isIPhoneSE | function(dim) | returns if device is iPhone SE or not |
131+
| isIPhoneX | function(dim) | returns if device is iPhone X or not |
132+
| isIPhoneXr | function(dim) | returns if device is iPhone Xr or not |
133+
| isIPhoneXs | function(dim) | returns if device is iPhone Xs or not |
134+
| isIPhoneXsMax | function(dim) | returns if device is iPhone Xs Max or not |
135+
| isIPhone11 | function(dim) | returns if device is iPhone 11 or not |
136+
| isIPhone11Pro | function(dim) | returns if device is iPhone 11 Pro or not |
137+
| isIPhone11ProMax | function(dim) | returns if device is iPhone 11 Pro Max or not |
138+
| isIPhone12 | function(dim) | returns if device is iPhone 12 or not |
139+
| isIPhone12Pro | function(dim) | returns if device is iPhone 12 Pro or not |
140+
| isIPhone12ProMax | function(dim) | returns if device is iPhone 12 Pro Max or not |
141+
| isIPhone12Mini | function(dim) | returns if device is iPhone 12 Mini or not |
141142
142143
## Normalize Text Props
143144

lib/helpers/notch/Notch.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ const isIPhoneNotchFamily = () => {
3737
return detection();
3838
};
3939

40+
const isIPhoneXFamily = () => {
41+
return detection();
42+
};
43+
4044
const hasNotch = () => {
4145
return detection();
4246
};
@@ -89,6 +93,7 @@ export {
8993
getStatusBarHeight,
9094
hasNotch,
9195
isIPhoneNotchFamily,
96+
isIPhoneXFamily,
9297
isIPhoneSE,
9398
isIPhoneX,
9499
isIPhoneXr,

lib/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414

1515
import {
1616
isIPhoneNotchFamily,
17+
isIPhoneXFamily,
1718
hasNotch,
1819
isIPhoneX,
1920
isIPhoneXr,
@@ -48,6 +49,7 @@ export {
4849
getStatusBarHeight,
4950
hasNotch,
5051
isIPhoneNotchFamily,
52+
isIPhoneXFamily,
5153
isIPhoneSE,
5254
isIPhoneX,
5355
isIPhoneXr,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@freakycoder/react-native-helpers",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "All helpers in one; iPhone series support, dimensions helper, hasNotch helper, normalize text helper and text helpers for React Native with very easy use",
55
"keywords": [
66
"ios",

0 commit comments

Comments
 (0)