diff --git a/src/Button.js b/src/Button.js new file mode 100644 index 0000000..5bfc629 --- /dev/null +++ b/src/Button.js @@ -0,0 +1,32 @@ +import React from 'react'; +import "./css/Button.css"; + +import Loader from "./puff-loader.svg"; + +export default function Button(props) { + let newProps = {...props}; + delete newProps["icon"]; + delete newProps["className"]; + delete newProps["children"]; + delete newProps["loading"]; + delete newProps["disabled"]; + return ( + + ) +} diff --git a/src/LinkButton.js b/src/LinkButton.js new file mode 100644 index 0000000..e61f7f0 --- /dev/null +++ b/src/LinkButton.js @@ -0,0 +1,36 @@ +import React from 'react'; +import { Link } from 'react-router-dom'; +import "./css/Button.css"; + +import Loader from "./puff-loader.svg"; + +export default function Button(props) { + let newProps = { ...props }; + delete newProps["icon"]; + delete newProps["className"]; + delete newProps["children"]; + delete newProps["disabled"]; + delete newProps["loading"]; + delete newProps["disabled"]; + return ( + + {props.loading ? Loading... : ""} + {props.icon + ? + + {props.icon} + + : + "" + } + + {props.children} + + + ) +} diff --git a/src/css/Button.css b/src/css/Button.css new file mode 100644 index 0000000..8fc99be --- /dev/null +++ b/src/css/Button.css @@ -0,0 +1,110 @@ +.button { + text-decoration: none; + background-color: var(--primary-color); + color: var(--text-color); + padding: 10px 16px; + border-radius: 30px; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: center; + transition: 0.2s; + width: max-content; +} + +nav .button { + margin: 4px; +} + +main .button { + margin-top: 8px; + margin-bottom: 8px; +} + +.button > span { + display: flex; +} + +.button > span.button-children { + margin-bottom: -2px; +} + +.button--icon-and-text > span.button-children { + margin-left: 5px; +} + +.button:hover { + background-color: var(--primary-color-tinted); +} + +.button.button--round { + padding: 8px; +} + +.page-header .button.button--round { + padding: 10px; +} + +.button.button--disabled { + cursor: default; + background-color: var(--primary-color-dark); + color: var(--text-color-tinted); +} + +.button--loading > span { + opacity: 0; +} + +.button--loading > img { + height: 24px; + margin: auto; + position: absolute; +} +.button.button--no-background { + background: none; + padding: 10px; +} + +.button-container { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: flex-end; +} + +.button-container > .button { + margin-left: 4px; + margin-right: 4px; +} + +.button-container > .button:first-child { + margin-left: 0; +} + +.button-container > .button:last-child { + margin-right: 0; +} + +.buttons--mobile { + display: none; +} + +@media screen and (max-width: 660px) { + .button.button--hide-text-mobile { + background: none; + padding: 10px; + } + .button.button--hide-text-mobile .button-children { + display: none; + } +} + +@media screen and (max-width: 520px) { + .buttons--mobile { + display: flex; + } + .buttons--desktop { + display: none; + } +} \ No newline at end of file