diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx index 0dabc3c40..a781204fc 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/Button/Button.tsx @@ -10,7 +10,7 @@ const Button: React.FC = ({ iconLayout = 'leading', id, isFullWidth = false, - onClick, + onClick = (e) => e.preventDefault(), size = 'regular', text = 'click', theme, diff --git a/src/components/Button/types.ts b/src/components/Button/types.ts index 7af9d4e96..df6955414 100644 --- a/src/components/Button/types.ts +++ b/src/components/Button/types.ts @@ -9,7 +9,7 @@ export interface ButtonProps { /** * the function to be called on click */ - onClick: (event: React.MouseEvent) => void; + onClick?: (event: React.MouseEvent) => void; /** * set the button to be interactive, or not diff --git a/src/components/Form/types.ts b/src/components/Form/types.ts index 2ca45e1f2..f48ec8177 100644 --- a/src/components/Form/types.ts +++ b/src/components/Form/types.ts @@ -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 diff --git a/src/components/LinkTo/LinkTo.tsx b/src/components/LinkTo/LinkTo.tsx index 1b1a12608..179e492d3 100644 --- a/src/components/LinkTo/LinkTo.tsx +++ b/src/components/LinkTo/LinkTo.tsx @@ -8,7 +8,7 @@ import { LinkStyled, FlexSpanStyled } from './LinkTo.styles'; const LinkTo: React.FC = ({ address, text, - type, + type = 'external', iconLayout = 'leading', }) => (