From 91223a2f86e3ab61ca54b12a1db2c941d4d5c20f Mon Sep 17 00:00:00 2001 From: amir-kedis Date: Sat, 16 Dec 2023 16:53:28 +0200 Subject: [PATCH 1/3] Button Component --- .../src/assets/styles/components/Button.scss | 24 +++++++++++++++++++ client/src/components/common/Button.jsx | 21 ++++++++++++++++ .../components/landingpage/LandingPage.jsx | 7 ++++++ 3 files changed, 52 insertions(+) create mode 100644 client/src/assets/styles/components/Button.scss create mode 100644 client/src/components/common/Button.jsx diff --git a/client/src/assets/styles/components/Button.scss b/client/src/assets/styles/components/Button.scss new file mode 100644 index 00000000..b21570cb --- /dev/null +++ b/client/src/assets/styles/components/Button.scss @@ -0,0 +1,24 @@ +.Button { + outline: none; + border: none; + padding: 12px 20px; + border-radius: 6px; + + a { + color: inherit; + font-size: 19px; + font-weight: 500; + } + + &--primary { + background-color: var(--primary-100); + color: var(--grey-900); + } + + &--dark { + background-color: var(--primary-900); + color: var(--grey-50); + } + + // TODO: Add more button styles and maybe sizes +} diff --git a/client/src/components/common/Button.jsx b/client/src/components/common/Button.jsx new file mode 100644 index 00000000..0d501194 --- /dev/null +++ b/client/src/components/common/Button.jsx @@ -0,0 +1,21 @@ +import { Link } from "react-router-dom"; +import { PropTypes } from "prop-types"; + +// Styles +import "../../assets/styles/components/Button.scss"; + +export default function Button(props) { + const { children, className, linkTo, ...rest } = props; + + return ( + + ); +} + +Button.propTypes = { + children: PropTypes.node.isRequired, + className: PropTypes.string, + linkTo: PropTypes.string, +}; diff --git a/client/src/components/landingpage/LandingPage.jsx b/client/src/components/landingpage/LandingPage.jsx index f0c006e6..24e7badb 100644 --- a/client/src/components/landingpage/LandingPage.jsx +++ b/client/src/components/landingpage/LandingPage.jsx @@ -1,9 +1,16 @@ import Nav from "../common/nav"; +import Button from "../common/Button"; export default function LandingPage() { return ( <>