diff --git a/apps/AppleApp/Brownfield Apple App.xcodeproj/project.pbxproj b/apps/AppleApp/Brownfield Apple App.xcodeproj/project.pbxproj index 1667efc2..2a858e25 100644 --- a/apps/AppleApp/Brownfield Apple App.xcodeproj/project.pbxproj +++ b/apps/AppleApp/Brownfield Apple App.xcodeproj/project.pbxproj @@ -7,14 +7,16 @@ objects = { /* Begin PBXBuildFile section */ - 798B42862F3E9A8B00DAD195 /* BrownfieldLib.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CA2F3E93D90099076A /* BrownfieldLib.xcframework */; }; - 798B42872F3E9A8B00DAD195 /* BrownfieldLib.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CA2F3E93D90099076A /* BrownfieldLib.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; - 798B42882F3E9A8D00DAD195 /* Brownie.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CB2F3E93D90099076A /* Brownie.xcframework */; }; - 798B42892F3E9A8D00DAD195 /* Brownie.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CB2F3E93D90099076A /* Brownie.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; - 798B428A2F3E9A8E00DAD195 /* hermesvm.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CC2F3E93D90099076A /* hermesvm.xcframework */; }; - 798B428B2F3E9A8E00DAD195 /* hermesvm.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CC2F3E93D90099076A /* hermesvm.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; - 798B428C2F3E9A8F00DAD195 /* ReactBrownfield.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CD2F3E93D90099076A /* ReactBrownfield.xcframework */; }; - 798B428D2F3E9A8F00DAD195 /* ReactBrownfield.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CD2F3E93D90099076A /* ReactBrownfield.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 6162B59C2F4DB20800EE908E /* BrownfieldLib.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CA2F3E93D90099076A /* BrownfieldLib.xcframework */; }; + 6162B59D2F4DB20800EE908E /* BrownfieldLib.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CA2F3E93D90099076A /* BrownfieldLib.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 6162B59E2F4DB20800EE908E /* Brownie.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CB2F3E93D90099076A /* Brownie.xcframework */; }; + 6162B59F2F4DB20800EE908E /* Brownie.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CB2F3E93D90099076A /* Brownie.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 6162B5A02F4DB20800EE908E /* hermesvm.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CC2F3E93D90099076A /* hermesvm.xcframework */; }; + 6162B5A12F4DB20800EE908E /* hermesvm.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CC2F3E93D90099076A /* hermesvm.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 6162B5A22F4DB20800EE908E /* ReactBrownfield.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CD2F3E93D90099076A /* ReactBrownfield.xcframework */; }; + 6162B5A32F4DB20800EE908E /* ReactBrownfield.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79A7F5CD2F3E93D90099076A /* ReactBrownfield.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 6162B5A42F4DB20F00EE908E /* BrownfieldNavigation.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6162B5882F4DB17600EE908E /* BrownfieldNavigation.xcframework */; }; + 6162B5A52F4DB20F00EE908E /* BrownfieldNavigation.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6162B5882F4DB17600EE908E /* BrownfieldNavigation.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -24,10 +26,11 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 798B428B2F3E9A8E00DAD195 /* hermesvm.xcframework in Embed Frameworks */, - 798B428D2F3E9A8F00DAD195 /* ReactBrownfield.xcframework in Embed Frameworks */, - 798B42892F3E9A8D00DAD195 /* Brownie.xcframework in Embed Frameworks */, - 798B42872F3E9A8B00DAD195 /* BrownfieldLib.xcframework in Embed Frameworks */, + 6162B5A52F4DB20F00EE908E /* BrownfieldNavigation.xcframework in Embed Frameworks */, + 6162B5A12F4DB20800EE908E /* hermesvm.xcframework in Embed Frameworks */, + 6162B5A32F4DB20800EE908E /* ReactBrownfield.xcframework in Embed Frameworks */, + 6162B59F2F4DB20800EE908E /* Brownie.xcframework in Embed Frameworks */, + 6162B59D2F4DB20800EE908E /* BrownfieldLib.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -35,6 +38,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 6162B5882F4DB17600EE908E /* BrownfieldNavigation.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = BrownfieldNavigation.xcframework; path = package/BrownfieldNavigation.xcframework; sourceTree = ""; }; 793C76A72EEBF938008A2A34 /* Brownfield Apple App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Brownfield Apple App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 79A7F5CA2F3E93D90099076A /* BrownfieldLib.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = BrownfieldLib.xcframework; path = package/BrownfieldLib.xcframework; sourceTree = ""; }; 79A7F5CB2F3E93D90099076A /* Brownie.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Brownie.xcframework; path = package/Brownie.xcframework; sourceTree = ""; }; @@ -55,22 +59,32 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 798B42882F3E9A8D00DAD195 /* Brownie.xcframework in Frameworks */, - 798B428C2F3E9A8F00DAD195 /* ReactBrownfield.xcframework in Frameworks */, - 798B42862F3E9A8B00DAD195 /* BrownfieldLib.xcframework in Frameworks */, - 798B428A2F3E9A8E00DAD195 /* hermesvm.xcframework in Frameworks */, + 6162B5A42F4DB20F00EE908E /* BrownfieldNavigation.xcframework in Frameworks */, + 6162B59E2F4DB20800EE908E /* Brownie.xcframework in Frameworks */, + 6162B5A22F4DB20800EE908E /* ReactBrownfield.xcframework in Frameworks */, + 6162B5A02F4DB20800EE908E /* hermesvm.xcframework in Frameworks */, + 6162B59C2F4DB20800EE908E /* BrownfieldLib.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 6108E5322F40A26800EA8FA1 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; 793C769E2EEBF938008A2A34 = { isa = PBXGroup; children = ( 793C76A92EEBF938008A2A34 /* Brownfield Apple App */, + 6108E5322F40A26800EA8FA1 /* Frameworks */, 793C76A82EEBF938008A2A34 /* Products */, 79A7F5CA2F3E93D90099076A /* BrownfieldLib.xcframework */, + 6162B5882F4DB17600EE908E /* BrownfieldNavigation.xcframework */, 79A7F5CB2F3E93D90099076A /* Brownie.xcframework */, 79A7F5CC2F3E93D90099076A /* hermesvm.xcframework */, 79A7F5CD2F3E93D90099076A /* ReactBrownfield.xcframework */, diff --git a/apps/AppleApp/Brownfield Apple App/BrownfieldAppleApp.swift b/apps/AppleApp/Brownfield Apple App/BrownfieldAppleApp.swift index f4d35f78..1616b3b6 100644 --- a/apps/AppleApp/Brownfield Apple App/BrownfieldAppleApp.swift +++ b/apps/AppleApp/Brownfield Apple App/BrownfieldAppleApp.swift @@ -2,6 +2,8 @@ import BrownfieldLib import Brownie import SwiftUI import ReactBrownfield +import UIKit +import BrownfieldNavigation class AppDelegate: NSObject, UIApplicationDelegate { var window: UIWindow? @@ -14,6 +16,55 @@ class AppDelegate: NSObject, UIApplicationDelegate { } } +public class RNNavigationDelegate: BrownfieldNavigationDelegate { + public func navigateToSettings() { + present(SettingsScreen()) + } + + public func navigateToReferrals(userId: String) { + present(ReferralsScreen(userId: userId)) + } + + private func present(_ view: Content) { + DispatchQueue.main.async { + let hostingController = UIHostingController(rootView: view) + + guard let topController = UIApplication.shared.topMostViewController() else { + return + } + + if let navigationController = topController.navigationController { + navigationController.pushViewController(hostingController, animated: true) + return + } + + let navigationController = UINavigationController(rootViewController: hostingController) + topController.present(navigationController, animated: true) + } + } +} + +private extension UIApplication { + func topMostViewController( + base: UIViewController? = UIApplication.shared.connectedScenes + .compactMap { $0 as? UIWindowScene } + .flatMap { $0.windows } + .first(where: { $0.isKeyWindow })?.rootViewController + ) -> UIViewController? { + if let navigationController = base as? UINavigationController { + return topMostViewController(base: navigationController.visibleViewController) + } + if let tabBarController = base as? UITabBarController, + let selected = tabBarController.selectedViewController { + return topMostViewController(base: selected) + } + if let presented = base?.presentedViewController { + return topMostViewController(base: presented) + } + return base + } +} + @main struct BrownfieldAppleApp: App { @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate @@ -23,6 +74,21 @@ struct BrownfieldAppleApp: App { ReactNativeBrownfield.shared.startReactNative { print("React Native has been loaded") } + +// let mgr = ReactBrownfield.BrownfieldNavigationManager.shared +// print("SWIFT mgr:", Unmanaged.passUnretained(mgr).toOpaque()) +// print("SWIFT class:", NSStringFromClass(type(of: mgr))) +// print("SWIFT bundle:", Bundle(for: ReactBrownfield.BrownfieldNavigationManager.self).bundlePath) +// ReactBrownfield.BrownfieldNavigationManager.shared.setDelegate(navigationDelegate: RNNavigationDelegate()) + + let mgr = BrownfieldNavigationManager.shared + print("11 SWIFT mgr:", Unmanaged.passUnretained(mgr).toOpaque()) + print("11 SWIFT class:", NSStringFromClass(type(of: mgr))) + print("11 SWIFT bundle:", Bundle(for: BrownfieldNavigationManager.self).bundlePath) + + mgr.setDelegate( + navigationDelegate: RNNavigationDelegate() + ) #if USE_EXPO_HOST ReactNativeBrownfield.shared.ensureExpoModulesProvider() diff --git a/apps/AppleApp/Brownfield Apple App/ContentView.swift b/apps/AppleApp/Brownfield Apple App/ContentView.swift index 4be7c44c..c32cbd6a 100644 --- a/apps/AppleApp/Brownfield Apple App/ContentView.swift +++ b/apps/AppleApp/Brownfield Apple App/ContentView.swift @@ -31,6 +31,53 @@ struct MainScreen: View { } } +struct SettingsScreen: View { + var body: some View { + Form { + Section("Preferences") { + Toggle("Enable notifications", isOn: .constant(true)) + Toggle("Dark mode", isOn: .constant(false)) + } + + Section("About") { + HStack { + Text("Version") + Spacer() + Text("1.0.0") + .foregroundStyle(.secondary) + } + } + } + .navigationTitle("Settings") + } +} + +struct ReferralsScreen: View { + let userId: String + + var body: some View { + VStack(spacing: 16) { + Text("Referrals") + .font(.title2) + .fontWeight(.semibold) + + Text("User ID") + .foregroundStyle(.secondary) + Text(userId) + .font(.body.monospaced()) + .textSelection(.enabled) + + Button("Share referral link") { + // Placeholder action for the sample app. + } + .buttonStyle(.borderedProminent) + } + .frame(maxWidth: .infinity, maxHeight: .infinity) + .padding() + .navigationTitle("Referrals") + } +} + struct GreetingCard: View { let name: String @UseStore(\BrownfieldStore.counter) var counter diff --git a/apps/AppleApp/prepareXCFrameworks.js b/apps/AppleApp/prepareXCFrameworks.js index ab8a6354..436816dd 100644 --- a/apps/AppleApp/prepareXCFrameworks.js +++ b/apps/AppleApp/prepareXCFrameworks.js @@ -79,6 +79,7 @@ const validNames = [ 'Brownie.xcframework', 'hermesvm.xcframework', 'ReactBrownfield.xcframework', + 'BrownfieldNavigation.xcframework', ]; for (const file of fs.readdirSync(targetPackagePath)) { diff --git a/apps/RNApp/brownfield.navigation.ts b/apps/RNApp/brownfield.navigation.ts new file mode 100644 index 00000000..8bc90246 --- /dev/null +++ b/apps/RNApp/brownfield.navigation.ts @@ -0,0 +1,12 @@ +export interface BrownfieldNavigationSpec { + /** + * Navigate to the native settings screen + */ + navigateToSettings(): void; + + /** + * Navigate to the native referrals screen + * @param userId - The user's unique identifier + */ + navigateToReferrals(userId: string): void; +} diff --git a/apps/RNApp/ios/Podfile.lock b/apps/RNApp/ios/Podfile.lock index 238047ad..ff1f091d 100644 --- a/apps/RNApp/ios/Podfile.lock +++ b/apps/RNApp/ios/Podfile.lock @@ -1,6 +1,34 @@ PODS: - boost (1.84.0) - - Brownie (0.0.5): + - BrownfieldNavigation (1.0.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - Brownie (3.0.0-rc.2): - boost - DoubleConversion - fast_float @@ -2350,7 +2378,7 @@ PODS: - SocketRocket - ReactAppDependencyProvider (0.82.1): - ReactCodegen - - ReactBrownfield (3.0.0-rc.1): + - ReactBrownfield (3.0.0-rc.2): - boost - DoubleConversion - fast_float @@ -2530,6 +2558,7 @@ PODS: DEPENDENCIES: - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`) + - "BrownfieldNavigation (from `../node_modules/@callstack/brownfield-navigation`)" - "Brownie (from `../node_modules/@callstack/brownie`)" - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) - fast_float (from `../node_modules/react-native/third-party-podspecs/fast_float.podspec`) @@ -2616,6 +2645,8 @@ SPEC REPOS: EXTERNAL SOURCES: boost: :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec" + BrownfieldNavigation: + :path: "../node_modules/@callstack/brownfield-navigation" Brownie: :path: "../node_modules/@callstack/brownie" DoubleConversion: @@ -2772,7 +2803,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: 7e761d76ca2ce687f7cc98e698152abd03a18f90 - Brownie: e4291b884a7157a2dbe6d60dd72e962078223791 + BrownfieldNavigation: 3141ebc18a1dbeb374fff7ae12b2f5d9d1272f2f + Brownie: 062c63b8aff0eedae128008f2375478fd86fd928 DoubleConversion: cb417026b2400c8f53ae97020b2be961b59470cb fast_float: b32c788ed9c6a8c584d114d0047beda9664e7cc6 FBLazyVector: 0aa6183b9afe3c31fc65b5d1eeef1f3c19b63bfa @@ -2843,7 +2875,7 @@ SPEC CHECKSUMS: React-utils: f06ff240e06e2bd4b34e48f1b34cac00866e8979 React-webperformancenativemodule: b3398f8175fa96d992c071b1fa59bd6f9646b840 ReactAppDependencyProvider: a45ef34bb22dc1c9b2ac1f74167d9a28af961176 - ReactBrownfield: ce231a9060b34e1fe8f91ec8416f21dc6da8b4b5 + ReactBrownfield: 91f5dde821a05d473b97fba634a7d401a697b9d1 ReactCodegen: 0bce2d209e2e802589f4c5ff76d21618200e74cb ReactCommon: 801eff8cb9c940c04d3a89ce399c343ee3eff654 RNScreens: d6413aeb1878cdafd3c721e2c5218faf5d5d3b13 diff --git a/apps/RNApp/ios/RNApp.xcodeproj/project.pbxproj b/apps/RNApp/ios/RNApp.xcodeproj/project.pbxproj index 36a5015f..55adbce5 100644 --- a/apps/RNApp/ios/RNApp.xcodeproj/project.pbxproj +++ b/apps/RNApp/ios/RNApp.xcodeproj/project.pbxproj @@ -13,9 +13,9 @@ 79BD1EEA2EEBFB76003AA29F /* BrownfieldLib.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79BD1EE32EEBFB76003AA29F /* BrownfieldLib.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 79F35E8C2EEC1D4500E64860 /* BrownfieldLib.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79F35E8A2EEC1D4500E64860 /* BrownfieldLib.swift */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; - A19F59C8902E0F7A03F2A8C6 /* Pods_RNApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B6CBC8DE61C44A9AB569A3CA /* Pods_RNApp.framework */; }; - BFB326E698C6BD239F8AEAE9 /* Pods_RNApp_BrownfieldLib.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 64481842743F90E340AD414A /* Pods_RNApp_BrownfieldLib.framework */; }; C66C2A65406C527E9529D08F /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; }; + D3FEBEFB042C029B09B8C0CB /* Pods_RNApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0B1A9990496F5E91A78843A1 /* Pods_RNApp.framework */; }; + E652A655257F24686D40360B /* Pods_RNApp_BrownfieldLib.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3113F60F0500A8CFC39FD6F4 /* Pods_RNApp_BrownfieldLib.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -43,19 +43,19 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 0B1A9990496F5E91A78843A1 /* Pods_RNApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RNApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07F961A680F5B00A75B9A /* RNApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RNApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RNApp/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNApp/Info.plist; sourceTree = ""; }; 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = RNApp/PrivacyInfo.xcprivacy; sourceTree = ""; }; + 3113F60F0500A8CFC39FD6F4 /* Pods_RNApp_BrownfieldLib.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RNApp_BrownfieldLib.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3B4392A12AC88292D35C810B /* Pods-RNApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNApp.debug.xcconfig"; path = "Target Support Files/Pods-RNApp/Pods-RNApp.debug.xcconfig"; sourceTree = ""; }; 5709B34CF0A7D63546082F79 /* Pods-RNApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNApp.release.xcconfig"; path = "Target Support Files/Pods-RNApp/Pods-RNApp.release.xcconfig"; sourceTree = ""; }; - 64481842743F90E340AD414A /* Pods_RNApp_BrownfieldLib.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RNApp_BrownfieldLib.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = RNApp/AppDelegate.swift; sourceTree = ""; }; 79BD1EE32EEBFB76003AA29F /* BrownfieldLib.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = BrownfieldLib.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 79F35E8A2EEC1D4500E64860 /* BrownfieldLib.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrownfieldLib.swift; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = RNApp/LaunchScreen.storyboard; sourceTree = ""; }; 8A02E03D9F74B585B0A8F7F7 /* Pods-RNApp-BrownfieldLib.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNApp-BrownfieldLib.debug.xcconfig"; path = "Target Support Files/Pods-RNApp-BrownfieldLib/Pods-RNApp-BrownfieldLib.debug.xcconfig"; sourceTree = ""; }; - B6CBC8DE61C44A9AB569A3CA /* Pods_RNApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RNApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D8C030F60E402FD6CFBB3904 /* Pods-RNApp-BrownfieldLib.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNApp-BrownfieldLib.release.xcconfig"; path = "Target Support Files/Pods-RNApp-BrownfieldLib/Pods-RNApp-BrownfieldLib.release.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ @@ -66,7 +66,7 @@ buildActionMask = 2147483647; files = ( 79BD1EE92EEBFB76003AA29F /* BrownfieldLib.framework in Frameworks */, - A19F59C8902E0F7A03F2A8C6 /* Pods_RNApp.framework in Frameworks */, + D3FEBEFB042C029B09B8C0CB /* Pods_RNApp.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -74,7 +74,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BFB326E698C6BD239F8AEAE9 /* Pods_RNApp_BrownfieldLib.framework in Frameworks */, + E652A655257F24686D40360B /* Pods_RNApp_BrownfieldLib.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -97,8 +97,8 @@ isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - B6CBC8DE61C44A9AB569A3CA /* Pods_RNApp.framework */, - 64481842743F90E340AD414A /* Pods_RNApp_BrownfieldLib.framework */, + 0B1A9990496F5E91A78843A1 /* Pods_RNApp.framework */, + 3113F60F0500A8CFC39FD6F4 /* Pods_RNApp_BrownfieldLib.framework */, ); name = Frameworks; sourceTree = ""; diff --git a/apps/RNApp/package.json b/apps/RNApp/package.json index 07ea82c4..8637e13b 100644 --- a/apps/RNApp/package.json +++ b/apps/RNApp/package.json @@ -13,9 +13,11 @@ "lint": "eslint .", "start": "react-native start", "test": "jest", - "codegen": "brownfield codegen" + "codegen": "brownfield codegen", + "brownfield:navigation-codegen": "brownfield-navigation-codegen brownfield.navigation.ts" }, "dependencies": { + "@callstack/brownfield-navigation": "workspace:^", "@callstack/brownie": "workspace:^", "@callstack/react-native-brownfield": "workspace:^", "@react-navigation/native": "^7.0.15", diff --git a/apps/RNApp/src/HomeScreen.tsx b/apps/RNApp/src/HomeScreen.tsx index 99131782..7aa9ae6a 100644 --- a/apps/RNApp/src/HomeScreen.tsx +++ b/apps/RNApp/src/HomeScreen.tsx @@ -2,6 +2,7 @@ import { useEffect } from 'react'; import { StyleSheet, Text, View, Button } from 'react-native'; import type { NativeStackScreenProps } from '@react-navigation/native-stack'; import ReactNativeBrownfield from '@callstack/react-native-brownfield'; +import BrownfieldNavigation from '@callstack/brownfield-navigation'; import { getRandomTheme } from './utils'; import type { RootStackParamList } from './navigation/RootStack'; @@ -50,6 +51,18 @@ export function HomeScreen({ color={colors.secondary} title="Go back" /> + +