adding help alert and all
This commit is contained in:
@@ -13,9 +13,9 @@ struct CircleNavigationView: View {
|
||||
@EnvironmentObject var navigationStack: NavigationStack
|
||||
@EnvironmentObject var authSessionStore: AuthSessionStore
|
||||
|
||||
@State var alertActive = false
|
||||
@State var alertText = ""
|
||||
@State var alertSubtext = ""
|
||||
@Binding var alertActive: Bool
|
||||
@Binding var alertText: String
|
||||
@Binding var alertSubtext: String
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .center) {
|
||||
@@ -129,6 +129,7 @@ struct CircleNavigationView: View {
|
||||
self.alertText = "💼 Coming Soon!"
|
||||
|
||||
self.alertSubtext = "Efficient and more authentic communication for teams! Contact us for more info."
|
||||
|
||||
} label: {
|
||||
Label("work", systemImage: "suitcase")
|
||||
.font(.caption2)
|
||||
@@ -143,19 +144,11 @@ struct CircleNavigationView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.alert(self.alertText, isPresented: self.$alertActive) {
|
||||
|
||||
Button("OK", role: ButtonRole.cancel) { }
|
||||
|
||||
} message: {
|
||||
Text(self.alertSubtext)
|
||||
}
|
||||
.padding(.horizontal)
|
||||
}
|
||||
}
|
||||
|
||||
struct CircleNavigationView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
CircleNavigationView().environmentObject(AuthSessionStore(isPreview: true))
|
||||
}
|
||||
}
|
||||
//struct CircleNavigationView_Previews: PreviewProvider {
|
||||
// static var previews: some View {
|
||||
// CircleNavigationView().environmentObject(AuthSessionStore(isPreview: true))
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -16,12 +16,17 @@ struct InnerCircleView: View {
|
||||
@State var selectedFriendIndex: Int? = nil
|
||||
|
||||
let universalSize = UIScreen.main.bounds
|
||||
|
||||
@State var alertActive = false
|
||||
@State var alertText = ""
|
||||
@State var alertSubtext = ""
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
// background
|
||||
WavesGlassBackgroundView(isRecording: self.innerCircleVM.isRecording)
|
||||
|
||||
// stale states
|
||||
if self.authSessionStore.user?.nickname == nil || self.authSessionStore.user?.avatar == nil {
|
||||
VStack(alignment: .center) {
|
||||
Image("undraw_fall_is_coming_yl-0-x")
|
||||
@@ -95,14 +100,41 @@ struct InnerCircleView: View {
|
||||
// header
|
||||
VStack(alignment: .leading) {
|
||||
|
||||
CircleNavigationView().environmentObject(innerCircleVM)
|
||||
CircleNavigationView(alertActive: self.$alertActive, alertText: self.$alertText, alertSubtext: self.$alertSubtext).environmentObject(innerCircleVM)
|
||||
|
||||
Spacer()
|
||||
}
|
||||
|
||||
CircleFooterView(selectedFriendIndex: self.$selectedFriendIndex)
|
||||
|
||||
// helper for new users
|
||||
if self.authSessionStore.friendsArr.count <= 1 {
|
||||
ZStack(alignment: .bottomTrailing) {
|
||||
Color.clear
|
||||
|
||||
Button {
|
||||
self.alertActive.toggle()
|
||||
self.alertText = "👆🏼It's simple!"
|
||||
self.alertSubtext = "Press and hold to send a message. \n Tap to listen!"
|
||||
} label: {
|
||||
Label("help!", systemImage: "questionmark.circle")
|
||||
.font(.title2)
|
||||
.foregroundColor(NirvanaColor.teal)
|
||||
.padding()
|
||||
.background(.ultraThinMaterial)
|
||||
.shadow(radius: 10)
|
||||
.clipShape(Circle())
|
||||
.labelStyle(.iconOnly)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.onAppear() {
|
||||
.alert(self.alertText, isPresented: self.$alertActive) {
|
||||
|
||||
Button("OK", role: ButtonRole.cancel) { }
|
||||
|
||||
} message: {
|
||||
Text(self.alertSubtext)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user