Skip to content

Commit 27d2c48

Browse files
committed
Documentation is updated
1 parent d1ed00a commit 27d2c48

File tree

3 files changed

+66
-19
lines changed

3 files changed

+66
-19
lines changed

README.md

Lines changed: 65 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Battle Tested ✅](https://img.shields.io/badge/-Battle--Tested%20%E2%9C%85-03666e?style=for-the-badge)](https://github.com/WrathChaos/react-native-helpers)
44

5-
[![Easy to use & awesome helpers for React Native.](https://img.shields.io/badge/-Easy%20to%20use%20%26%20awesome%20helpers%20for%20React%20Native.-lightgrey?style=for-the-badge)](https://github.com/WrathChaos/react-native-helpers)
5+
[![All helpers in one; iPhone series support, dimensions helper, hasNotch helper, normalize text helper and text helpers for React Native with very easy use](https://img.shields.io/badge/-All%20helpers%20in%20one%3B%20iPhone%20series%20support%2C%20dimensions%20helper%2C%20hasNotch%20helper%2C%20normalize%20text%20helper%20and%20text%20helpers%20for%20React%20Native%20with%20very%20easy%20use-orange?style=for-the-badge)](https://github.com/WrathChaos/react-native-helpers)
66

77
[![npm version](https://img.shields.io/npm/v/@freakycoder/react-native-helpers.svg?style=for-the-badge)](https://www.npmjs.com/package/@freakycoder/react-native-helpers)
88
[![npm](https://img.shields.io/npm/dt/@freakycoder/react-native-helpers.svg?style=for-the-badge)](https://www.npmjs.com/package/@freakycoder/react-native-helpers)
@@ -20,34 +20,29 @@ Add the dependency:
2020

2121
### React Native
2222

23-
```ruby
23+
```bash
2424
npm i @freakycoder/react-native-helpers
2525
```
2626

2727
### Expo Version
2828

29-
```ruby
29+
```bash
3030
"@freakycoder/react-native-helpers": "WrathChaos/@freakycoder/react-native-helpers#expo"
3131
```
3232

3333
## Peer Dependencies
3434

35-
###### IMPORTANT! You need install them.
36-
37-
```
38-
"react": ">= 16.x.x",
39-
"react-native": ">= 0.55.x",
40-
```
35+
<b><i>Zero Dependency</i></b>
4136

4237
## DeviceInfo Usage
4338

44-
```js
39+
```jsx
4540
import {
4641
Screen,
4742
ScreenWidth,
4843
ScreenHeight,
4944
isIOS,
50-
isAndroid
45+
isAndroid,
5146
} from "@freakycoder/react-native-helpers";
5247

5348
<View>
@@ -57,17 +52,21 @@ import {
5752
</View>;
5853
```
5954

60-
## Notch (iPhoneX & StatusBar) Usage
55+
## Notch (iPhoneX & iPhone 11 & iPhone 12 & iPhone SE & StatusBar) Usage
6156

6257
```js
6358
import {
64-
isIPhoneXFamily,
59+
isIPhoneNotchFamily,
60+
isIPhone11,
61+
isIPhone12,
62+
isIPhone12Mini,
63+
isIPhone12ProMax,
6564
hasNotch,
6665
isIPhoneX,
6766
isIPhoneXr,
6867
isIPhoneXs,
6968
isIPhoneXsMax,
70-
getStatusBarHeight
69+
getStatusBarHeight,
7170
} from "@freakycoder/react-native-helpers";
7271

7372
<View>
@@ -109,13 +108,61 @@ import { numberFormat } from "@freakycoder/react-native-helpers";
109108
</Text>// Output: £ 50.319.341
110109
```
111110
112-
## Credits
113-
114-
<b>NormalizeText</b> is completely coming from <b>react-native-elements</b>. All credits goes to <b>@xiaoneng</b> and RN Elements team. Thank you so much guys.
111+
# Configuration - Props
112+
113+
## DeviceInfo Props
114+
115+
| Property | Type | Description |
116+
| --------------- | :-----: | ------------------------------------------------------------------------------------------ |
117+
| isIOS | boolean | returns if it is an iOS device or not |
118+
| isAndroid | boolean | returns if it is an Android device or not |
119+
| ScreenWidth | number | get the device's screen width |
120+
| ScreenHeight | number | get the device's screen height |
121+
| ScreenScale | number | get the device's screen scale ratio |
122+
| ScreenFontScale | number | get the device's screen font scale ratio (depends on the user's device font scale setting) |
123+
| WindowWidth | number | get the device's window width |
124+
| WindowHeight | number | get the device's window height |
125+
| WindowScale | number | get the device's window scale ratio |
126+
| WindowFontScale | number | get the device's window font scale ratio (depends on the user's device font scale setting) |
127+
| PlatformVersion | number | returns the platform version |
128+
129+
## DeviceInfo Props
130+
131+
| Property | Type | Description |
132+
| ------------------- | :-----------: | -------------------------------------------------------------------------- |
133+
| hasNotch | function | returns if the device has notch or not |
134+
| isIPhoneNotchFamily | function | returns if it the iPhone has in the notch family (iPhone X, 11, 12 Series) |
135+
| isIPhoneSE | function(dim) | returns if device is iPhone SE or not |
136+
| isIPhoneX | function(dim) | returns if device is iPhone X or not |
137+
| isIPhoneXr | function(dim) | returns if device is iPhone Xr or not |
138+
| isIPhoneXs | function(dim) | returns if device is iPhone Xs or not |
139+
| isIPhoneXsMax | function(dim) | returns if device is iPhone Xs Max or not |
140+
| isIPhone11 | function(dim) | returns if device is iPhone 11 or not |
141+
| isIPhone11Pro | function(dim) | returns if device is iPhone 11 Pro or not |
142+
| isIPhone11ProMax | function(dim) | returns if device is iPhone 11 Pro Max or not |
143+
| isIPhone12 | function(dim) | returns if device is iPhone 12 or not |
144+
| isIPhone12Pro | function(dim) | returns if device is iPhone 12 Pro or not |
145+
| isIPhone12ProMax | function(dim) | returns if device is iPhone 12 Pro Max or not |
146+
| isIPhone12Mini | function(dim) | returns if device is iPhone 12 Mini or not |
147+
148+
## Normalize Text Props
149+
150+
| Property | Type | Description |
151+
| --------- | :--------------: | -------------------------------- |
152+
| normalize | function(number) | returns the normalized font size |
153+
154+
## Custom Text Props
155+
156+
| Property | Type | Description |
157+
| ------------ | :------------------------------: | ----------------------------------------------------------- |
158+
| numberFormat | function(value, locale, options) | returns the number formatted font with its given parameters |
115159
116160
### Roadmap
117161
118-
- [x] LICENSE
162+
- [x] ~~LICENSE~~
163+
- [x] ~~Typescript~~
164+
- [x] ~~iPhone Series Support~~
165+
- [ ] More custom text helpers
119166
- [ ] Write an article about the lib on Medium
120167
121168
## Author

assets/logo.png

3.14 KB
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@freakycoder/react-native-helpers",
33
"version": "1.0.0",
4-
"description": "Easy to use & awesome helpers for React Native.",
4+
"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",
77
"width",

0 commit comments

Comments
 (0)