Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

Rev 23 | Rev 25 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
22 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
23 efrain 13
 
14
 
15
 
22 efrain 16
    let onDelete: () -> Void
17
 
23 efrain 18
 
19
 
22 efrain 20
 
21
    var body: some View {
22
        VStack(spacing: 0 ) {
23
        Group {
24
            HStack {
25
 
26
                VStack(spacing: 0)
27
                {
28
                    HStack {
29
                        Text(notification.title)
24 efrain 30
                            .font(Font.custom(Config.FONT_NAME_BOLD, size: 16))
22 efrain 31
                            .foregroundColor(Color("color_capsule_list_item_title_foreground"))
32
 
33
                        Spacer()
34
 
35
 
36
                            Button(action:  onDelete, label: {
37
                                Image(systemName: "trash")
38
                                    .resizable()
39
                                    .aspectRatio(contentMode: /*@START_MENU_TOKEN@*/.fill/*@END_MENU_TOKEN@*/)
40
                                    .frame(width: 16, height: 16, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
41
                            }).padding(.trailing, 10)
42
                            .foregroundColor(Color("color_capsule_list_item_title_foreground"))
43
 
44
                    }
45
                    HStack {
23 efrain 46
                        Text(notification.body)
22 efrain 47
                            .font(Font.custom(Config.FONT_NAME_REGULAR, size: 12))
48
                            .foregroundColor(Color("color_capsule_list_item_description_foreground"))
49
 
50
 
51
                        Spacer()
52
                    }.padding(.top, 3)
53
                    .padding(.bottom, 10)
54
 
55
 
23 efrain 56
                    HStack {
57
 
58
 
59
                        Spacer()
60
 
61
                        Text(notification.timeOn)
62
                            .font(Font.custom(Config.FONT_NAME_REGULAR, size: 12))
63
                            .foregroundColor(Color("color_capsule_list_item_description_foreground"))
64
                            .padding(.trailing, 10)
65
 
66
 
22 efrain 67
 
23 efrain 68
 
24 efrain 69
                    }.padding(.top, 5)
23 efrain 70
                .padding(.bottom, 10)
22 efrain 71
 
72
 
73
 
23 efrain 74
 
75
            }.padding(.top, 10)
76
            .padding(.bottom, 10)
77
 
22 efrain 78
        }
79
 
80
 
81
        Divider()
82
        } .background(Color("color_capsule_list_item_background"))
83
        .padding(.leading, 5)
84
        .padding(.trailing, 5)
85
        }
86
    }
87
}
88
 
89
struct NotificationListItemView_Previews: PreviewProvider {
90
 
23 efrain 91
    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")
22 efrain 92
 
93
    static var previews: some View {
23 efrain 94
        NotificationListItemView(notification: notification) {}
22 efrain 95
    }
96
}
97