diff options
| author | Brendan F <EpicWolverine@users.noreply.github.com> | 2023-07-08 01:15:08 -0700 |
|---|---|---|
| committer | Brendan F <EpicWolverine@users.noreply.github.com> | 2023-07-08 01:15:08 -0700 |
| commit | 960c9f8345b091ec6a9f70b27c115e06c9ce4526 (patch) | |
| tree | e9d49985203a541a66dab0cf41a7c0882c8a0fdb | |
| parent | be86abd05f614b8a42c51fd56b68cf529a5e62c5 (diff) | |
Add debug menu and clearing local storage
| -rw-r--r-- | src/components/Footer/index.tsx | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx index 448da54..1743133 100644 --- a/src/components/Footer/index.tsx +++ b/src/components/Footer/index.tsx @@ -1,9 +1,21 @@ import React from "react"; -import { IoHeart } from "react-icons/io5"; +import { IoBug, IoHeart } from "react-icons/io5"; +import { Button } from ".."; import * as Styled from "./index.styled"; export function Footer() { + const [showDebugMenu, setShowDebugMenu] = React.useState<boolean>(false); + + const toggleDebugMenu = React.useCallback(() => { + setShowDebugMenu(show => !show) + }, []); + + const clearLocalStorage = React.useCallback(() => { + localStorage.clear(); + location.reload(); + }, []); + return ( <footer> <Styled.Text> @@ -16,6 +28,14 @@ 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> </footer> ); } |
