Proyectos de Subversion Iphone Microlearning - Inconcert

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
//
2
//  CommentAndRatingImageView.swift
3
//  twogetskills
4
//
5
//  Created by Efrain Yanez Recanatini on 7/28/22.
6
//
7
 
8
import SwiftUI
9
 
10
struct CommentAndRatingImageView: View {
11
 
12
    var capsuleModel : CapsuleModel
13
 
14
 
15
    var body: some View {
16
 
17
            Group {
18
                HStack {
19
                    Spacer()
20
 
21
                    Group {
22
 
19 efrain 23
                        if self.capsuleModel.image.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
1 efrain 24
 
25
 
26
                        Image(uiImage: UIImage(named: "logo") ?? UIImage())
27
                            .resizable()
28
                            .resizable()
29
                            .aspectRatio(contentMode: .fit)
30
 
31
 
32
 
33
                    } else {
34
                        CustomAsyncImage(
19 efrain 35
                            url: URL(string: self.capsuleModel.image.trimmingCharacters(in: .whitespacesAndNewlines))!,
1 efrain 36
                            placeholder: { Text(Config.LANG_COMMON_LOADING).font(.footnote).foregroundColor(.black)},
37
                            image: {
38
                                Image(uiImage: $0).resizable()
39
 
40
 
41
                            }
42
                        )
43
                    }
44
                    }.background(Color("color_window_background"))
45
                        .frame(width: 93, height: 140, alignment: .center)
46
 
47
                    Spacer()
48
                }
49
            }
50
            .background(Color("color_capsule_comment_rating_image_background"))
51
            .cornerRadius(8)
52
            .overlay(
53
                RoundedRectangle(cornerRadius: 8)
54
                    .stroke(Color("color_capsule_comment_rating_image_border"), lineWidth:1)
55
            )
56
            .shadow(color: Color("color_capsule_comment_rating_image_shadow"), radius:4, x: 5, y: 5)
57
            . frame(width: UIScreen.main.bounds.width - 40, height: 151)
58
 
59
    }
60
}
61
 
62
struct CommentAndRatingImageView_Previews: PreviewProvider {
63
    static var capsuleModel = CapsuleModel()
64
 
65
    static var previews: some View {
66
        CommentAndRatingImageView(capsuleModel: capsuleModel)
67
    }
68
}