burger menu profile scroll
This commit is contained in:
parent
58e3488a9d
commit
1fdc8dbf45
@ -3,61 +3,71 @@ import SwiftUI
|
|||||||
struct SideMenuView: View {
|
struct SideMenuView: View {
|
||||||
@Binding var isPresented: Bool
|
@Binding var isPresented: Bool
|
||||||
|
|
||||||
|
// Adjustable paddings
|
||||||
|
private let topPadding: CGFloat = 66
|
||||||
|
private let bottomPadding: CGFloat = 34
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(alignment: .leading, spacing: 0) {
|
VStack(alignment: .leading, spacing: 0) {
|
||||||
// Header
|
|
||||||
VStack(alignment: .leading) {
|
|
||||||
Image(systemName: "person.circle.fill")
|
|
||||||
.resizable()
|
|
||||||
.frame(width: 60, height: 60)
|
|
||||||
.foregroundColor(.gray)
|
|
||||||
Text("Your Name")
|
|
||||||
.font(.title2).bold()
|
|
||||||
Text("@yourusername")
|
|
||||||
.font(.subheadline)
|
|
||||||
.foregroundColor(.secondary)
|
|
||||||
}
|
|
||||||
.padding(20)
|
|
||||||
|
|
||||||
// Menu Items
|
|
||||||
ScrollView {
|
ScrollView {
|
||||||
VStack(alignment: .leading, spacing: 20) {
|
VStack(alignment: .leading, spacing: 0) { // Parent VStack
|
||||||
// Section 1
|
// Header
|
||||||
VStack(alignment: .leading, spacing: 15) {
|
VStack(alignment: .leading) {
|
||||||
SideMenuButton(icon: "person.2.fill", title: "People You May Like", action: {})
|
Image(systemName: "person.circle.fill")
|
||||||
SideMenuButton(icon: "star.fill", title: "Fun Fest", action: {})
|
.resizable()
|
||||||
SideMenuButton(icon: "lightbulb.fill", title: "Creator Center", action: {})
|
.frame(width: 60, height: 60)
|
||||||
|
.foregroundColor(.gray)
|
||||||
|
Text("Your Name")
|
||||||
|
.font(.title2).bold()
|
||||||
|
Text("@yourusername")
|
||||||
|
.font(.subheadline)
|
||||||
|
.foregroundColor(.secondary)
|
||||||
}
|
}
|
||||||
|
.padding(.horizontal, 20)
|
||||||
|
.padding(.top, topPadding)
|
||||||
|
.padding(.bottom, 20)
|
||||||
|
|
||||||
Divider()
|
|
||||||
|
|
||||||
// Section 2
|
// Menu Items
|
||||||
VStack(alignment: .leading, spacing: 15) {
|
VStack(alignment: .leading, spacing: 20) {
|
||||||
Text("CATEGORY").font(.caption).foregroundColor(.secondary)
|
// Section 1
|
||||||
SideMenuButton(icon: "doc.text", title: "Drafts", action: {})
|
VStack(alignment: .leading, spacing: 15) {
|
||||||
SideMenuButton(icon: "bubble.left", title: "My Comments", action: {})
|
SideMenuButton(icon: "person.2.fill", title: "People You May Like", action: {})
|
||||||
SideMenuButton(icon: "clock", title: "History", action: {})
|
SideMenuButton(icon: "star.fill", title: "Fun Fest", action: {})
|
||||||
SideMenuButton(icon: "arrow.down.circle", title: "My Downloads", action: {})
|
SideMenuButton(icon: "lightbulb.fill", title: "Creator Center", action: {})
|
||||||
}
|
}
|
||||||
|
|
||||||
Divider()
|
Divider()
|
||||||
|
|
||||||
// Section 3
|
// Section 2
|
||||||
VStack(alignment: .leading, spacing: 15) {
|
VStack(alignment: .leading, spacing: 15) {
|
||||||
Text("SERVICES").font(.caption).foregroundColor(.secondary)
|
Text("CATEGORY").font(.caption).foregroundColor(.secondary)
|
||||||
SideMenuButton(icon: "shippingbox", title: "Orders", action: {})
|
SideMenuButton(icon: "doc.text", title: "Drafts", action: {})
|
||||||
SideMenuButton(icon: "cart", title: "Cart", action: {})
|
SideMenuButton(icon: "bubble.left", title: "My Comments", action: {})
|
||||||
SideMenuButton(icon: "wallet.pass", title: "Wallet", action: {})
|
SideMenuButton(icon: "clock", title: "History", action: {})
|
||||||
}
|
SideMenuButton(icon: "arrow.down.circle", title: "My Downloads", action: {})
|
||||||
|
}
|
||||||
Divider()
|
|
||||||
|
Divider()
|
||||||
// Section 4
|
|
||||||
VStack(alignment: .leading, spacing: 15) {
|
// Section 3
|
||||||
SideMenuButton(icon: "square.grid.2x2", title: "Applets", action: {})
|
VStack(alignment: .leading, spacing: 15) {
|
||||||
|
Text("SERVICES").font(.caption).foregroundColor(.secondary)
|
||||||
|
SideMenuButton(icon: "shippingbox", title: "Orders", action: {})
|
||||||
|
SideMenuButton(icon: "cart", title: "Cart", action: {})
|
||||||
|
SideMenuButton(icon: "wallet.pass", title: "Wallet", action: {})
|
||||||
|
}
|
||||||
|
|
||||||
|
Divider()
|
||||||
|
|
||||||
|
// Section 4
|
||||||
|
VStack(alignment: .leading, spacing: 15) {
|
||||||
|
SideMenuButton(icon: "square.grid.2x2", title: "Applets", action: {})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
.padding()
|
||||||
}
|
}
|
||||||
.padding()
|
.frame(maxWidth: .infinity, alignment: .leading) // Align to the left
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
@ -71,6 +81,7 @@ struct SideMenuView: View {
|
|||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
.padding()
|
.padding()
|
||||||
|
.padding(.bottom, bottomPadding)
|
||||||
}
|
}
|
||||||
.background(Color(UIColor.systemBackground))
|
.background(Color(UIColor.systemBackground))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user