@@ -45,9 +45,12 @@ export const NotificationRow: FC<IProps> = ({ notification }) => {
4545 unsubscribeNotification,
4646 } = useContext ( AppContext ) ;
4747 const [ animateExit , setAnimateExit ] = useState ( false ) ;
48+ const [ showAsRead , setShowAsRead ] = useState ( false ) ;
4849
4950 const handleNotification = useCallback ( ( ) => {
50- setAnimateExit ( true ) ;
51+ setAnimateExit ( ! settings . delayNotificationState ) ;
52+ setShowAsRead ( settings . delayNotificationState ) ;
53+
5154 openNotification ( notification ) ;
5255
5356 if ( settings . markAsDoneOnOpen ) {
@@ -102,6 +105,7 @@ export const NotificationRow: FC<IProps> = ({ notification }) => {
102105 'group flex border-b border-gray-100 bg-white px-3 py-2 hover:bg-gray-100 dark:border-gray-darker dark:bg-gray-dark dark:text-white dark:hover:bg-gray-darker' ,
103106 animateExit &&
104107 'translate-x-full opacity-0 transition duration-[350ms] ease-in-out' ,
108+ showAsRead && 'opacity-50 dark:opacity-50' ,
105109 ) }
106110 >
107111 < div
@@ -218,7 +222,8 @@ export const NotificationRow: FC<IProps> = ({ notification }) => {
218222 className = "h-full hover:text-green-500 focus:outline-none"
219223 title = "Mark as Done"
220224 onClick = { ( ) => {
221- setAnimateExit ( true ) ;
225+ setAnimateExit ( ! settings . delayNotificationState ) ;
226+ setShowAsRead ( settings . delayNotificationState ) ;
222227 markNotificationDone ( notification ) ;
223228 } }
224229 >
@@ -239,7 +244,8 @@ export const NotificationRow: FC<IProps> = ({ notification }) => {
239244 className = "h-full hover:text-green-500 focus:outline-none"
240245 title = "Mark as Read"
241246 onClick = { ( ) => {
242- setAnimateExit ( true ) ;
247+ setAnimateExit ( ! settings . delayNotificationState ) ;
248+ setShowAsRead ( settings . delayNotificationState ) ;
243249 markNotificationRead ( notification ) ;
244250 } }
245251 >
0 commit comments