adding overlay to user icon but still need to view for other users
This commit is contained in:
@@ -65,7 +65,6 @@ struct CircleNavigationView: View {
|
|||||||
Label("log out", systemImage: "rectangle.portrait.and.arrow.right")
|
Label("log out", systemImage: "rectangle.portrait.and.arrow.right")
|
||||||
.foregroundColor(NirvanaColor.teal)
|
.foregroundColor(NirvanaColor.teal)
|
||||||
}
|
}
|
||||||
|
|
||||||
} label: {
|
} label: {
|
||||||
if self.authSessionStore.user?.avatar == nil {
|
if self.authSessionStore.user?.avatar == nil {
|
||||||
Image("Artboards_Diversity_Avatars_by_Netguru-1")
|
Image("Artboards_Diversity_Avatars_by_Netguru-1")
|
||||||
@@ -75,7 +74,19 @@ struct CircleNavigationView: View {
|
|||||||
.blur(radius: 5)
|
.blur(radius: 5)
|
||||||
.frame(width: 40, height: 40)
|
.frame(width: 40, height: 40)
|
||||||
.clipShape(Circle())
|
.clipShape(Circle())
|
||||||
.padding(5)
|
.overlay(alignment: .bottomTrailing) {
|
||||||
|
// user status
|
||||||
|
switch self.authSessionStore.user?.userStatus {
|
||||||
|
case .online:
|
||||||
|
Circle()
|
||||||
|
.frame(width: 10, height: 10)
|
||||||
|
.foregroundColor(Color.green)
|
||||||
|
case .offline:
|
||||||
|
Circle()
|
||||||
|
default:
|
||||||
|
Circle()
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Image((self.authSessionStore.user?.avatar)!)
|
Image((self.authSessionStore.user?.avatar)!)
|
||||||
.resizable()
|
.resizable()
|
||||||
@@ -83,8 +94,20 @@ struct CircleNavigationView: View {
|
|||||||
.background(self.innerCircleVM.isRecording ? Color.orange : NirvanaColor.teal.opacity(0.5))
|
.background(self.innerCircleVM.isRecording ? Color.orange : NirvanaColor.teal.opacity(0.5))
|
||||||
.frame(width: 40, height: 40)
|
.frame(width: 40, height: 40)
|
||||||
.clipShape(Circle())
|
.clipShape(Circle())
|
||||||
.padding(5)
|
|
||||||
.shadow(radius: 10)
|
.shadow(radius: 10)
|
||||||
|
.overlay(alignment: .bottomTrailing) {
|
||||||
|
// user status
|
||||||
|
switch self.authSessionStore.user?.userStatus {
|
||||||
|
case .online:
|
||||||
|
Circle()
|
||||||
|
.frame(width: 10, height: 10)
|
||||||
|
.foregroundColor(Color.green)
|
||||||
|
case .offline:
|
||||||
|
Circle()
|
||||||
|
default:
|
||||||
|
Circle()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,11 +92,10 @@ struct InnerCircleView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// header
|
// header
|
||||||
VStack(alignment: .leading) {
|
ZStack(alignment: .topLeading) {
|
||||||
|
Color.clear
|
||||||
|
|
||||||
CircleNavigationView(alertActive: self.$alertActive, alertText: self.$alertText, alertSubtext: self.$alertSubtext).environmentObject(innerCircleVM)
|
CircleNavigationView(alertActive: self.$alertActive, alertText: self.$alertText, alertSubtext: self.$alertSubtext).environmentObject(innerCircleVM)
|
||||||
|
|
||||||
Spacer()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CircleFooterView(selectedFriendIndex: self.$selectedFriendIndex).environmentObject(innerCircleVM)
|
CircleFooterView(selectedFriendIndex: self.$selectedFriendIndex).environmentObject(innerCircleVM)
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ struct RouterView: View {
|
|||||||
// set firestore user document isOnline to true
|
// set firestore user document isOnline to true
|
||||||
self.authSessionStore.updateUserStatus(userStatus: .online)
|
self.authSessionStore.updateUserStatus(userStatus: .online)
|
||||||
} else if newPhase == .background {
|
} else if newPhase == .background {
|
||||||
|
// TODO: find a way to do this in the background so that people can call me and start talking even if it's in the background
|
||||||
|
// but this may just not be possible, only with an actual call so to speak
|
||||||
print("app is in backgroun")
|
print("app is in backgroun")
|
||||||
self.authSessionStore.updateUserStatus(userStatus: .background)
|
self.authSessionStore.updateUserStatus(userStatus: .background)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user