11import React , { useCallback , useContext , useMemo } from 'react' ;
2- import { shell } from 'electron' ;
2+ import { shell , ipcRenderer } from 'electron' ;
33import * as Octicons from '@primer/octicons-react' ;
44import { useHistory } from 'react-router-dom' ;
55
66import { AppContext } from '../context/App' ;
77import { Constants } from '../utils/constants' ;
8+ import { IconCog } from '../icons/Cog' ;
9+ import { IconRefresh } from '../icons/Refresh' ;
810import { Logo } from '../components/Logo' ;
11+ import { IconQuit } from '../icons/Quit' ;
912
1013export const Sidebar : React . FC = ( ) => {
1114 const history = useHistory ( ) ;
@@ -17,6 +20,10 @@ export const Sidebar: React.FC = () => {
1720 shell . openExternal ( `https://github.com/${ Constants . REPO_SLUG } ` ) ;
1821 } , [ ] ) ;
1922
23+ const quitApp = useCallback ( ( ) => {
24+ ipcRenderer . send ( 'app-quit' ) ;
25+ } , [ ] ) ;
26+
2027 const notificationsCount = useMemo ( ( ) => {
2128 return notifications . reduce (
2229 ( memo , account ) => memo + account . notifications . length ,
@@ -51,25 +58,35 @@ export const Sidebar: React.FC = () => {
5158 onClick = { fetchNotifications }
5259 aria-label = "Refresh Notifications"
5360 >
54- < Octicons . SyncIcon size = { 16 } />
61+ < IconRefresh className = "w-3.5 h-3.5" />
5562 </ button >
5663
5764 < button
5865 className = { footerButtonClasses }
5966 onClick = { ( ) => history . push ( '/settings' ) }
6067 aria-label = "Settings"
6168 >
62- < Octicons . GearIcon size = { 16 } />
69+ < IconCog className = "w-4 h-4" />
6370 </ button >
6471 </ >
6572 ) }
6673
74+ { ! isLoggedIn && (
75+ < button
76+ className = { footerButtonClasses }
77+ onClick = { quitApp }
78+ aria-label = "Quit App"
79+ >
80+ < IconQuit className = "w-3.5 h-3.5" />
81+ </ button >
82+ ) }
83+
6784 < div
6885 className = { footerButtonClasses }
6986 onClick = { onOpenBrowser }
7087 aria-label = "View project on GitHub"
7188 >
72- < Octicons . MarkGithubIcon size = { 14 } />
89+ < Octicons . MarkGithubIcon size = { 15 } />
7390 </ div >
7491 </ div >
7592 </ div >
0 commit comments