Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

Rev 1 | Autoría | Ultima modificación | Ver Log |

//
//  CommentAndRatingCommentsView.swift
//  twogetskills
//
//  Created by Efrain Yanez Recanatini on 7/28/22.
//

import SwiftUI


struct CommentAndRatingCommentListView: View {
    
    var comments : [CommentAndRatingComment]
    @Binding var showProgressView : Bool

    
    
    var body: some View {
        
        ZStack {
        
            if self.showProgressView {
                ProgressView()
                    .progressViewStyle(CircularProgressViewStyle(tint: Color("color_progress_view_foreground")))
                    .scaleEffect(3, anchor: .center).zIndex(100000)
            }
            
            if comments.count == 0 {
                CommentAndRatingCommentListEmptyView()
            } else {
            
                ScrollView {
                    LazyVStack  {
                        ForEach(0..<self.comments.count) { index in
                            CommentAndRatingCommentListItem(comment: self.comments[index])
                        }
                        
                    }
                }
            }
        }
    }
}

struct CommentAndRatingCommentListView_Previews: PreviewProvider {
    
    static var viewModelCommments : CommentAndRatingCommentsViewModel = CommentAndRatingCommentsViewModel()
    
    @State static var showProgressView : Bool = true

    static var previews: some View {
        CommentAndRatingCommentListView(comments: self.viewModelCommments.comments, showProgressView : self.$showProgressView)
    }
}