@@ -42,7 +42,13 @@ import TimerIcon from './timerIcon';
4242
4343const Card = ( props : NotificationCardProps ) : ReactElement => {
4444 const { onCardClick, notification, cardProps = { } , styles, onDelete, darkMode } = props ;
45- const { hideAvatar, disableAutoMarkAsRead, hideDelete = false , onAvatarClick } = cardProps ;
45+ const {
46+ hideAvatar,
47+ disableAutoMarkAsRead,
48+ hideDelete = false ,
49+ onAvatarClick,
50+ deleteIcon = null
51+ } = cardProps ;
4652 const { markAsRead } = useSiren ( ) ;
4753
4854 const opacity = useRef ( new Animated . Value ( 1 ) ) . current ;
@@ -99,7 +105,6 @@ const Card = (props: NotificationCardProps): ReactElement => {
99105 } , [ styles , darkMode , imageSource , onAvatarClick ] ) ;
100106
101107 const onDeleteItem = async ( ) : Promise < void > => {
102-
103108 const isSuccess = await onDelete ( notification . id , false ) ;
104109
105110 if ( isSuccess )
@@ -136,9 +141,10 @@ const Card = (props: NotificationCardProps): ReactElement => {
136141 < Text numberOfLines = { 2 } style = { [ styles . cardTitle , style . cardTitle ] } >
137142 { notification . message ?. header }
138143 </ Text >
139- { ! hideDelete && (
140- < CloseIcon onDelete = { onDeleteItem } notification = { notification } styles = { styles } />
141- ) }
144+ { ! hideDelete &&
145+ ( deleteIcon || (
146+ < CloseIcon onDelete = { onDeleteItem } notification = { notification } styles = { styles } />
147+ ) ) }
142148 </ View >
143149 { Boolean ( notification . message ?. subHeader ) && (
144150 < Text numberOfLines = { 2 } style = { [ style . cardSubTitle , styles . cardSubTitle ] } >
@@ -163,18 +169,18 @@ const Card = (props: NotificationCardProps): ReactElement => {
163169const style = StyleSheet . create ( {
164170 cardWrapper : {
165171 flexDirection : 'row' ,
166- alignItems : 'center' ,
172+ alignItems : 'center'
167173 } ,
168174 cardContainer : {
169175 width : '100%' ,
170- flexDirection : 'row' ,
176+ flexDirection : 'row'
171177 } ,
172178 cardIconContainer : {
173179 paddingLeft : 6 ,
174- paddingRight : 6 ,
180+ paddingRight : 6
175181 } ,
176182 cardTitle : {
177- paddingBottom : 4 ,
183+ paddingBottom : 4
178184 } ,
179185 icon : {
180186 width : '100%' ,
@@ -193,18 +199,18 @@ const style = StyleSheet.create({
193199 flex : 1 ,
194200 width : '100%' ,
195201 paddingRight : 6 ,
196- paddingLeft : 6 ,
202+ paddingLeft : 6
197203 } ,
198204 cardDescription : {
199- paddingBottom : 10 ,
205+ paddingBottom : 10
200206 } ,
201207 cardSubTitle : {
202208 paddingBottom : 6
203209 } ,
204210 cardFooterRow : {
205211 flexDirection : 'row' ,
206212 justifyContent : 'space-between' ,
207- alignItems : 'center' ,
213+ alignItems : 'center'
208214 } ,
209215 dateStyle : {
210216 paddingLeft : 3
0 commit comments