Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
//
2
//  CommentAndRatingCommentsView.swift
3
//  twogetskills
4
//
5
//  Created by Efrain Yanez Recanatini on 7/28/22.
6
//
7
 
8
import SwiftUI
9
 
10
 
11
struct CommentAndRatingCommentListView: View {
8 efrain 12
 
13
    var comments : [CommentAndRatingComment]
14
    @Binding var showProgressView : Bool
1 efrain 15
 
8 efrain 16
 
17
 
1 efrain 18
    var body: some View {
8 efrain 19
 
20
        ZStack {
21
 
22
            if self.showProgressView {
23
                ProgressView()
24
                    .progressViewStyle(CircularProgressViewStyle(tint: Color("color_progress_view_foreground")))
25
                    .scaleEffect(3, anchor: .center).zIndex(100000)
1 efrain 26
            }
8 efrain 27
 
28
            if comments.count == 0 {
29
                CommentAndRatingCommentListEmptyView()
30
            } else {
31
 
32
                ScrollView {
33
                    LazyVStack  {
34
                        ForEach(0..<self.comments.count) { index in
35
                            CommentAndRatingCommentListItem(comment: self.comments[index])
36
                        }
37
 
38
                    }
39
                }
40
            }
1 efrain 41
        }
42
    }
43
}
44
 
45
struct CommentAndRatingCommentListView_Previews: PreviewProvider {
46
 
8 efrain 47
    static var viewModelCommments : CommentAndRatingCommentsViewModel = CommentAndRatingCommentsViewModel()
1 efrain 48
 
8 efrain 49
    @State static var showProgressView : Bool = true
50
 
1 efrain 51
    static var previews: some View {
8 efrain 52
        CommentAndRatingCommentListView(comments: self.viewModelCommments.comments, showProgressView : self.$showProgressView)
1 efrain 53
    }
54
}