diff --git a/README.md b/README.md index 859da5f56..b6c314405 100644 --- a/README.md +++ b/README.md @@ -14,14 +14,14 @@ brew install --cask gitify Gitify supports macOS, Windows and Linux. -### Prerequisites +### Prerequisites & Libraries -- Node 10+ +- Node 12+ - [Yarn](https://yarnpkg.com/) - [Electron](https://electronjs.org/) - [TypeScript](https://www.typescriptlang.org/) - [React](https://reactjs.org/) -- [Redux](http://redux.js.org/) +- [Tailwind CSS](https://tailwindcss.com/) ### Installation @@ -37,7 +37,7 @@ To watch for changes(`webpack`) in the `src` directory: yarn run watch -To run the actual **electron app**: +To run the **electron app**: yarn start diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 0f9b237de..d578db499 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -1,11 +1,14 @@ import React, { useCallback, useContext, useMemo } from 'react'; -import { shell } from 'electron'; +import { shell, ipcRenderer } from 'electron'; import * as Octicons from '@primer/octicons-react'; import { useHistory } from 'react-router-dom'; import { AppContext } from '../context/App'; import { Constants } from '../utils/constants'; +import { IconCog } from '../icons/Cog'; +import { IconRefresh } from '../icons/Refresh'; import { Logo } from '../components/Logo'; +import { IconQuit } from '../icons/Quit'; export const Sidebar: React.FC = () => { const history = useHistory(); @@ -17,6 +20,10 @@ export const Sidebar: React.FC = () => { shell.openExternal(`https://github.com/${Constants.REPO_SLUG}`); }, []); + const quitApp = useCallback(() => { + ipcRenderer.send('app-quit'); + }, []); + const notificationsCount = useMemo(() => { return notifications.reduce( (memo, account) => memo + account.notifications.length, @@ -51,7 +58,7 @@ export const Sidebar: React.FC = () => { onClick={fetchNotifications} aria-label="Refresh Notifications" > - + )} + {!isLoggedIn && ( + + )} +
- +
diff --git a/src/components/__snapshots__/Sidebar.test.tsx.snap b/src/components/__snapshots__/Sidebar.test.tsx.snap index e368485e8..37c81c3d2 100644 --- a/src/components/__snapshots__/Sidebar.test.tsx.snap +++ b/src/components/__snapshots__/Sidebar.test.tsx.snap @@ -81,6 +81,37 @@ exports[`components/Sidebar.tsx should render itself & its children (logged in)
+
@@ -193,6 +224,37 @@ exports[`components/Sidebar.tsx should render itself & its children (logged out)
+
diff --git a/src/icons/Cog.tsx b/src/icons/Cog.tsx new file mode 100644 index 000000000..578091450 --- /dev/null +++ b/src/icons/Cog.tsx @@ -0,0 +1,26 @@ +import * as React from 'react'; + +export const IconCog = ({ className = '' }: { className?: string }) => { + return ( + + ); +}; diff --git a/src/icons/Refresh.tsx b/src/icons/Refresh.tsx new file mode 100644 index 000000000..605b459c9 --- /dev/null +++ b/src/icons/Refresh.tsx @@ -0,0 +1,26 @@ +import * as React from 'react'; + +export const IconRefresh = ({ className = '' }: { className?: string }) => { + return ( + + ); +}; diff --git a/src/routes/Settings.tsx b/src/routes/Settings.tsx index 39975cc46..f1637cba4 100644 --- a/src/routes/Settings.tsx +++ b/src/routes/Settings.tsx @@ -1,6 +1,5 @@ -const { ipcRenderer, remote } = require('electron'); - import React, { useCallback, useContext } from 'react'; +import { ipcRenderer, remote } from 'electron'; import { useHistory } from 'react-router-dom'; import { ArrowLeftIcon } from '@primer/octicons-react';