diff options
| author | Brendan F <EpicWolverine@users.noreply.github.com> | 2023-07-12 22:02:07 -0700 |
|---|---|---|
| committer | Brendan F <EpicWolverine@users.noreply.github.com> | 2023-07-12 22:02:07 -0700 |
| commit | ead998d0ad4a77e74b9107114e54e195511a3559 (patch) | |
| tree | ae09ca0461dc3acb9a4881d2fec45d066c64fb62 /src | |
| parent | 6688918a53a451f8629bb6ee0a62dee0b118d724 (diff) | |
Only show debug menu while running locally
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/Footer/index.tsx | 19 |
1 files changed, 11 insertions, 8 deletions
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> ); } |
