burger menu profile scroll
This commit is contained in:
		
							parent
							
								
									58e3488a9d
								
							
						
					
					
						commit
						1fdc8dbf45
					
				@ -2,62 +2,72 @@ 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")
 | 
				
			||||||
                    Divider()
 | 
					                            .font(.title2).bold()
 | 
				
			||||||
 | 
					                        Text("@yourusername")
 | 
				
			||||||
                    // Section 2
 | 
					                            .font(.subheadline)
 | 
				
			||||||
                    VStack(alignment: .leading, spacing: 15) {
 | 
					                            .foregroundColor(.secondary)
 | 
				
			||||||
                        Text("CATEGORY").font(.caption).foregroundColor(.secondary)
 | 
					 | 
				
			||||||
                        SideMenuButton(icon: "doc.text", title: "Drafts", action: {})
 | 
					 | 
				
			||||||
                        SideMenuButton(icon: "bubble.left", title: "My Comments", action: {})
 | 
					 | 
				
			||||||
                        SideMenuButton(icon: "clock", title: "History", action: {})
 | 
					 | 
				
			||||||
                        SideMenuButton(icon: "arrow.down.circle", title: "My Downloads", action: {})
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    Divider()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    // Section 3
 | 
					 | 
				
			||||||
                    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: {})
 | 
					 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					                    .padding(.horizontal, 20)
 | 
				
			||||||
 | 
					                    .padding(.top, topPadding)
 | 
				
			||||||
 | 
					                    .padding(.bottom, 20)
 | 
				
			||||||
                    
 | 
					                    
 | 
				
			||||||
                    Divider()
 | 
					 | 
				
			||||||
                    
 | 
					                    
 | 
				
			||||||
                    // Section 4
 | 
					                    // Menu Items
 | 
				
			||||||
                    VStack(alignment: .leading, spacing: 15) {
 | 
					                    VStack(alignment: .leading, spacing: 20) {
 | 
				
			||||||
                        SideMenuButton(icon: "square.grid.2x2", title: "Applets", action: {})
 | 
					                        // Section 1
 | 
				
			||||||
 | 
					                        VStack(alignment: .leading, spacing: 15) {
 | 
				
			||||||
 | 
					                            SideMenuButton(icon: "person.2.fill", title: "People You May Like", action: {})
 | 
				
			||||||
 | 
					                            SideMenuButton(icon: "star.fill", title: "Fun Fest", action: {})
 | 
				
			||||||
 | 
					                            SideMenuButton(icon: "lightbulb.fill", title: "Creator Center", action: {})
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        Divider()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        // Section 2
 | 
				
			||||||
 | 
					                        VStack(alignment: .leading, spacing: 15) {
 | 
				
			||||||
 | 
					                            Text("CATEGORY").font(.caption).foregroundColor(.secondary)
 | 
				
			||||||
 | 
					                            SideMenuButton(icon: "doc.text", title: "Drafts", action: {})
 | 
				
			||||||
 | 
					                            SideMenuButton(icon: "bubble.left", title: "My Comments", action: {})
 | 
				
			||||||
 | 
					                            SideMenuButton(icon: "clock", title: "History", action: {})
 | 
				
			||||||
 | 
					                            SideMenuButton(icon: "arrow.down.circle", title: "My Downloads", action: {})
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        Divider()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        // Section 3
 | 
				
			||||||
 | 
					                        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