@@ -30,25 +30,28 @@ export const RepositoryNotifications: FC<RepositoryNotificationsProps> = ({
3030 const { settings, markNotificationsAsRead, markNotificationsAsDone } =
3131 useAppContext ( ) ;
3232
33- const [ animateExit , setAnimateExit ] = useState ( false ) ;
34- const [ showRepositoryNotifications , setShowRepositoryNotifications ] =
35- useState ( true ) ;
33+ const [ shouldAnimateExitTransition , setShouldAnimateExitTransition ] =
34+ useState ( false ) ;
35+ const [
36+ isRepositoryNotificationsVisible ,
37+ setIsRepositoryNotificationsVisible ,
38+ ] = useState ( true ) ;
3639
3740 const avatarUrl = repoNotifications [ 0 ] . repository . owner . avatarUrl ;
3841 const shouldAnimateExit = shouldRemoveNotificationsFromState ( settings ) ;
3942
4043 const actionMarkAsDone = ( ) => {
41- setAnimateExit ( shouldAnimateExit ) ;
44+ setShouldAnimateExitTransition ( shouldAnimateExit ) ;
4245 markNotificationsAsDone ( repoNotifications ) ;
4346 } ;
4447
4548 const actionMarkAsRead = ( ) => {
46- setAnimateExit ( shouldAnimateExit ) ;
49+ setShouldAnimateExitTransition ( shouldAnimateExit ) ;
4750 markNotificationsAsRead ( repoNotifications ) ;
4851 } ;
4952
5053 const actionToggleRepositoryNotifications = ( ) => {
51- setShowRepositoryNotifications ( ! showRepositoryNotifications ) ;
54+ setIsRepositoryNotificationsVisible ( ! isRepositoryNotificationsVisible ) ;
5255 } ;
5356
5457 const areAllRepoNotificationsRead = repoNotifications . every (
@@ -57,7 +60,7 @@ export const RepositoryNotifications: FC<RepositoryNotificationsProps> = ({
5760
5861 const Chevron = getChevronDetails (
5962 true ,
60- showRepositoryNotifications ,
63+ isRepositoryNotificationsVisible ,
6164 'repository' ,
6265 ) ;
6366
@@ -67,7 +70,7 @@ export const RepositoryNotifications: FC<RepositoryNotificationsProps> = ({
6770 className = { cn (
6871 'group relative pr-1 py-0.5' ,
6972 'bg-gitify-repository' ,
70- animateExit &&
73+ shouldAnimateExitTransition &&
7174 'translate-x-full opacity-0 transition duration-350 ease-in-out' ,
7275 areAllRepoNotificationsRead && Opacity . READ ,
7376 ) }
@@ -95,7 +98,7 @@ export const RepositoryNotifications: FC<RepositoryNotificationsProps> = ({
9598 />
9699 </ Button >
97100
98- { ! animateExit && (
101+ { ! shouldAnimateExitTransition && (
99102 < HoverGroup bgColor = "group-hover:bg-gitify-repository" >
100103 < HoverButton
101104 action = { actionMarkAsRead }
@@ -126,10 +129,10 @@ export const RepositoryNotifications: FC<RepositoryNotificationsProps> = ({
126129 ) }
127130 </ Stack >
128131
129- { showRepositoryNotifications &&
132+ { isRepositoryNotificationsVisible &&
130133 repoNotifications . map ( ( notification ) => (
131134 < NotificationRow
132- isAnimated = { animateExit }
135+ isAnimated = { shouldAnimateExitTransition }
133136 key = { notification . id }
134137 notification = { notification }
135138 />
0 commit comments