2019-03-27 18:50:36 +08:00
|
|
|
import React, { useContext } from 'react';
|
2019-10-25 20:35:29 +08:00
|
|
|
import { AbstractButton } from './AbstractButton';
|
2019-03-27 18:50:36 +08:00
|
|
|
import { ThemeContext } from '../../themes';
|
2019-10-25 20:35:29 +08:00
|
|
|
import { ButtonProps, LinkButtonProps } from './types';
|
2019-03-27 18:50:36 +08:00
|
|
|
|
|
|
|
export const Button: React.FunctionComponent<ButtonProps> = props => {
|
|
|
|
const theme = useContext(ThemeContext);
|
|
|
|
return <AbstractButton {...props} renderAs="button" theme={theme} />;
|
|
|
|
};
|
|
|
|
Button.displayName = 'Button';
|
|
|
|
|
|
|
|
export const LinkButton: React.FunctionComponent<LinkButtonProps> = props => {
|
|
|
|
const theme = useContext(ThemeContext);
|
|
|
|
return <AbstractButton {...props} renderAs="a" theme={theme} />;
|
|
|
|
};
|
|
|
|
LinkButton.displayName = 'LinkButton';
|