@idealyst/navigation 1.0.77 → 1.0.78
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.
|
|
3
|
+
"version": "1.0.78",
|
|
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.
|
|
42
|
-
"@idealyst/theme": "^1.0.
|
|
41
|
+
"@idealyst/components": "^1.0.78",
|
|
42
|
+
"@idealyst/theme": "^1.0.78",
|
|
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",
|
|
@@ -16,7 +16,7 @@ export const buildNavigator = (params: NavigatorParam, parentPath = '') => {
|
|
|
16
16
|
<NavigatorType.Navigator screenOptions={{
|
|
17
17
|
headerShown: params.options?.headerShown
|
|
18
18
|
}}>
|
|
19
|
-
{params.routes.map((child) => buildScreen(child, NavigatorType))}
|
|
19
|
+
{params.routes.map((child, index) => buildScreen(child, NavigatorType, parentPath, index))}
|
|
20
20
|
</NavigatorType.Navigator>
|
|
21
21
|
)
|
|
22
22
|
}
|
|
@@ -43,11 +43,33 @@ const getNavigatorType = (params: NavigatorParam) => {
|
|
|
43
43
|
* @param parentPath
|
|
44
44
|
* @returns
|
|
45
45
|
*/
|
|
46
|
-
const buildScreen = (params: RouteParam, Navigator: TypedNavigator, parentPath = '') => {
|
|
46
|
+
const buildScreen = (params: RouteParam, Navigator: TypedNavigator, parentPath = '', index: number) => {
|
|
47
|
+
// Build the full path by combining parent path with current route path
|
|
48
|
+
// Handle root paths properly to avoid double slashes
|
|
49
|
+
let fullPath: string;
|
|
50
|
+
if (!parentPath || parentPath === '/') {
|
|
51
|
+
// If no parent path or parent is root, use the route path directly
|
|
52
|
+
fullPath = params.path;
|
|
53
|
+
} else {
|
|
54
|
+
// For nested routes, combine parent path with route path
|
|
55
|
+
// Remove leading slash from route path to avoid double slashes
|
|
56
|
+
const routePath = params.path.startsWith('/') ? params.path.slice(1) : params.path;
|
|
57
|
+
fullPath = `${parentPath}/${routePath}`;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
console.log('📱 Registering screen:', {
|
|
61
|
+
originalPath: params.path,
|
|
62
|
+
parentPath,
|
|
63
|
+
fullPath,
|
|
64
|
+
type: params.type,
|
|
65
|
+
screenName: fullPath
|
|
66
|
+
});
|
|
67
|
+
|
|
47
68
|
return (
|
|
48
69
|
<Navigator.Screen
|
|
49
|
-
|
|
50
|
-
|
|
70
|
+
key={`${fullPath}-${index}`}
|
|
71
|
+
name={fullPath}
|
|
72
|
+
component={params.type === 'screen' ? params.component : buildNavigator(params, fullPath)}
|
|
51
73
|
options={params.options}
|
|
52
74
|
/>
|
|
53
75
|
)
|