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
//  NotificationListItemView.swift
3
//  twogetskills
4
//
5
//  Created by admin on 8/14/22.
6
//
7
 
8
import SwiftUI
9
 
10
struct NotificationListItemView: View {
11
 
12
    var notification :  UserNotificationModel
17 efrain 13
 
1 efrain 14
 
15
 
16
 
17
    var body: some View {
18
        VStack(spacing: 0 ) {
19
        Group {
20
            HStack {
21
 
22
                VStack(spacing: 0)
23
                {
24
                    HStack {
25
                        Text(notification.title)
26
                            .font(Font.custom(Config.FONT_NAME_BOLD, size: 16))
27
                            .foregroundColor(Color("color_capsule_list_item_title_foreground"))
28
 
29
                        Spacer()
30
 
31
 
32
                        if !notification.command.isEmpty && notification.viewed == 0 {
33
 
17 efrain 34
 
1 efrain 35
                                Image(systemName: "arrowtriangle.right.fill")
36
                                    .resizable()
37
                                    .aspectRatio(contentMode: /*@START_MENU_TOKEN@*/.fill/*@END_MENU_TOKEN@*/)
38
                                    .frame(width: 16, height: 16, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
17 efrain 39
                            .padding(.trailing, 10)
1 efrain 40
                            .foregroundColor(Color("color_capsule_list_item_title_foreground"))
41
 
42
                        } else {
43
 
44
 
17 efrain 45
 
1 efrain 46
                                Image(systemName: "trash")
47
                                    .resizable()
48
                                    .aspectRatio(contentMode: /*@START_MENU_TOKEN@*/.fill/*@END_MENU_TOKEN@*/)
49
                                    .frame(width: 16, height: 16, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
17 efrain 50
                            .padding(.trailing, 10)
1 efrain 51
                            .foregroundColor(Color("color_capsule_list_item_title_foreground"))
52
                        }
53
 
54
                    }
55
                    HStack {
56
                        Text(notification.body)
57
                            .font(Font.custom(Config.FONT_NAME_REGULAR, size: 12))
58
                            .foregroundColor(Color("color_capsule_list_item_description_foreground"))
59
 
60
 
61
                        Spacer()
62
                    }.padding(.top, 3)
63
                    .padding(.bottom, 10)
64
 
65
 
66
                    HStack {
67
 
68
 
69
                        Spacer()
70
 
71
                        Text(notification.timeOn)
72
                            .font(Font.custom(Config.FONT_NAME_REGULAR, size: 12))
73
                            .foregroundColor(Color("color_capsule_list_item_description_foreground"))
74
                            .padding(.trailing, 10)
75
 
76
 
77
 
78
 
79
                    }.padding(.top, 5)
80
                .padding(.bottom, 10)
81
 
82
 
83
 
84
 
85
            }.padding(.top, 10)
86
            .padding(.bottom, 10)
87
 
88
        }
89
 
90
 
91
        Divider()
92
        } .background(Color("color_capsule_list_item_background"))
93
        .padding(.leading, 5)
94
        .padding(.trailing, 5)
95
        }
96
    }
97
}
98
 
99
struct NotificationListItemView_Previews: PreviewProvider {
100
 
101
    static var  notification  = UserNotificationModel( userUuid: "U123", title: "Titulo Notification #1", body: "Description Notification #1", viewed: 0, url: "https://www.google.co.ve", dateOn: "2022-08-12", timeOn: "10:00:00")
102
 
103
    static var previews: some View {
17 efrain 104
        NotificationListItemView(notification: notification)
1 efrain 105
    }
106
}
107