Rev 23 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
//// NotificationListItemView.swift// twogetskills//// Created by admin on 8/14/22.//import SwiftUIstruct NotificationListItemView: View {var notification : UserNotificationModellet onDelete: () -> Void/*init(notification : UserNotificationModel){let formatterService = DateFormatter()formatterService.dateFormat = Constants.FORMAT_DATETIME_SERVICEif let date = formatterService.date(from: notification.addedOn) {let dateFormatterUser = DateFormatter()dateFormatterUser.dateFormat = Constants.FORMAT_DATE_TIME_24self.addedOnToUser = dateFormatterUser.string(from: date)}*/var body: some View {VStack(spacing: 0 ) {Group {HStack {VStack(spacing: 0){HStack {Text(notification.title).font(Font.custom(Config.FONT_NAME_BOLD, size: 14)).foregroundColor(Color("color_capsule_list_item_title_foreground"))Spacer()Button(action: onDelete, label: {Image(systemName: "trash").resizable().aspectRatio(contentMode: /*@START_MENU_TOKEN@*/.fill/*@END_MENU_TOKEN@*/).frame(width: 16, height: 16, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)}).padding(.trailing, 10).foregroundColor(Color("color_capsule_list_item_title_foreground"))}HStack {Text(notification.description).font(Font.custom(Config.FONT_NAME_REGULAR, size: 12)).foregroundColor(Color("color_capsule_list_item_description_foreground"))Spacer()}.padding(.top, 3).padding(.bottom, 10)}.padding(.top, 10).padding(.bottom, 10)}Divider()} .background(Color("color_capsule_list_item_background")).padding(.leading, 5).padding(.trailing, 5)}}}struct NotificationListItemView_Previews: PreviewProvider {static var notification = UserNotificationModel( userUuid: "U123", title: "Titulo Notification #1", description: "Description Notification #1", viewed: 0, url: "https://www.google.co.ve", addedOn: "2022-08-12T10:00:00")static var previews: some View {NotificationListItemView(notification: notification) {}}}