Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.x #14

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

3.x #14

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
node_modules
node_modules
dist/
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,31 @@ $ npm install --save react-native-status-bar-height
$ yarn add react-native-status-bar-height
```

## Usage getStatusBarHeight(skipAndroid: boolean = false)
## Usage of withStatusBarHeight HoC

```js
If you application support both orientations (portrait and landscape), it's heightly recommend to use
HoC to detect orientation;

```typescript
import { Text } from 'react-native';
import { withStatusBarHeight } from 'react-native-status-bar-height';

type Props = WithStatusBarProps & {};

export class MySuperScreenComponent extends React.PureComponent {
render() {
return (
<Text>{this.props.statusBarHeight}</Text>
)
}
}

export const MySuperScreen = withStatusBarHeight(MySuperScreenComponent, false);
```

## Direct usage getStatusBarHeight(skipAndroid: boolean = false)

```typescript
import { getStatusBarHeight } from 'react-native-status-bar-height';

// 44 - on iPhoneX
Expand Down
8 changes: 8 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions dist/withStatusBar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/withStatusBar.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

declare const global: any;
Loading