Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/yale-swe/f23-here into main
Browse files Browse the repository at this point in the history
  • Loading branch information
TracyL5982 committed Nov 11, 2023
2 parents 60a8c34 + cf532fb commit 2f011bb
Showing 1 changed file with 7 additions and 42 deletions.
49 changes: 7 additions & 42 deletions app/newHere1/newHere/Profile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,10 @@

import SwiftUI

//struct ContentView: View {
// @State private var isShowingProfile = false
//
// var body: some View {
// NavigationView {
// ScrollView {
// VStack {
// Button(action: {
// isShowingProfile.toggle()
// }) {
// Text("Show Profile")
// .font(.headline)
// .padding()
// .background(Color.blue)
// .foregroundColor(.white)
// .cornerRadius(10)
// }
// }
// }
// .navigationBarTitle("Home", displayMode: .inline)
// }
// .sheet(isPresented: $isShowingProfile) {
// ProfilePopup(isPresented: $isShowingProfile) // Pass the binding to control visibility
// }
// }
//}


let apiString = "https://here-swe.vercel.app/auth/user"
let apiKey = "qe5YT6jOgiA422_UcdbmVxxG1Z6G48aHV7fSV4TbAPs"
let userId = UserDefaults.standard.string(forKey: "UserId") ?? ""
let userName = UserDefaults.standard.string(forKey: "UserName") ?? ""

struct ProfilePopup: View {
@Binding var isPresented: Bool // Added binding to control visibility
Expand Down Expand Up @@ -75,20 +51,14 @@ struct ProfilePopup: View {
PostGrid()
}
.sheet(isPresented: $isShowingFriends) {
// Friends.swift => Friends struct
Friends(isPresented: $isShowingFriends, userId: $userId) // Pass the binding to control visibility
}
}
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .top) // Adjust size and alignment
}
}


//struct ContentView_Previews: PreviewProvider {
// static var previews: some View {
// ContentView()
// }
//}

struct ProfileHeader: View {
var body: some View {
HStack {
Expand All @@ -100,14 +70,13 @@ struct ProfileHeader: View {
.padding()

VStack(alignment: .leading, spacing: 8) {
Text("Username")

Text(userName)
.font(.title)
.bold()

Text("Bio or description")
.font(.subheadline)

// ProfileButtons()

}

Expand Down Expand Up @@ -198,7 +167,3 @@ struct PostGrid: View {
.padding()
}
}

//#Preview {
// ContentView()
//}

0 comments on commit 2f011bb

Please sign in to comment.