Skip to content

Commit

Permalink
Merge pull request #52 from Giveth/add-type-to-button
Browse files Browse the repository at this point in the history
fix: add type to button
  • Loading branch information
MohammadPCh authored Jun 9, 2022
2 parents 7e1979c + 5ad7744 commit 2595699
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/buttons/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export const Button: FC<IButtonProps> = ({
onClick,
icon,
className,
type = 'button',
}) => {
return (
<ButtonContainer
Expand All @@ -101,6 +102,7 @@ export const Button: FC<IButtonProps> = ({
disabled={disabled}
onClick={onClick}
className={className}
type={type}
>
<LoadingContainer loading={+loading}>
{loading && (
Expand Down
2 changes: 2 additions & 0 deletions src/components/buttons/OulineButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const OulineButton: FC<IButtonProps> = ({
onClick,
icon,
className,
type = 'button',
}) => {
return (
<ButtonContainer
Expand All @@ -64,6 +65,7 @@ export const OulineButton: FC<IButtonProps> = ({
onClick={onClick}
className={className}
size={size}
type={type}
>
<ButtonText size={size}>{label}</ButtonText>
{icon && icon}
Expand Down
1 change: 1 addition & 0 deletions src/components/buttons/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ export interface IButtonContainerProps {
export interface IButtonProps extends IButtonContainerProps {
loading?: boolean;
label: string;
type?: 'button' | 'submit' | 'reset';
}

0 comments on commit 2595699

Please sign in to comment.