Skip to content

Commit df13e69

Browse files
authored
Merge pull request #9 from JairajJangle/beta
Beta
2 parents 2402ef9 + 52bb5d0 commit df13e69

File tree

5 files changed

+39
-14
lines changed

5 files changed

+39
-14
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [1.2.2-beta.1](https://github.com/JairajJangle/react-native-navigation-mode/compare/v1.2.1...v1.2.2-beta.1) (2025-09-01)
2+
3+
4+
### Bug Fixes
5+
6+
* potential fix for missing import suggestion ([2fad6a4](https://github.com/JairajJangle/react-native-navigation-mode/commit/2fad6a427df4cdbf3b14328f7d343c7de5478085))
7+
18
## [1.2.1](https://github.com/JairajJangle/react-native-navigation-mode/compare/v1.2.0...v1.2.1) (2025-08-02)
29

310

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,17 @@ console.log('Navigation bar height:', height); // number (dp)
204204

205205
#### `NavigationModeInfo`
206206

207-
| Property | Type | Description |
208-
| ------------------- | ----------------------------------------------------------- | --------------------------------------------------------- |
209-
| type | `'3_button'` or `'2_button'` or `'gesture'` or `'unknown'` | 4 possible Android navigation modes that can be detected. |
210-
| isGestureNavigation | `boolean` | Whether gesture navigation is active. |
211-
| interactionMode | `number` or `undefined` | See [Interaction Mode Values](#interaction-mode-values) |
212-
| navigationBarHeight | `number` or `undefined` | Navigation bar height in density-independent pixels (dp). |
207+
| Property | Type | Description |
208+
| ------------------- | ----------------------------------------------------------- | ------------------------------------------------------------ |
209+
| type | `'3_button'` or `'2_button'` or `'gesture'` or `'unknown'` | 4 possible Android navigation modes that can be detected |
210+
| isGestureNavigation | `boolean` | Whether gesture navigation is active |
211+
| interactionMode | `number` or `undefined` | See [Interaction Mode Values](#interaction-mode-values) |
212+
| navigationBarHeight | `number` | Navigation bar height in density-independent pixels (dp). 0 for iOS |
213213

214214
### Interaction Mode Values
215215

216+
Only available for Android 10 (API 29) or newer.
217+
216218
| Android Mode | Type | Description |
217219
| ------------ | ---------- | --------------------------------------------------- |
218220
| 0 | `3_button` | Traditional Android navigation (Back, Home, Recent) |

package.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{
22
"name": "react-native-navigation-mode",
3-
"version": "1.2.1",
3+
"version": "1.2.2-beta.1",
44
"description": "Detect Android navigation mode (3-button, 2-button, or gesture)",
55
"main": "./lib/module/index.js",
6+
"react-native": "./lib/module/index.js",
7+
"source": "src/index.tsx",
68
"types": "./lib/typescript/src/index.d.ts",
79
"files": [
810
"src",
@@ -176,5 +178,19 @@
176178
"languages": "kotlin-objc",
177179
"type": "turbo-module",
178180
"version": "0.50.3"
179-
}
181+
},
182+
"funding": [
183+
{
184+
"type": "individual",
185+
"url": "https://www.paypal.com/paypalme/jairajjangle001/usd"
186+
},
187+
{
188+
"type": "individual",
189+
"url": "https://liberapay.com/FutureJJ/donate"
190+
},
191+
{
192+
"type": "individual",
193+
"url": "https://ko-fi.com/futurejj"
194+
}
195+
]
180196
}

src/NativeNavigationMode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export interface NavigationModeInfo {
55
type: '3_button' | '2_button' | 'gesture' | 'unknown';
66
isGestureNavigation: boolean;
77
interactionMode?: number;
8-
navigationBarHeight?: number;
8+
navigationBarHeight: number;
99
}
1010

1111
export interface Spec extends TurboModule {

src/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Platform } from 'react-native';
2-
import React from 'react';
2+
import { useEffect, useState } from 'react';
33
import NavigationModeModule, {
44
type NavigationModeInfo,
55
} from './NativeNavigationMode';
@@ -60,11 +60,11 @@ export function getNavigationBarHeight(): Promise<number> {
6060
*/
6161
export function useNavigationMode() {
6262
const [navigationMode, setNavigationMode] =
63-
React.useState<NavigationModeInfo | null>(null);
64-
const [loading, setLoading] = React.useState(true);
65-
const [error, setError] = React.useState<Error | null>(null);
63+
useState<NavigationModeInfo | null>(null);
64+
const [loading, setLoading] = useState(true);
65+
const [error, setError] = useState<Error | null>(null);
6666

67-
React.useEffect(() => {
67+
useEffect(() => {
6868
let mounted = true;
6969

7070
async function fetchNavigationMode() {

0 commit comments

Comments
 (0)