Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix link to button optional defaults #96

Merged
merged 3 commits into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
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
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