adding in sheet but not working yet for user menu to have log out option
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// UserMenu.swift
|
||||
// nirvana-ios
|
||||
//
|
||||
// Created by Arjun Patel on 12/14/21.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct UserMenuView: View {
|
||||
@Environment(\.dismiss) var dismiss
|
||||
|
||||
var body: some View {
|
||||
Button("Press to dismiss") {
|
||||
dismiss()
|
||||
}
|
||||
.font(.title)
|
||||
.padding()
|
||||
.background(Color.black)
|
||||
}
|
||||
}
|
||||
|
||||
struct UserMenuView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
UserMenuView()
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import SwiftUI
|
||||
struct HeaderView: View {
|
||||
@EnvironmentObject var authStore:AuthSessionStore
|
||||
@State var averageColor: UIColor = UIColor(NirvanaColor.teal)
|
||||
@State var showingMenu: Bool = false
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment:.center) {
|
||||
@@ -27,7 +28,9 @@ struct HeaderView: View {
|
||||
.frame(width: 40, height: 40)
|
||||
.clipShape(Circle())
|
||||
.padding(5)
|
||||
.shadow(radius:5)
|
||||
.sheet(isPresented: $showingMenu) {
|
||||
UserMenuView()
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
@@ -35,6 +38,7 @@ struct HeaderView: View {
|
||||
.background(NirvanaColor.solidBlue)
|
||||
.cornerRadius(100)
|
||||
.padding(.horizontal)
|
||||
.shadow(radius: 10)
|
||||
.onAppear{
|
||||
// set background color based on profile picture tint
|
||||
if authStore.sessionState == SessionState.isAuthenticated {
|
||||
|
||||
Reference in New Issue
Block a user