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
struct ChatView: View {
var body: some View {
ZStack {
Rectangle()
.foregroundColor(Color(red: 231/255, green: 234/255, blue: 239/255))
Text("Chat")
}
.background(Color(red: 231/255, green: 234/255, blue: 239/255))
}
}
......@@ -49,6 +49,7 @@ class ConnectionManager: ObservableObject {
}
}
task.resume()
}
}
......@@ -10,10 +10,13 @@ import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
VStack(spacing: 0) {
ProductView()
.zIndex(2)
ChatView()
.zIndex(1)
}
.edgesIgnoringSafeArea(.all)
.background(Color.black)
}
}
......
......@@ -56,5 +56,10 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
......@@ -10,11 +10,32 @@ import SwiftUI
struct ProductView: View {
@ObservedObject var connectionManager = ConnectionManager()
let height: CGFloat = 200
var body: some View {
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)
}
}
Markdown is supported
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