-
Notifications
You must be signed in to change notification settings - Fork 0
/
MenuView.swift
70 lines (58 loc) · 1.8 KB
/
MenuView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//
// MenuView.swift
// Scavenger App
//
// Created by Ajay Moturi on 10/23/21.
//
import SwiftUI
struct MenuView: View {
@Binding var closeMenu: Bool = false
var body: some View {
return GeometryReader { geometry in
VStack {
Spacer()
Button {
closeMenu = true
print("Close the menu")
} label: {
Image(systemName: "chevron.down")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 35, height: 35)
.foregroundColor(.gray)
}
MenuView(closeMenu: self.$closeMenu)
.frame(width: geometry.size.width, height: geometry.size.height)
if self.closeMenu {
ContentView()
.transition(.move(edge: .top))
}
Spacer()
Text("Account")
.fontWeight(.semibold)
.foregroundColor(.gray)
.font(.largeTitle)
Spacer()
Text("Settings")
.fontWeight(.semibold)
.foregroundColor(.gray)
.font(.largeTitle)
Spacer()
Text("Sign Out")
.fontWeight(.semibold)
.foregroundColor(.gray)
.font(.largeTitle)
//Spacer()
}
.frame(maxWidth: .infinity)
.background(Color(red: 211/255, green: 211/255, blue: 211/255))
.opacity(0.9)
.ignoresSafeArea()
}
}
}
struct MenuView_Previews: PreviewProvider {
static var previews: some View {
MenuView(closeMenu: .constant(true))
}
}