diff --git a/src/App.tsx b/src/App.tsx index bf2a6f7..f8a46a1 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,7 +2,7 @@ import { createBrowserRouter, RouterProvider } from "react-router-dom"; // routes -import ButtonTestRoute from "./routes/ButtonTestRoute"; +import ButtonTestRoute from "@/routes/ButtonTestRoute"; import Test from "./routes/Test"; import DropdownItem from "./components/DropdownItem"; diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 3d46d11..0d48827 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -7,7 +7,7 @@ interface ButtonProps extends React.ButtonHTMLAttributes { text?: string; rounded?: boolean; fill?: boolean; - status?: boolean; + status?: string; fontSize?: string; } @@ -17,13 +17,13 @@ const Button: React.FC = ({ onClick = () => console.log("Clicked"), rounded = false, fill = true, - status = true, + status = "enabled", fontSize = "1em", }) => { const buttonRef = useRef(null); const buttonClassName = `flex flex-row items-center justify-center p-4 ${ - !status + status === "disabled" ? "bg-neutrals-light-200 text-gray-400" : fill ? "bg-primary-main text-white hover:bg-primary-light active:bg-primary-dark " diff --git a/src/routes/ButtonTestRoute.tsx b/src/routes/ButtonTestRoute.tsx index cc10b2d..8800adf 100644 --- a/src/routes/ButtonTestRoute.tsx +++ b/src/routes/ButtonTestRoute.tsx @@ -13,7 +13,7 @@ function ButtonTestRoute() { text={"Button"} rounded={false} fill={true} - status={false} + status={"disabled"} icon={true} /> @@ -25,7 +25,7 @@ function ButtonTestRoute() { text={"Button"} rounded={false} fill={true} - status={false} + status={"disabled"} icon={false} /> @@ -37,7 +37,7 @@ function ButtonTestRoute() { text={"Button"} rounded={false} fill={true} - status={false} + status={"disabled"} icon={true} /> @@ -49,7 +49,7 @@ function ButtonTestRoute() { text={"Button"} rounded={false} fill={true} - status={false} + status={"disabled"} icon={false} /> @@ -61,7 +61,7 @@ function ButtonTestRoute() { text={""} rounded={false} fill={true} - status={false} + status={"disabled"} icon={true} /> @@ -73,7 +73,7 @@ function ButtonTestRoute() { text={""} rounded={true} fill={true} - status={false} + status={"disabled"} icon={true} /> @@ -87,7 +87,7 @@ function ButtonTestRoute() { text={"Button"} rounded={false} fill={true} - status={true} + status={"enabled"} icon={true} /> @@ -99,7 +99,7 @@ function ButtonTestRoute() { text={"Button"} rounded={false} fill={true} - status={true} + status={"enabled"} icon={false} /> @@ -111,7 +111,7 @@ function ButtonTestRoute() { text={"Button"} rounded={false} fill={true} - status={true} + status={"enabled"} icon={true} /> @@ -123,7 +123,7 @@ function ButtonTestRoute() { text={""} rounded={false} fill={true} - status={true} + status={"enabled"} icon={true} /> @@ -135,7 +135,7 @@ function ButtonTestRoute() { text={""} rounded={true} fill={true} - status={true} + status={"enabled"} icon={true} /> @@ -149,7 +149,7 @@ function ButtonTestRoute() { text={"Button"} rounded={false} fill={false} - status={true} + status={"enabled"} icon={true} /> @@ -161,7 +161,7 @@ function ButtonTestRoute() { text={"Button"} rounded={false} fill={false} - status={true} + status={"enabled"} icon={false} /> @@ -173,7 +173,7 @@ function ButtonTestRoute() { text={""} rounded={false} fill={false} - status={true} + status={"enabled"} icon={true} /> @@ -185,7 +185,7 @@ function ButtonTestRoute() { text={""} rounded={true} fill={false} - status={true} + status={"enabled"} icon={true} />