Skip to content

Commit

Permalink
Merge pull request #29 from Mar1nka/add-type-to-Button
Browse files Browse the repository at this point in the history
Add type to Button
  • Loading branch information
IharKrasnik authored Jul 22, 2019
2 parents 665a559 + 4f7af4a commit 0761d8a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/client/components/button/button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export const sizes = {
const Button = ({
className,
isLoading,
action,
type,
state,
size,
children,
}) => {
return (
// eslint-disable-next-line react/button-has-type
<button
type="button"
action={action}
type={type}
className={classnames(styles.button, styles[state], styles[size], className, {
[styles.loading]: isLoading,
})}
Expand All @@ -36,7 +36,7 @@ const Button = ({
Button.propTypes = {
className: PropTypes.string,
isLoading: PropTypes.bool,
action: PropTypes.string,
type: PropTypes.string,
children: PropTypes.node,
state: PropTypes.string,
size: PropTypes.string,
Expand All @@ -45,7 +45,7 @@ Button.propTypes = {
Button.defaultProps = {
className: '',
isLoading: false,
action: 'button',
type: 'button',
children: null,
state: states.purple,
size: sizes.medium,
Expand Down
2 changes: 1 addition & 1 deletion src/client/components/form/form.styles.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
margin: var(--distance-600) 0;
}

button[action="submit"] {
button[type="submit"] {
margin-top: var(--distance-600);
}

Expand Down
2 changes: 1 addition & 1 deletion src/client/pages/forgot-password/forgot-password.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default class ForgotPassword extends PureComponent {
<div>
<Button
className={styles.submitBtn}
action="submit"
type="submit"
primary
isLoading={isLoading}
state={states.purple}
Expand Down
2 changes: 1 addition & 1 deletion src/client/pages/reset-password/reset-password.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default class ResetPassword extends PureComponent {
<div>
<Button
className={styles.signin}
action="submit"
type="submit"
state={states.purple}
isLoading={isLoading}
>
Expand Down
2 changes: 1 addition & 1 deletion src/client/pages/signin/signin.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default class Signin extends PureComponent {
<div className={styles.submit}>
<Button
className={styles.signin}
action="submit"
type="submit"
primary
isLoading={isLoading}
state={states.blue}
Expand Down
2 changes: 1 addition & 1 deletion src/client/pages/signup/signup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default class Signup extends PureComponent {

<Button
className={styles.signup}
action="submit"
type="submit"
isLoading={isLoading}
>
Join
Expand Down

0 comments on commit 0761d8a

Please sign in to comment.