Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 11 additions & 31 deletions src/components/Button.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,16 @@
// import React from 'react';
// import './Button.css';
// import { Link } from 'react-router-dom';
import React from "react";
import "./Button.css";
import { Link } from "react-router-dom";

// export function Button() {
// return (
// <Link to='sign-up'>
// <button className='btn'>Sign Up</button>
// </Link>
// );
// }

import React from 'react';
import './Button.css';
import { Link } from 'react-router-dom';

const STYLES = ['btn--primary', 'btn--outline', 'btn--test'];

const SIZES = ['btn--medium', 'btn--large'];

export const Button = ({
children,
type,
onClick,
buttonStyle,
buttonSize
}) => {
const checkButtonStyle = STYLES.includes(buttonStyle)
? buttonStyle
: STYLES[0];
const STYLES = ["btn--primary", "btn--outline", "btn--test"];
const SIZES = ["btn--medium", "btn--large"];

const Button = React.memo(({ 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'>
<Link to="/sign-up" className="btn-mobile">
<button
className={`btn ${checkButtonStyle} ${checkButtonSize}`}
onClick={onClick}
Expand All @@ -42,4 +20,6 @@ export const Button = ({
</button>
</Link>
);
};
});

export default Button;