1.1.1 • Published 6 years ago

react-native-devices v1.1.1

Weekly downloads
7
License
MIT
Repository
github
Last release
6 years ago

react-native-devices

Usage

yarn add react-native-devices
import { devices} from 'react-native-devices'

IF_ (function) returns a or b:

/* Check if iPhoneX, if not - check if iPhone Plus, else others */

<View
  style={{
    ...devices.IF_X(
      {
        top: 100
      },
      {
        ...devices.IF_PLUS_6_6S_7_8({
          top: 50
        }, {
          top: 25
        })
      }
    )
  }}
>

IS_ (bool)

const top = device.IS_X ? 100 : 0

Helpers

Functionsargumentscomments
IF_Xif, if not
IF_PLUS_6_6S_7_8if, if not
IF_6_6S_7_8if, if not
IF_5_5S_5C_SEif, if not
IF_4_4Sif, if not
IF_2G_3G_3GSif, if not
IF_TABLETif, if not
IF_IPADif, if not(Mini, 1st & 2nd Generation)
IF_IPAD_MINIif, if not(2nd, 3rd & 4th Generation)
IF_IPAD_AIRif, if not(1st & 2nd Generation)
IF_IPAD_RETINAif, if not(3rd & 4th Generation)
IF_IPAD_PROif, if not(Generic 9.7 / 10.5 / 12.9)
IF_IPAD_PRO_9_INCHif, if not(9.7 inch)
IF_IPAD_PRO_10_INCHif, if not(10.5 inch)
IF_IPAD_PRO_12_INCHif, if not(12.9 inch)
Bools
IS_X
IS_PLUS_6_6S_7_8
IS_6_6S_7_8
IS_5_5S_5C_SE
IS_4_4S
IS_2G_3G_3GS
IS_TABLET
IS_IPAD
IS_IPAD_MINI
IS_IPAD_AIR
IS_IPAD_RETINA
IS_IPAD_PRO
IS_IPAD_PRO_9_INCH
IS_IPAD_PRO_10_INCH
IS_IPAD_PRO_12_INCH

Why?

There are others out there (like the syntax inspiration for RND - react-native-iphone-x-helper). Difference is this one gives you more stuff.

1.1.1

6 years ago

1.1.0

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago