From ba744407bae1ba782457dea45502bda9b417b027 Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Tue, 25 Oct 2022 21:49:27 -0500 Subject: [PATCH] feat: close peer list when counter is clicked --- src/components/Shell/Shell.tsx | 12 ++++-------- src/components/Shell/ShellAppBar.tsx | 6 +++--- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/components/Shell/Shell.tsx b/src/components/Shell/Shell.tsx index 806a709..1638fb2 100644 --- a/src/components/Shell/Shell.tsx +++ b/src/components/Shell/Shell.tsx @@ -122,8 +122,8 @@ export const Shell = ({ appNeedsUpdate, children, userPeerId }: ShellProps) => { setIsDrawerOpen(true) } - const handlePeerListOpen = () => { - setIsPeerListOpen(true) + const handlePeerListClick = () => { + setIsPeerListOpen(!isPeerListOpen) } const handleLinkButtonClick = async () => { @@ -138,10 +138,6 @@ export const Shell = ({ appNeedsUpdate, children, userPeerId }: ShellProps) => { setIsDrawerOpen(false) } - const handlePeerListClose = () => { - setIsPeerListOpen(false) - } - const handleHomeLinkClick = () => { setIsDrawerOpen(false) } @@ -184,7 +180,7 @@ export const Shell = ({ appNeedsUpdate, children, userPeerId }: ShellProps) => { isPeerListOpen={isPeerListOpen} numberOfPeers={numberOfPeers} title={title} - onPeerListOpen={handlePeerListOpen} + onPeerListClick={handlePeerListClick} /> { diff --git a/src/components/Shell/ShellAppBar.tsx b/src/components/Shell/ShellAppBar.tsx index 0ef3e5a..7c5ff10 100644 --- a/src/components/Shell/ShellAppBar.tsx +++ b/src/components/Shell/ShellAppBar.tsx @@ -50,7 +50,7 @@ interface ShellAppBarProps { isPeerListOpen: boolean numberOfPeers: number title: string - onPeerListOpen: () => void + onPeerListClick: () => void } export const ShellAppBar = ({ @@ -61,7 +61,7 @@ export const ShellAppBar = ({ isPeerListOpen, numberOfPeers, title, - onPeerListOpen, + onPeerListClick, }: ShellAppBarProps) => { return (