Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

Rev 11 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

//
//  CompanyListView.swift
//  twogetskills
//
//  Created by Efrain Yanez Recanatini on 7/30/22.
//

import SwiftUI

struct CompanyListView: View {
    @EnvironmentObject var appNavigation : AppNavigation
    
    @ObservedObject var viewModel : CompanyListViewModel = CompanyListViewModel()
    
    private let appData : AppData = AppData.sharedInstance
    
    var body: some View {
        VStack(spacing: 0) {
            HStack {
                Image("logo")
                .resizable()
                .frame(width: 32, height: 32, alignment: .center)
                .aspectRatio(contentMode: .fit)
                .foregroundColor(Color("color_app_bar_foreground"))
                .padding(.leading, 16)
             
                
                Text(Config.LANG_TAB_BAR_BUTTON_COMPANIES)
                .font(Font.custom(Config.FONT_NAME_REGULAR, size: Config.FONT_SIZE_APP_BAR_HEAD1 ))
                .foregroundColor(Color("color_app_bar_foreground"))
                .padding(.leading, 4)
                
                Spacer()

                
            }
            .background(Color("color_app_bar_background"))
            .edgesIgnoringSafeArea(.top)
            .frame(height: 50)
            Divider()
            
            ScrollView {
                LazyVStack  {
                    
      
                    
                    ForEach(0..<self.viewModel.companies.count) { index in
                    
                    
                        CompanyListItemView(companyUuid: self.viewModel.companies[index].uuid)
                            .environmentObject(appNavigation)
                    }
                        
                    
           
                        
                    
                    
                    
                }
            }

        }
    }
}

struct CompanyListView_Previews: PreviewProvider {
    static var previews: some View {
        CompanyListView()
    }
}