adding help alert and all
This commit is contained in:
@@ -13,9 +13,9 @@ struct CircleNavigationView: View {
|
|||||||
@EnvironmentObject var navigationStack: NavigationStack
|
@EnvironmentObject var navigationStack: NavigationStack
|
||||||
@EnvironmentObject var authSessionStore: AuthSessionStore
|
@EnvironmentObject var authSessionStore: AuthSessionStore
|
||||||
|
|
||||||
@State var alertActive = false
|
@Binding var alertActive: Bool
|
||||||
@State var alertText = ""
|
@Binding var alertText: String
|
||||||
@State var alertSubtext = ""
|
@Binding var alertSubtext: String
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack(alignment: .center) {
|
HStack(alignment: .center) {
|
||||||
@@ -129,6 +129,7 @@ struct CircleNavigationView: View {
|
|||||||
self.alertText = "💼 Coming Soon!"
|
self.alertText = "💼 Coming Soon!"
|
||||||
|
|
||||||
self.alertSubtext = "Efficient and more authentic communication for teams! Contact us for more info."
|
self.alertSubtext = "Efficient and more authentic communication for teams! Contact us for more info."
|
||||||
|
|
||||||
} label: {
|
} label: {
|
||||||
Label("work", systemImage: "suitcase")
|
Label("work", systemImage: "suitcase")
|
||||||
.font(.caption2)
|
.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 {
|
//struct CircleNavigationView_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
// static var previews: some View {
|
||||||
CircleNavigationView().environmentObject(AuthSessionStore(isPreview: true))
|
// CircleNavigationView().environmentObject(AuthSessionStore(isPreview: true))
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|||||||
@@ -16,12 +16,17 @@ struct InnerCircleView: View {
|
|||||||
@State var selectedFriendIndex: Int? = nil
|
@State var selectedFriendIndex: Int? = nil
|
||||||
|
|
||||||
let universalSize = UIScreen.main.bounds
|
let universalSize = UIScreen.main.bounds
|
||||||
|
|
||||||
|
@State var alertActive = false
|
||||||
|
@State var alertText = ""
|
||||||
|
@State var alertSubtext = ""
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
// background
|
// background
|
||||||
WavesGlassBackgroundView(isRecording: self.innerCircleVM.isRecording)
|
WavesGlassBackgroundView(isRecording: self.innerCircleVM.isRecording)
|
||||||
|
|
||||||
|
// stale states
|
||||||
if self.authSessionStore.user?.nickname == nil || self.authSessionStore.user?.avatar == nil {
|
if self.authSessionStore.user?.nickname == nil || self.authSessionStore.user?.avatar == nil {
|
||||||
VStack(alignment: .center) {
|
VStack(alignment: .center) {
|
||||||
Image("undraw_fall_is_coming_yl-0-x")
|
Image("undraw_fall_is_coming_yl-0-x")
|
||||||
@@ -95,14 +100,41 @@ struct InnerCircleView: View {
|
|||||||
// header
|
// header
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
|
|
||||||
CircleNavigationView().environmentObject(innerCircleVM)
|
CircleNavigationView(alertActive: self.$alertActive, alertText: self.$alertText, alertSubtext: self.$alertSubtext).environmentObject(innerCircleVM)
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
|
|
||||||
CircleFooterView(selectedFriendIndex: self.$selectedFriendIndex)
|
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