@@ -19,7 +19,8 @@ export const Sidebar: React.FC = () => {
1919 const location = useLocation ( ) ;
2020
2121 const { isLoggedIn } = useContext ( AppContext ) ;
22- const { notifications, fetchNotifications } = useContext ( AppContext ) ;
22+ const { notifications, fetchNotifications, isFetching } =
23+ useContext ( AppContext ) ;
2324
2425 const onOpenBrowser = useCallback ( ( ) => {
2526 openExternalLink ( `https://github.com/${ Constants . REPO_SLUG } ` ) ;
@@ -38,10 +39,10 @@ export const Sidebar: React.FC = () => {
3839 } , [ notifications ] ) ;
3940
4041 const sidebarButtonClasses =
41- 'flex justify-evenly items-center bg-transparent border-0 w-full text-sm text-white my-1 py-2 cursor-pointer hover:text-gray-500 focus:outline-none' ;
42+ 'flex justify-evenly items-center bg-transparent border-0 w-full text-sm text-white my-1 py-2 cursor-pointer hover:text-gray-500 focus:outline-none disabled:text-gray-500 disabled:cursor-default ' ;
4243
4344 return (
44- < div className = "flex flex-col fixed left-14 w-14 -ml-14 h-full bg-gray-sidebar overflow-y-auto " >
45+ < div className = "flex flex-col fixed left-14 w-14 -ml-14 h-full bg-gray-sidebar overflow-y-auto" >
4546 < div className = "flex flex-col flex-1 items-center py-4" >
4647 < button
4748 className = "w-5 my-3 mx-auto cursor-pointer outline-none"
@@ -77,8 +78,13 @@ export const Sidebar: React.FC = () => {
7778 navigate ( '/' , { replace : true } ) ;
7879 fetchNotifications ( ) ;
7980 } }
81+ disabled = { isFetching }
8082 >
81- < SyncIcon size = { 16 } aria-label = "Refresh Notifications" />
83+ < SyncIcon
84+ size = { 16 }
85+ aria-label = "Refresh Notifications"
86+ className = { isFetching ? 'animate-spin' : undefined }
87+ />
8288 </ button >
8389
8490 < button
0 commit comments