Skip to content

Commit

Permalink
Merge pull request #96 from web3ui/fix-LinkTo-Button-optional-defaults
Browse files Browse the repository at this point in the history
Fix link to button optional defaults
  • Loading branch information
locothedev committed Jan 25, 2022
2 parents 7e8b8e8 + c8efcd7 commit 0323611
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Button: React.FC<ButtonProps> = ({
iconLayout = 'leading',
id,
isFullWidth = false,
onClick,
onClick = (e) => e.preventDefault(),
size = 'regular',
text = 'click',
theme,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface ButtonProps {
/**
* the function to be called on click
*/
onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;

/**
* set the button to be interactive, or not
Expand Down
2 changes: 1 addition & 1 deletion src/components/Form/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface FormProps {
/**
* Pass all the props a button could use
*/
buttonConfig: ButtonProps;
buttonConfig?: ButtonProps;

/**
* when the form passes validation the data is returned
Expand Down
2 changes: 1 addition & 1 deletion src/components/LinkTo/LinkTo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { LinkStyled, FlexSpanStyled } from './LinkTo.styles';
const LinkTo: React.FC<LinkToProps> = ({
address,
text,
type,
type = 'external',
iconLayout = 'leading',
}) => (
<LinkStyled
Expand Down
2 changes: 1 addition & 1 deletion src/components/LinkTo/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface LinkToProps {
/**
* set to an email link or a link to another website
*/
type: TTypeState;
type?: TTypeState;

/**
* set the position of the icon, or icon only
Expand Down

0 comments on commit 0323611

Please sign in to comment.