callstack / react-native-visionos

A framework for building native visionOS applications using React
https://callstack.github.io/react-native-visionos-docs/
MIT License
1.02k stars 30 forks source link

ToolBar problem #136

Closed MP185496 closed 8 months ago

MP185496 commented 8 months ago

Description

Is there a way to add toolbars to our window? I tried to add it in swift code, but i couldn't because i need view for that, and in our RTC screen we get back a window and window don't have toolbar option on it.

Is there a plan to add this from RN side or to make it work from swift side? Thanks

Steps to reproduce

/

React Native Version

0.73.5

Affected Platforms

Runtime - Android, Runtime - iOS

Output of npx react-native info

/

Stacktrace or Logs

/

Reproducer

/

Screenshots and Videos

No response

okwasniewski commented 8 months ago

Hey, thanks for opening the issue. Once #137 will be merged and released you will be able to use toolbar modifier and ornaments on the Swift side, like so:

@main
struct RC07401VISIONOSApp: App {
  @UIApplicationDelegateAdaptor var delegate: AppDelegate

  var body: some Scene {
    WindowGroup {
      RCTRootViewRepresentable(moduleName: "RC07401VISIONOS", initialProps: nil)
        .modifier(WindowHandlingModifier())
        // Add ornaments 
    }
  }
}
MP185496 commented 8 months ago

Hey, thanks for opening the issue. Once #137 will be merged and released you will be able to use toolbar modifier and ornaments on the Swift side, like so:

@main
struct RC07401VISIONOSApp: App {
  @UIApplicationDelegateAdaptor var delegate: AppDelegate

  var body: some Scene {
    WindowGroup {
      RCTRootViewRepresentable(moduleName: "RC07401VISIONOS", initialProps: nil)
        .modifier(WindowHandlingModifier())
        // Add ornaments 
    }
  }
}

Awsome, thank you very much :)