nicer text and tweaks
This commit is contained in:
@@ -36,16 +36,7 @@ struct CircleFooterView: View {
|
|||||||
.clipShape(Circle())
|
.clipShape(Circle())
|
||||||
.overlay(alignment: .topTrailing) {
|
.overlay(alignment: .topTrailing) {
|
||||||
// user status
|
// user status
|
||||||
switch self.selectedFriend!.userStatus {
|
UserStatusView(status: self.selectedFriend!.userStatus, size: 10)
|
||||||
case .online:
|
|
||||||
Circle()
|
|
||||||
.frame(width: 10, height: 10)
|
|
||||||
.foregroundColor(Color.green)
|
|
||||||
case .offline:
|
|
||||||
EmptyView()
|
|
||||||
default:
|
|
||||||
EmptyView()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.padding(5)
|
.padding(5)
|
||||||
.contextMenu {
|
.contextMenu {
|
||||||
@@ -69,50 +60,34 @@ struct CircleFooterView: View {
|
|||||||
// meta data of convo
|
// meta data of convo
|
||||||
VStack (alignment: .leading) {
|
VStack (alignment: .leading) {
|
||||||
if self.selectedFriend != nil {
|
if self.selectedFriend != nil {
|
||||||
Text(self.selectedFriend!.nickname ?? "")
|
Text((self.selectedFriend!.nickname ?? "") + " ")
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
.foregroundColor(NirvanaColor.light)
|
.foregroundColor(NirvanaColor.light)
|
||||||
}
|
+
|
||||||
if !self.convoRelativeTime.isEmpty && self.myTurn != nil {
|
UserStatusTextView(status: self.selectedFriend!.userStatus).body
|
||||||
if self.myTurn! {
|
|
||||||
Label("your turn", systemImage: "wave.3.right.circle.fill")
|
if !self.convoRelativeTime.isEmpty && self.myTurn != nil {
|
||||||
.foregroundColor(Color.orange)
|
if self.myTurn! {
|
||||||
.font(.caption)
|
Label("your turn", systemImage: "wave.3.right.circle.fill")
|
||||||
} else {
|
.foregroundColor(Color.orange)
|
||||||
Label("their turn", systemImage: "wave.3.right.circle.fill")
|
.font(.caption)
|
||||||
.foregroundColor(NirvanaColor.dimTeal)
|
} else {
|
||||||
.font(.caption)
|
Label("their turn", systemImage: "wave.3.right.circle.fill")
|
||||||
|
.foregroundColor(NirvanaColor.dimTeal)
|
||||||
|
.font(.caption)
|
||||||
|
}
|
||||||
|
|
||||||
|
Text(self.convoRelativeTime)
|
||||||
|
.font(.caption2)
|
||||||
|
.foregroundColor(.gray)
|
||||||
}
|
}
|
||||||
|
|
||||||
Text(self.convoRelativeTime)
|
|
||||||
.font(.caption2)
|
|
||||||
.foregroundColor(.gray)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
if self.selectedFriend != nil {
|
|
||||||
// call button
|
|
||||||
Button {
|
|
||||||
print("calling user now")
|
|
||||||
|
|
||||||
if self.selectedFriend?.phoneNumber != nil {
|
|
||||||
let tel: String = "tel://\(self.selectedFriend!.phoneNumber!)"
|
|
||||||
let strUrl: String = tel.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
|
|
||||||
|
|
||||||
UIApplication.shared.open(URL(string: strUrl)!, options: [:], completionHandler: nil)
|
|
||||||
} else {
|
|
||||||
print("phone number is nil of contact")
|
|
||||||
}
|
|
||||||
} label: {
|
|
||||||
Label("Call", systemImage: "phone.and.waveform")
|
|
||||||
.labelStyle(.iconOnly)
|
|
||||||
.foregroundColor(NirvanaColor.teal)
|
|
||||||
.padding()
|
|
||||||
.font(.title2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity, maxHeight: 60) // 60 is the height of the footer control big circle
|
.frame(maxWidth: .infinity, maxHeight: 60) // 60 is the height of the footer control big circle
|
||||||
.background(Color.white.opacity(0.5))
|
.background(Color.white.opacity(0.5))
|
||||||
|
|||||||
@@ -189,10 +189,10 @@ struct CircleGridView: View {
|
|||||||
print("activated long press!")
|
print("activated long press!")
|
||||||
|
|
||||||
// if in a convo, I don't want to have user footer show up
|
// if in a convo, I don't want to have user footer show up
|
||||||
if self.convoVM.isInCall() {
|
// if self.convoVM.isInCall() {
|
||||||
print("can't select another friend because I am in a call...leave call first")
|
// print("can't select another friend because I am in a call...leave call first")
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
|
||||||
// stop any player still playing of a message
|
// stop any player still playing of a message
|
||||||
self.queuePlayer.removeAllItems()
|
self.queuePlayer.removeAllItems()
|
||||||
|
|||||||
@@ -20,16 +20,16 @@ struct UserStatusView: View {
|
|||||||
.frame(width: size, height: size)
|
.frame(width: size, height: size)
|
||||||
.foregroundColor(Color.green)
|
.foregroundColor(Color.green)
|
||||||
.padding(padding)
|
.padding(padding)
|
||||||
case .offline:
|
|
||||||
Circle()
|
|
||||||
.frame(width: size, height: size)
|
|
||||||
.foregroundColor(Color.red)
|
|
||||||
.padding(padding)
|
|
||||||
case .inConvo:
|
case .inConvo:
|
||||||
Circle()
|
Circle()
|
||||||
.frame(width: size, height: size)
|
.frame(width: size, height: size)
|
||||||
.foregroundColor(Color.orange)
|
.foregroundColor(Color.orange)
|
||||||
.padding(padding)
|
.padding(padding)
|
||||||
|
case .background:
|
||||||
|
Circle()
|
||||||
|
.frame(width: size, height: size)
|
||||||
|
.foregroundColor(NirvanaColor.dimTeal)
|
||||||
|
.padding(padding)
|
||||||
default:
|
default:
|
||||||
EmptyView()
|
EmptyView()
|
||||||
}
|
}
|
||||||
@@ -41,3 +41,28 @@ struct UserStatusView: View {
|
|||||||
// UserStatusView()
|
// UserStatusView()
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
struct UserStatusTextView {
|
||||||
|
var status: UserStatus?
|
||||||
|
|
||||||
|
var body: Text {
|
||||||
|
switch self.status {
|
||||||
|
case .online:
|
||||||
|
return Text("online")
|
||||||
|
.font(.caption2)
|
||||||
|
.foregroundColor(Color.green)
|
||||||
|
case .inConvo:
|
||||||
|
return Text("in convo")
|
||||||
|
.font(.caption2)
|
||||||
|
.foregroundColor(Color.orange)
|
||||||
|
case .background:
|
||||||
|
return Text("idle")
|
||||||
|
.font(.caption2)
|
||||||
|
.foregroundColor(NirvanaColor.dimTeal)
|
||||||
|
default:
|
||||||
|
return Text("offline")
|
||||||
|
.font(.caption2)
|
||||||
|
.foregroundColor(Color.gray)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user