Bachelorthesis_Code/frontend/src/components/Button.js
cami 04cdc9dd7e Added various css things
- Designed login and register buttons
- removed some unnecessary css things
- changed some small things in the design
2021-06-23 03:16:09 +02:00

35 lines
712 B
JavaScript

import React from "react";
import "./Button.css";
import { Link } from "react-router-dom";
const STYLES = ["btn--primary", "btn--outline"];
const SIZES = ["btn--medium", "btn--large"];
export const Button = ({
children,
type,
onClick,
buttonStyle,
buttonSize,
newTo,
}) => {
const checkButtonStyle = STYLES.includes(buttonStyle)
? buttonStyle
: STYLES[0];
const checkButtonSize = SIZES.includes(buttonSize) ? buttonSize : SIZES[0];
return (
<Link to={newTo || "/"} className="btn-mobile">
<button
className={`btn ${checkButtonStyle} ${checkButtonSize}`}
onClick={onClick}
type={type}
>
{children}
</button>
</Link>
);
};