Skip to content

Commit 69d82ab

Browse files
authored
feat: animate all notifications upon repository interaction (#1383)
* feat: animate all rows * Update NotificationRow.tsx * Update NotificationRow.tsx * Update NotificationRow.tsx * Update RepositoryNotifications.tsx
1 parent 4cf1ced commit 69d82ab

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/components/NotificationRow.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ import { NotificationHeader } from './notification/NotificationHeader';
2323

2424
interface INotificationRow {
2525
notification: Notification;
26+
isAnimated?: boolean;
2627
isRead?: boolean;
2728
}
2829

2930
export const NotificationRow: FC<INotificationRow> = ({
3031
notification,
32+
isAnimated = false,
3133
isRead = false,
3234
}: INotificationRow) => {
3335
const {
@@ -88,10 +90,9 @@ export const NotificationRow: FC<INotificationRow> = ({
8890
id={notification.id}
8991
className={cn(
9092
'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',
91-
animateExit &&
93+
(isAnimated || animateExit) &&
9294
'translate-x-full opacity-0 transition duration-[350ms] ease-in-out',
93-
showAsRead && Opacity.READ,
94-
isRead && Opacity.READ,
95+
(isRead || showAsRead) && Opacity.READ,
9596
)}
9697
>
9798
<div

src/components/RepositoryNotifications.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export const RepositoryNotifications: FC<IRepositoryNotifications> = ({
117117
<NotificationRow
118118
key={notification.id}
119119
notification={notification}
120+
isAnimated={animateExit}
120121
isRead={showAsRead}
121122
/>
122123
))}

0 commit comments

Comments
 (0)