No Description

ProfileView.swift 706B

123456789101112131415161718192021222324252627282930
  1. //
  2. // ProfileView.swift
  3. // Comedores Sociales
  4. //
  5. // Created by Hector Carrion on 12/16/20.
  6. //
  7. import SwiftUI
  8. struct ProfileView: View {
  9. @EnvironmentObject var profileVM: ProfileViewModel
  10. var body: some View {
  11. VStack(alignment: .leading, spacing: 20) {
  12. if profileVM.response == .unfetched {
  13. ProfileSummary(profile: Profile.default)
  14. } else if profileVM.response == .success {
  15. ProfileSummary(profile: profileVM.profile)
  16. }
  17. }
  18. .padding()
  19. }
  20. }
  21. struct ProfileView_Previews: PreviewProvider {
  22. static var previews: some View {
  23. ProfileView()
  24. }
  25. }