-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathContentView.swift
More file actions
46 lines (38 loc) · 1.08 KB
/
ContentView.swift
File metadata and controls
46 lines (38 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import Brownie
import ReactBrownfield
import SwiftUI
import UIKit
struct ChatMessage: Identifiable {
let id: Int
let text: String
let fromRN: Bool
}
let initialState = BrownfieldStore(
counter: 0,
user: User(name: "Username")
)
struct ContentView: View {
var body: some View {
NavigationView {
VStack(spacing: 16) {
GreetingCard(name: "iOS Expo")
MessagesView()
ReactNativeView(moduleName: "main")
.navigationBarHidden(true)
.clipShape(RoundedRectangle(cornerRadius: 16))
.background(Color(UIColor.systemBackground))
Button("Stop React Native") {
ReactNativeBrownfield.shared.stopReactNative()
}
.buttonStyle(PlainButtonStyle())
.padding(.top)
.foregroundColor(.red)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.padding(16)
}
}
}
#Preview {
ContentView()
}