From 9f2ab40b7602bc3df26ebb093b484b9917768f69 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 7 Jun 2019 11:25:54 +0200 Subject: Make buttons flexible in height --- packages/forms/src/button/index.tsx | 8 +++----- packages/forms/src/input/index.tsx | 4 +++- packages/forms/src/typings/generic.ts | 1 + packages/forms/src/wrapper/index.tsx | 9 +++++++-- packages/forms/src/wrapper/styles.ts | 5 ----- 5 files changed, 14 insertions(+), 13 deletions(-) delete mode 100644 packages/forms/src/wrapper/styles.ts (limited to 'packages') diff --git a/packages/forms/src/button/index.tsx b/packages/forms/src/button/index.tsx index 6959cde73..9faedc8f1 100644 --- a/packages/forms/src/button/index.tsx +++ b/packages/forms/src/button/index.tsx @@ -44,7 +44,7 @@ const styles = (theme: Theme) => ({ width: (props: IProps) => (props.stretch ? '100%' : 'auto') as CSS.WidthProperty, fontSize: theme.uiFontSize, textDecoration: 'none', - height: theme.buttonHeight, + // height: theme.buttonHeight, '&:hover': { opacity: 0.8, @@ -129,8 +129,7 @@ const styles = (theme: Theme) => ({ position: (props: IProps): CSS.PositionProperty => props.stretch ? 'absolute' : 'inherit', }, icon: { - marginLeft: -5, - marginRight: 10, + margin: [1, 10, 0, -5], }, }); @@ -142,7 +141,6 @@ class ButtonComponent extends Component { buttonType: 'primary' as ButtonType, stretch: false, busy: false, - // target: '_self' }; state = { @@ -220,7 +218,7 @@ class ButtonComponent extends Component { {icon && ( )} diff --git a/packages/forms/src/input/index.tsx b/packages/forms/src/input/index.tsx index a2d7c62d5..b96dbc12d 100644 --- a/packages/forms/src/input/index.tsx +++ b/packages/forms/src/input/index.tsx @@ -83,7 +83,7 @@ class InputComponent extends Component { } onInputKeyPress(e: React.KeyboardEvent) { - if (e.key === "Enter") { + if (e.key === 'Enter') { const { onEnterKey } = this.props; onEnterKey && onEnterKey(); } @@ -114,6 +114,7 @@ class InputComponent extends Component { max, step, required, + noMargin, } = this.props; const { @@ -127,6 +128,7 @@ class InputComponent extends Component {