@@ -37,11 +37,15 @@ public extension PokitAlertBoxView {
3737 List {
3838 ForEach ( alertContents, id: \. id) { item in
3939 Button ( action: { send ( . 알람_항목_선택했을때( item: item) ) } ) {
40- AlertContent ( item: item)
40+ AlertContent (
41+ item: item,
42+ lastCheckDate: store. lastAlertCheckDate
43+ )
4144 }
4245 . listRowSeparator ( . hidden)
4346 . listRowInsets ( EdgeInsets ( ) )
4447 . onDelete ( deleteAction: { delete ( item) } )
48+ . id ( item. id)
4549 }
4650 . listRowBackground ( Color . pokit ( . bg( . base) ) )
4751 . padding ( . top, 16 )
@@ -76,12 +80,19 @@ private extension PokitAlertBoxView {
7680 }
7781
7882 struct AlertContent : View {
79- var item : AlertItem
80-
81- init ( item: AlertItem ) {
83+ let item : AlertItem
84+ let lastCheckDate : String ?
85+
86+ init ( item: AlertItem , lastCheckDate: String ? ) {
8287 self . item = item
88+ self . lastCheckDate = lastCheckDate
89+ }
90+
91+ private var isUnread : Bool {
92+ guard let lastCheckDate else { return true }
93+ return item. createdAt > lastCheckDate
8394 }
84-
95+
8596 var body : some View {
8697 VStack ( alignment: . leading, spacing: 20 ) {
8798 HStack ( spacing: 16 ) {
@@ -117,6 +128,11 @@ private extension PokitAlertBoxView {
117128 . foregroundStyle ( . pokit( . border( . tertiary) ) )
118129 }
119130 . padding ( . top, 20 )
131+ . background (
132+ isUnread
133+ ? . pokit( . color( . orange( . _50) ) )
134+ : . clear
135+ )
120136 }
121137 }
122138}
0 commit comments