From ab2525ad95e31d8b5e0f3e1ca886c77a7bdeb917 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Sun, 17 Dec 2023 23:49:17 +0800 Subject: [PATCH] Separate button icons and buttons themselves to address mobile issue of buttons not functioning when clicking the enveloped icon --- src/Components/Drawer/Drawer.tsx | 98 ++++++++++---------- src/Components/DrawerButton/DrawerButton.tsx | 28 +++--- 2 files changed, 61 insertions(+), 65 deletions(-) diff --git a/src/Components/Drawer/Drawer.tsx b/src/Components/Drawer/Drawer.tsx index 1360ac5..a495de6 100644 --- a/src/Components/Drawer/Drawer.tsx +++ b/src/Components/Drawer/Drawer.tsx @@ -56,55 +56,55 @@ export default function Drawer() { marginBottom: 8, }} /> - { - navigate("/dashboard"); - }} - icon={ - - } - label={"Dashboard"} - /> - { - navigate("/"); - await dispatch(auth_toggle()); - await setAccessToken(""); - await setRefreshToken(""); - toast("Logged out", { - position: "top-right", - autoClose: 2000, - hideProgressBar: false, - closeOnClick: true, - pauseOnHover: true, - draggable: true, - progress: undefined, - theme: "light", - }); - }} - icon={ - - } - label={"Log out"} - /> +
+ + { + navigate("/dashboard"); + }} + label={"Dashboard"} + /> +
+
+ + { + navigate("/"); + await dispatch(auth_toggle()); + await setAccessToken(""); + await setRefreshToken(""); + toast("Logged out", { + position: "top-right", + autoClose: 2000, + hideProgressBar: false, + closeOnClick: true, + pauseOnHover: true, + draggable: true, + progress: undefined, + theme: "light", + }); + }} + label={"Log out"} + /> +
); } diff --git a/src/Components/DrawerButton/DrawerButton.tsx b/src/Components/DrawerButton/DrawerButton.tsx index 22fbf44..4cc04c9 100644 --- a/src/Components/DrawerButton/DrawerButton.tsx +++ b/src/Components/DrawerButton/DrawerButton.tsx @@ -5,7 +5,6 @@ import { colors } from "../../styles"; export interface props { onClick: React.MouseEventHandler; children?: React.ReactNode; - icon?: React.ReactNode; label: string; } export default function DrawerButton(props: props) { @@ -23,8 +22,8 @@ export default function DrawerButton(props: props) { onMouseLeave={() => setClicked(false)} style={{ borderRadius: 24, - minWidth: "128px", - maxWidth: "128px", + minWidth: "192px", + maxWidth: "192px", borderColor: colors.button_border, borderStyle: "solid", borderWidth: "2px", @@ -34,21 +33,18 @@ export default function DrawerButton(props: props) { paddingLeft: "4px", marginBottom: "4px", marginTop: "4px", - backgroundColor: clicked ? colors.button_light : colors.button_dark, + backgroundColor: clicked ? colors.button_dark : colors.button_light, }} > -
- {clicked ? <> : props.icon} -

- {props.label} -

-
+

+ {props.label} +

);