adding call icon for now until I have insta join chat rooms
This commit is contained in:
@@ -26,15 +26,36 @@ struct CircleFooterView: View {
|
|||||||
|
|
||||||
HStack {
|
HStack {
|
||||||
if self.selectedFriend != nil && !self.convoRelativeTime.isEmpty && self.myTurn != nil {
|
if self.selectedFriend != nil && !self.convoRelativeTime.isEmpty && self.myTurn != nil {
|
||||||
Image(self.selectedFriend!.avatar ?? "")
|
// call button
|
||||||
.resizable()
|
Button {
|
||||||
.scaledToFit()
|
print("calling user now")
|
||||||
.background(NirvanaColor.teal.opacity(0.1))
|
|
||||||
.frame(width: 40, height: 40)
|
|
||||||
.clipShape(Circle())
|
|
||||||
.padding(5)
|
|
||||||
|
|
||||||
VStack (alignment: .leading) {
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
|
Text("Your Turn")
|
||||||
|
.padding()
|
||||||
|
.background(Color.orange.opacity(0.5))
|
||||||
|
.clipShape(Capsule())
|
||||||
|
|
||||||
|
|
||||||
|
Spacer()
|
||||||
|
|
||||||
|
// meta data of convo
|
||||||
|
VStack (alignment: .trailing) {
|
||||||
Text(self.selectedFriend!.nickname ?? "")
|
Text(self.selectedFriend!.nickname ?? "")
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
.foregroundColor(NirvanaColor.light)
|
.foregroundColor(NirvanaColor.light)
|
||||||
@@ -43,14 +64,20 @@ struct CircleFooterView: View {
|
|||||||
.foregroundColor(.gray)
|
.foregroundColor(.gray)
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.myTurn! {
|
Image(self.selectedFriend!.avatar ?? "")
|
||||||
Text("it's your turn")
|
.resizable()
|
||||||
} else {
|
.scaledToFit()
|
||||||
Text("it's their turn")
|
.background(NirvanaColor.teal.opacity(0.1))
|
||||||
}
|
.frame(width: 40, height: 40)
|
||||||
}
|
.clipShape(Circle())
|
||||||
|
.padding(5)
|
||||||
|
|
||||||
Spacer()
|
// if self.myTurn! {
|
||||||
|
// Text("it's your turn")
|
||||||
|
// } else {
|
||||||
|
// Text("it's their turn")
|
||||||
|
// }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.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))
|
||||||
@@ -62,7 +89,7 @@ struct CircleFooterView: View {
|
|||||||
.animation(Animation.spring(), value: self.selectedFriendIndex)
|
.animation(Animation.spring(), value: self.selectedFriendIndex)
|
||||||
.offset(
|
.offset(
|
||||||
x:0,
|
x:0,
|
||||||
y:self.selectedFriendIndex == nil ? 150 : 0
|
y:self.selectedFriendIndex == nil ? 0 : 0
|
||||||
)
|
)
|
||||||
.onChange(of: self.selectedFriendIndex) {newValue in
|
.onChange(of: self.selectedFriendIndex) {newValue in
|
||||||
// update meta data based on which friend was selected
|
// update meta data based on which friend was selected
|
||||||
|
|||||||
Reference in New Issue
Block a user