From ead998d0ad4a77e74b9107114e54e195511a3559 Mon Sep 17 00:00:00 2001
From: Brendan F <EpicWolverine@users.noreply.github.com>
Date: Wed, 12 Jul 2023 22:02:07 -0700
Subject: Only show debug menu while running locally

---
 src/components/Footer/index.tsx | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

(limited to 'src/components/Footer/index.tsx')

diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx
index 1743133..e2747c3 100644
--- a/src/components/Footer/index.tsx
+++ b/src/components/Footer/index.tsx
@@ -5,6 +5,7 @@ import { Button } from "..";
 import * as Styled from "./index.styled";
 
 export function Footer() {
+  const showDebugButton = location.hostname == "localhost" || location.port == "3000";
   const [showDebugMenu, setShowDebugMenu] = React.useState<boolean>(false);
 
   const toggleDebugMenu = React.useCallback(() => {
@@ -28,14 +29,16 @@ export function Footer() {
           Maciej Synowski
         </Styled.Link>
       </Styled.Text>
-      <Styled.Text>
-        <Button onClick={toggleDebugMenu}><IoBug /> Debug Options</Button><br />
-        {showDebugMenu &&
-          <Button variant="red" onClick={clearLocalStorage}>
-            Clear Local Storage & Reload
-          </Button>
-        }
-      </Styled.Text>
+      {showDebugButton &&
+        <Styled.Text>
+          <Button onClick={toggleDebugMenu}><IoBug /> Debug Options</Button><br />
+          {showDebugMenu &&
+            <Button variant="red" onClick={clearLocalStorage}>
+              Clear Local Storage & Reload
+            </Button>
+          }
+        </Styled.Text>
+      }
     </footer>
   );
 }
-- 
cgit v1.2.3

