Skip to content

Commit fb03f31

Browse files
committed
fix for custom button component
1 parent 1bd22c0 commit fb03f31

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/gatsby-theme/src/components/CustomButton.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ import { ButtonProps } from './shared/base.d';
33
import { Flex, Image, Button } from './shared/base';
44

55
export const CustomButton: React.FunctionComponent<
6-
CustomButtonProps,
7-
{ type?: 'github' | 'tutorial' | 'spectrum' | 'default' }
8-
> = ({ type, children, ...buttonProps }) => {
9-
const { icon, bg } = customButtonTypes[type] || customButtonTypes.default;
6+
ButtonProps & { type?: 'github' | 'tutorial' | 'spectrum' | 'default' }
7+
> = ({ type = 'default', children, ...buttonProps }) => {
8+
const { icon, bg } = customButtonTypes[type];
109

1110
if (!type) {
1211
return <Button {...buttonProps}>{children}</Button>;

0 commit comments

Comments
 (0)