@idealyst/navigation 1.0.76 → 1.0.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idealyst/navigation",
3
- "version": "1.0.76",
3
+ "version": "1.0.77",
4
4
  "description": "Cross-platform navigation library for React and React Native",
5
5
  "readme": "README.md",
6
6
  "main": "src/index.ts",
@@ -38,8 +38,8 @@
38
38
  "publish:npm": "npm publish"
39
39
  },
40
40
  "peerDependencies": {
41
- "@idealyst/components": "^1.0.76",
42
- "@idealyst/theme": "^1.0.76",
41
+ "@idealyst/components": "^1.0.77",
42
+ "@idealyst/theme": "^1.0.77",
43
43
  "@react-navigation/bottom-tabs": "^7.0.0",
44
44
  "@react-navigation/drawer": "^7.0.0",
45
45
  "@react-navigation/native": "^7.0.0",
@@ -5,7 +5,7 @@ import { NavigatorParam } from "../routing";
5
5
  */
6
6
  export type NavigateParams = {
7
7
  path: string;
8
- vars: Record<string, string>;
8
+ vars?: Record<string, string>;
9
9
  };
10
10
 
11
11
  export type NavigatorProviderProps = {
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
- import { NavigatorParam, RouteParam, TabNavigatorParam, StackNavigatorParam } from './types'
3
- import { DefaultTabLayout } from '../layouts/DefaultTabLayout'
4
2
  import { DefaultStackLayout } from '../layouts/DefaultStackLayout'
3
+ import { DefaultTabLayout } from '../layouts/DefaultTabLayout'
4
+ import { NavigatorParam, StackNavigatorParam, TabNavigatorParam } from './types'
5
5
 
6
6
  /**
7
7
  * Build the Web navigator using custom layout components
@@ -44,7 +44,7 @@ const buildFullPath = (parentPath: string, childPath: string): string => {
44
44
 
45
45
  const normalizedParent = parentPath === '/' ? '' : parentPath
46
46
  const normalizedChild = normalizePath(childPath)
47
-
47
+
48
48
  return `${normalizedParent}${normalizedChild}`
49
49
  }
50
50
 
@@ -164,7 +164,7 @@ const StackNavigator: React.FC<{ params: StackNavigatorParam; parentPath: string
164
164
  const navigatorRoute = params.routes.find(route => {
165
165
  if (route.type === 'navigator') {
166
166
  const fullRoutePath = buildFullPath(parentPath, route.path)
167
- return currentPath.startsWith(fullRoutePath)
167
+ return currentPath.startsWith(fullRoutePath + '/') || currentPath === fullRoutePath
168
168
  }
169
169
  return false
170
170
  })