main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
596 bytes
|
Line | |
---|
1 | import React from "react";
|
---|
2 | import "./Button.css";
|
---|
3 | import { Link } from "react-router-dom";
|
---|
4 |
|
---|
5 | const STYLES = ["btn--primary", "btn--outline", "btn--test"];
|
---|
6 |
|
---|
7 | const SIZES = ["btn--medium", "btn--large"];
|
---|
8 |
|
---|
9 | export const Button = ({ children, type, onClick, buttonStyle, buttonSize }) => {
|
---|
10 | const checkButtonStyle = STYLES.includes(buttonStyle) ? buttonStyle : STYLES[0];
|
---|
11 |
|
---|
12 | const checkButtonSize = SIZES.includes(buttonSize) ? buttonSize : SIZES[0];
|
---|
13 |
|
---|
14 | return (
|
---|
15 | <button className={`btn ${checkButtonStyle} ${checkButtonSize}`} onClick={onClick} type={type}>
|
---|
16 | {children}
|
---|
17 | </button>
|
---|
18 | );
|
---|
19 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.