Skip to content

Commit

Permalink
isIPhoneXFamily function is added for backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathChaos committed Nov 5, 2020
1 parent e652cce commit 090efa4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,22 +122,23 @@ import { numberFormat } from "@freakycoder/react-native-helpers";
## DeviceInfo Props
| Property | Type | Description |
| ------------------- | :-----------: | -------------------------------------------------------------------------- |
| hasNotch | function | returns if the device has notch or not |
| isIPhoneNotchFamily | function | returns if it the iPhone has in the notch family (iPhone X, 11, 12 Series) |
| isIPhoneSE | function(dim) | returns if device is iPhone SE or not |
| isIPhoneX | function(dim) | returns if device is iPhone X or not |
| isIPhoneXr | function(dim) | returns if device is iPhone Xr or not |
| isIPhoneXs | function(dim) | returns if device is iPhone Xs or not |
| isIPhoneXsMax | function(dim) | returns if device is iPhone Xs Max or not |
| isIPhone11 | function(dim) | returns if device is iPhone 11 or not |
| isIPhone11Pro | function(dim) | returns if device is iPhone 11 Pro or not |
| isIPhone11ProMax | function(dim) | returns if device is iPhone 11 Pro Max or not |
| isIPhone12 | function(dim) | returns if device is iPhone 12 or not |
| isIPhone12Pro | function(dim) | returns if device is iPhone 12 Pro or not |
| isIPhone12ProMax | function(dim) | returns if device is iPhone 12 Pro Max or not |
| isIPhone12Mini | function(dim) | returns if device is iPhone 12 Mini or not |
| Property | Type | Description |
| ------------------- | :-----------: | --------------------------------------------------------------------------------------------------- |
| hasNotch | function | returns if the device has notch or not |
| isIPhoneNotchFamily | function | returns if it the iPhone has in the notch family (iPhone X, 11, 12 Series) |
| isIPhoneXFamily | function | returns if it the iPhone has in the notch family (iPhone X, 11, 12 Series) (Backward compatibility) |
| isIPhoneSE | function(dim) | returns if device is iPhone SE or not |
| isIPhoneX | function(dim) | returns if device is iPhone X or not |
| isIPhoneXr | function(dim) | returns if device is iPhone Xr or not |
| isIPhoneXs | function(dim) | returns if device is iPhone Xs or not |
| isIPhoneXsMax | function(dim) | returns if device is iPhone Xs Max or not |
| isIPhone11 | function(dim) | returns if device is iPhone 11 or not |
| isIPhone11Pro | function(dim) | returns if device is iPhone 11 Pro or not |
| isIPhone11ProMax | function(dim) | returns if device is iPhone 11 Pro Max or not |
| isIPhone12 | function(dim) | returns if device is iPhone 12 or not |
| isIPhone12Pro | function(dim) | returns if device is iPhone 12 Pro or not |
| isIPhone12ProMax | function(dim) | returns if device is iPhone 12 Pro Max or not |
| isIPhone12Mini | function(dim) | returns if device is iPhone 12 Mini or not |
## Normalize Text Props
Expand Down
5 changes: 5 additions & 0 deletions lib/helpers/notch/Notch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ const isIPhoneNotchFamily = () => {
return detection();
};

const isIPhoneXFamily = () => {
return detection();
};

const hasNotch = () => {
return detection();
};
Expand Down Expand Up @@ -89,6 +93,7 @@ export {
getStatusBarHeight,
hasNotch,
isIPhoneNotchFamily,
isIPhoneXFamily,
isIPhoneSE,
isIPhoneX,
isIPhoneXr,
Expand Down
2 changes: 2 additions & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {

import {
isIPhoneNotchFamily,
isIPhoneXFamily,
hasNotch,
isIPhoneX,
isIPhoneXr,
Expand Down Expand Up @@ -48,6 +49,7 @@ export {
getStatusBarHeight,
hasNotch,
isIPhoneNotchFamily,
isIPhoneXFamily,
isIPhoneSE,
isIPhoneX,
isIPhoneXr,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@freakycoder/react-native-helpers",
"version": "1.0.0",
"version": "1.0.1",
"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",
"keywords": [
"ios",
Expand Down

0 comments on commit 090efa4

Please sign in to comment.