diff --git a/Client/src/Components/Button/index.css b/Client/src/Components/Button/index.css new file mode 100644 index 000000000..e69de29bb diff --git a/Client/src/Components/Button/index.jsx b/Client/src/Components/Button/index.jsx new file mode 100644 index 000000000..f357e1dd2 --- /dev/null +++ b/Client/src/Components/Button/index.jsx @@ -0,0 +1,45 @@ +import { Button as MuiButton } from "@mui/material"; +import PropTypes from "prop-types"; + +const levelConfig = { + primary: { + variant: "contained", + color: "primary", + }, + secondary: { + variant: "outlined", + color: "secondary", + }, + tertiary: { + variant: "text", + color: "tertiary", + }, + error: { + variant: "contained", + color: "error", + }, +}; + +/** + * @typedef {Object} Props + * @property {'primary' | 'secondary' | 'tertiary' | 'error'} level - The level of the button + * @property {string} label - The label of the button + * @property {boolean} [disabled] - Whether the button is disabled + */ + +const Button = ({ level, label, disabled }) => { + const { variant, color } = levelConfig[level]; + return ( + + {label} + + ); +}; + +Button.propTypes = { + level: PropTypes.string.isRequired, + label: PropTypes.string.isRequired, + disabled: PropTypes.bool, +}; + +export default Button; diff --git a/Client/src/Pages/Home/index.jsx b/Client/src/Pages/Home/index.jsx index f1c6a947c..849489ff8 100644 --- a/Client/src/Pages/Home/index.jsx +++ b/Client/src/Pages/Home/index.jsx @@ -1,15 +1,33 @@ -import React from 'react' -import DropdownTeamMember from '../../Components/DropdownTeamMember' -import './index.css' - +import React from "react"; +import DropdownTeamMember from "../../Components/DropdownTeamMember"; +import "./index.css"; +import Button from "../../Components/Button"; const Home = () => { - return ( - <> -
Home
- - - ) -} + return ( + <> +
Home
+ +
+

Buttons

+
+
+

Disabled Buttons

+
+
+
+ + ); +}; -export default Home \ No newline at end of file +export default Home; diff --git a/Client/src/index.css b/Client/src/index.css index d761fd0ba..18aa9a223 100644 --- a/Client/src/index.css +++ b/Client/src/index.css @@ -70,4 +70,4 @@ button:focus-visible { button { background-color: #f9f9f9; } -} \ No newline at end of file +}