Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
GolnazCh committed Nov 28, 2023
1 parent 3544a20 commit ca632dc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
Binary file not shown.
15 changes: 8 additions & 7 deletions UpgradeUpsell/Views/settings/ProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct ProfileView: View {
Text("Profile").bold().font(.title).foregroundColor(.brown)
Spacer()
}
Form{
// Form{
VStack {
if let selectedImage = selectedImage {
Image(uiImage: selectedImage)
Expand Down Expand Up @@ -68,7 +68,7 @@ struct ProfileView: View {

FormSection(header: "Personal Details") {
TextField("Full Name", text: $nameFromUI)
.padding(.horizontal, 10)
.padding(.horizontal, 5)
.frame(width: 280, height: 30)
.border(Color.gray, width: 1)

Expand All @@ -86,15 +86,15 @@ struct ProfileView: View {
FormSection(header: "Your Rating") {
RatingView(rating: rating)
.frame(maxWidth: .infinity)
.padding()
// .padding()
.background(Color(UIColor.systemBackground))
.cornerRadius(8)
}
}

FormSection(header: "Contact Information") {
TextField("Company", text: $companyFromUI)
.padding(.horizontal, 10)
.padding(.horizontal, 5)
.frame(width: 280, height: 30)
.border(Color.gray, width: 1)

Expand All @@ -104,15 +104,16 @@ struct ProfileView: View {
.border(Color.gray, width: 1)

TextField("Phone Number", text: $contactNumberFromUI)
.padding(.horizontal, 10)
.padding(.horizontal, 5)
.frame(width: 280, height: 30)
.border(Color.gray, width: 1)
}

if let err = errorMsg {
Text(err).foregroundColor(Color.red).bold()
}
}
// }
Spacer()
HStack{
Button(action: { //Validate the data such as no mandatory inputs, password rules, etc.
//
Expand Down Expand Up @@ -186,7 +187,7 @@ struct ProfileView: View {
}
Spacer()
}
.padding(.horizontal, 10)
.padding(.horizontal, 5)
.onAppear() {
if let currentUser = dbHelper.userProfile{
self.email = currentUser.email
Expand Down
32 changes: 17 additions & 15 deletions UpgradeUpsell/Views/settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ struct SettingsView: View {
VStack {
Form {
Section(header: Text("Preferences")) {
// Picker("Theme", selection: $themeFromUI) {
// Text("Light").tag("light")
// Text("Dark").tag("dark")
// }
// Picker("Theme", selection: $themeFromUI) {
// Text("Light").tag("light")
// Text("Dark").tag("dark")
// }

Toggle("Dark Mode", isOn: Binding(
get: { themeManager.selectedTheme == "dark" },
set: { _ in themeManager.toggleTheme() }
))
.padding()
get: { themeManager.selectedTheme == "dark" },
set: { _ in themeManager.toggleTheme() }
))
.padding()

Picker("Language", selection: $langFromUI) {
Text("English")//.tag("en_CA")
Expand Down Expand Up @@ -100,7 +100,7 @@ struct SettingsView: View {
}else if self.role == "Owner"{
self.rootScreen = .Home
} else if self.role == "Admin"{
self.rootScreen = .Admin
self.rootScreen = .Admin

} else if self.role == "Realtor"

Expand All @@ -111,7 +111,7 @@ struct SettingsView: View {
Text("Back")
}.buttonStyle(.borderedProminent)
}

Section(header: Text("Account")) {
Button(action:{

Expand Down Expand Up @@ -139,11 +139,11 @@ struct SettingsView: View {
} else if self.role == "Realtor"
{
self.rootScreen = .RealtorHome

} else if self.role == "Admin"{
self.rootScreen = .Admin
}

//self.presentationMode.wrappedValue.dismiss()
}) {
Text("< Back")
Expand All @@ -154,9 +154,9 @@ struct SettingsView: View {
self.role = role
}
dbHelper.getPreferencesFromFirestore(forUserID: dbHelper.userProfile?.id! ?? ""){ (userPref, error) in
// guard let userPref = dbHelper.userPrefrences else{
// return
// }
// guard let userPref = dbHelper.userPrefrences else{
// return
// }
if let error = error{

}else if let userPref = userPref {
Expand All @@ -169,6 +169,7 @@ struct SettingsView: View {
}
}
}

}
.alert(isPresented: $showingDeleteAlert) {
Alert(
Expand All @@ -194,6 +195,7 @@ struct SettingsView: View {
secondaryButton: .cancel()
)
}
Spacer()
}
}

Expand Down

0 comments on commit ca632dc

Please sign in to comment.