Commit 727acebd authored by  Joel  Oksanen's avatar Joel Oksanen
Browse files

Connected ios client and local server. Improved UI

parent 16c718bc
...@@ -11,8 +11,9 @@ import SwiftUI ...@@ -11,8 +11,9 @@ import SwiftUI
struct ChatView: View { struct ChatView: View {
var body: some View { var body: some View {
ZStack { ZStack {
Rectangle()
.foregroundColor(Color(red: 231/255, green: 234/255, blue: 239/255))
Text("Chat") Text("Chat")
} }
.background(Color(red: 231/255, green: 234/255, blue: 239/255))
} }
} }
...@@ -49,6 +49,7 @@ class ConnectionManager: ObservableObject { ...@@ -49,6 +49,7 @@ class ConnectionManager: ObservableObject {
} }
} }
task.resume() task.resume()
} }
} }
...@@ -10,10 +10,13 @@ import SwiftUI ...@@ -10,10 +10,13 @@ import SwiftUI
struct ContentView: View { struct ContentView: View {
var body: some View { var body: some View {
VStack { VStack(spacing: 0) {
ProductView() ProductView()
.zIndex(2)
ChatView() ChatView()
.zIndex(1)
} }
.edgesIgnoringSafeArea(.all)
.background(Color.black) .background(Color.black)
} }
} }
......
...@@ -56,5 +56,10 @@ ...@@ -56,5 +56,10 @@
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict> </dict>
</plist> </plist>
...@@ -10,11 +10,32 @@ import SwiftUI ...@@ -10,11 +10,32 @@ import SwiftUI
struct ProductView: View { struct ProductView: View {
@ObservedObject var connectionManager = ConnectionManager() @ObservedObject var connectionManager = ConnectionManager()
let height: CGFloat = 200
var body: some View { var body: some View {
ZStack { ZStack {
Text(connectionManager.product.name) Rectangle()
.foregroundColor(Color.white)
.frame(height: height)
.shadow(color: Color(.sRGB, white: 0, opacity: 0.05), radius: 20, x: 0, y: 8)
VStack {
Spacer()
HStack(alignment: .top) {
Text(connectionManager.product.name)
.foregroundColor(Color.gray)
Spacer()
Image(uiImage: connectionManager.product.image)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 120, height: 120)
.border(Color(white: 0.85), width: 1)
}
.padding(EdgeInsets(top: 0, leading: 20, bottom: 20, trailing: 20))
}
.frame(height: height)
} }
.background(Color.white)
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment