webapp
Форк от omaltsev/webapp
45 строк · 962.0 Байт
1// import React from 'react';
2// import './Button.css';
3// import { Link } from 'react-router-dom';
4
5// export function Button() {
6// return (
7// <Link to='sign-up'>
8// <button className='btn'>Sign Up</button>
9// </Link>
10// );
11// }
12
13import React from 'react';14import './Button.css';15import { Link } from 'react-router-dom';16
17const STYLES = ['btn--primary', 'btn--outline', 'btn--test'];18
19const SIZES = ['btn--medium', 'btn--large'];20
21export const Button = ({22children,23type,24onClick,25buttonStyle,26buttonSize
27}) => {28const checkButtonStyle = STYLES.includes(buttonStyle)29? buttonStyle30: STYLES[0];31
32const checkButtonSize = SIZES.includes(buttonSize) ? buttonSize : SIZES[0];33
34return (35<Link to='/sign-up' className='btn-mobile'>36<button37className={`btn ${checkButtonStyle} ${checkButtonSize}`}38onClick={onClick}39type={type}40>41{children}42</button>43</Link>44);45};46