Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

Rev 1 | Rev 11 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 8
Línea 7... Línea 7...
7
 
7
 
Línea 8... Línea 8...
8
import SwiftUI
8
import SwiftUI
Línea 9... Línea -...
9
 
-
 
10
struct CommentAndRatingCommentListItem: View {
-
 
11
    
-
 
12
    var fullname : String
-
 
13
    var added_on : String
9
 
14
    var image : String
-
 
Línea 15... Línea 10...
15
    var rating : Decimal
10
struct CommentAndRatingCommentListItem: View {
16
    var comment : String
11
    
17
    var link_delete : String
12
    var comment : CommentAndRatingComment
18
    
13
    
19
    
14
    
Línea 20... Línea 15...
20
    var body: some View {
15
    var body: some View {
Línea 21... Línea 16...
21
        VStack(spacing: 0 ) {
16
        VStack(spacing: 0 ) {
22
        Group {
17
        Group {
23
            HStack {
18
            HStack {
Línea 33... Línea 28...
33
                           
28
                           
34
                       
29
                       
35
                    
30
                    
36
                } else {
31
                } else {
37
                    CustomAsyncImage(
32
                    CustomAsyncImage(
38
                        url: URL(string: image)!,
33
                        url: URL(string: comment.image)!,
Línea 54... Línea 49...
54
       
49
       
55
                
50
                
56
                VStack(spacing: 0)
51
                VStack(spacing: 0)
57
                {
52
                {
58
                    HStack {
53
                    HStack {
59
                        Text(fullname)
54
                        Text(comment.fullname)
Línea 60... Línea 55...
60
                            .font(Font.custom(Config.FONT_NAME_BOLD, size: 14))
55
                            .font(Font.custom(Config.FONT_NAME_BOLD, size: 14))
Línea 61... Línea 56...
61
                            .foregroundColor(Color("color_capsule_list_item_title_foreground"))
56
                            .foregroundColor(Color("color_capsule_list_item_title_foreground"))
Línea 62... Línea 57...
62
                     
57
                     
63
                        Spacer()
58
                        Spacer()
64
                        
59
                        
65
                        if !link_delete.isEmpty {
60
                        if !comment.link_delete.isEmpty {
Línea 73... Línea 68...
73
                        .foregroundColor(Color("color_capsule_list_item_title_foreground"))
68
                        .foregroundColor(Color("color_capsule_list_item_title_foreground"))
Línea 74... Línea 69...
74
                            
69
                            
75
                        }
70
                        }
76
                    }
71
                    }
77
                    HStack {
72
                    HStack {
78
                        Text(comment)
73
                        Text(comment.comment)
79
                            .font(Font.custom(Config.FONT_NAME_REGULAR, size: 12))
74
                            .font(Font.custom(Config.FONT_NAME_REGULAR, size: 12))
Línea 80... Línea 75...
80
                            .foregroundColor(Color("color_capsule_list_item_description_foreground"))
75
                            .foregroundColor(Color("color_capsule_list_item_description_foreground"))
Línea 89... Línea 84...
89
                
84
                
90
                    
85
                    
91
 
86
 
Línea 92... Línea 87...
92
                    
87
                    
Línea 93... Línea 88...
93
                    HStack {
88
                    HStack {
94
                        FiveStarView(rating: rating, color: Color("color_capsule_list_item_star_foreground"), backgroundColor: Color("color_capsule_list_item_star_background"))               .frame(width: /*@START_MENU_TOKEN@*/100/*@END_MENU_TOKEN@*/, height: 16, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
89
                        FiveStarView(rating: comment.rating, color: Color("color_capsule_list_item_star_foreground"), backgroundColor: Color("color_capsule_list_item_star_background"))               .frame(width: /*@START_MENU_TOKEN@*/100/*@END_MENU_TOKEN@*/, height: 16, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
95
                            .padding(.leading, 8)
90
                            .padding(.leading, 8)
96
                        
91
                        
Línea 120... Línea 115...
120
        }
115
        }
121
    }
116
    }
122
}
117
}
Línea 123... Línea 118...
123
 
118
 
-
 
119
struct CommentAndRatingCommentListItem_Previews: PreviewProvider {
-
 
120
    
-
 
121
    static var comment = CommentAndRatingComment(
-
 
122
        date: "2022-07-28T10:00:00", image: "", fullname: "Santiago Olivera", rating: 3.8, comment: "Comentario de prueba", link_delete: "LINK"
-
 
123
    )
124
struct CommentAndRatingCommentListItem_Previews: PreviewProvider {
124
    
125
    static var previews: some View {
125
    static var previews: some View {
126
        CommentAndRatingCommentListItem(fullname: "Santiago Olivera", added_on: "2022-07-28T10:00:00", image: "", rating: 3.8, comment: "Comentario de prueba", link_delete: "LINK")
126
        CommentAndRatingCommentListItem(comment: comment)
127
    }
127
    }