aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/button.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/website/ts/components/button.tsx')
-rw-r--r--packages/website/ts/components/button.tsx14
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/website/ts/components/button.tsx b/packages/website/ts/components/button.tsx
index c9785e48c..31a74e599 100644
--- a/packages/website/ts/components/button.tsx
+++ b/packages/website/ts/components/button.tsx
@@ -8,6 +8,7 @@ import { colors } from 'ts/style/colors';
interface ButtonInterface {
bgColor?: string;
+ borderColor?: string;
color?: string;
children?: React.ReactNode | string;
isTransparent?: boolean;
@@ -26,7 +27,7 @@ interface ButtonInterface {
shouldUseAnchorTag?: boolean;
}
-export const Button = (props: ButtonInterface) => {
+export const Button: React.StatelessComponent<ButtonInterface> = (props: ButtonInterface) => {
const { children, href, isWithArrow, to, shouldUseAnchorTag, target } = props;
let linkElem;
@@ -53,16 +54,17 @@ export const Button = (props: ButtonInterface) => {
);
};
-const ButtonBase =
- styled.button <
- ButtonInterface >
- `
+Button.defaultProps = {
+ borderColor: 'rgba(255, 255, 255, .4)',
+};
+
+const ButtonBase = styled.button<ButtonInterface>`
appearance: none;
border: 1px solid transparent;
display: inline-block;
background-color: ${props => props.bgColor || colors.brandLight};
background-color: ${props => (props.isTransparent || props.isWithArrow) && 'transparent'};
- border-color: ${props => props.isTransparent && !props.isWithArrow && 'rgba(255, 255, 255, .4)'};
+ border-color: ${props => props.isTransparent && !props.isWithArrow && props.borderColor};
color: ${props => (props.isAccentColor ? props.theme.linkColor : props.color || props.theme.textColor)};
padding: ${props => !props.isNoPadding && !props.isWithArrow && '18px 30px'};
white-space: ${props => props.isWithArrow && 'nowrap'};