First stable application according to tutorial
This commit is contained in:
parent
f5e4be85c4
commit
8d451a87b6
33 changed files with 1090 additions and 113 deletions
32
frontend/src/components/Button.js
Normal file
32
frontend/src/components/Button.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
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
|
||||
}) => {
|
||||
const checkButtonStyle = STYLES.includes(buttonStyle)
|
||||
? buttonStyle
|
||||
: STYLES[0];
|
||||
|
||||
const checkButtonSize = SIZES.includes(buttonSize) ? buttonSize : SIZES[0];
|
||||
|
||||
return (
|
||||
<Link to='sign-up' className='btn-mobile'>
|
||||
<button
|
||||
className={`btn ${checkButtonStyle} ${checkButtonSize}`}
|
||||
onClick={onClick}
|
||||
type={type}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
</Link>
|
||||
);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue