From 43b47a68631cea954c4fd48d131157f1b3738b50 Mon Sep 17 00:00:00 2001 From: Hugh Lilly Date: Thu, 14 Sep 2023 14:31:31 +1200 Subject: [PATCH] feat: settings button toggle between settings and notifications (#553) Co-authored-by: Afonso Jorge Ramos --- src/components/Sidebar.tsx | 16 +++++++++++++--- src/hooks/useNotifications.ts | 8 ++++++-- src/routes/LoginWithToken.tsx | 6 +++++- src/routes/Settings.test.tsx | 2 +- src/routes/__snapshots__/Settings.test.tsx.snap | 2 +- src/utils/auth.ts | 2 +- 6 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index c5cf4e712..5081e077b 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -1,7 +1,7 @@ import * as Octicons from '@primer/octicons-react'; import { ipcRenderer, shell } from 'electron'; import React, { useCallback, useContext, useMemo } from 'react'; -import { useHistory } from 'react-router-dom'; +import { useHistory, useLocation } from 'react-router-dom'; import { Logo } from '../components/Logo'; import { AppContext } from '../context/App'; @@ -12,6 +12,7 @@ import { Constants } from '../utils/constants'; export const Sidebar: React.FC = () => { const history = useHistory(); + const location = useLocation(); const { isLoggedIn } = useContext(AppContext); const { notifications, fetchNotifications } = useContext(AppContext); @@ -64,7 +65,10 @@ export const Sidebar: React.FC = () => { <>