Skip to content

Commit

Permalink
Merge pull request #42 from lad-tech/fix-inputField
Browse files Browse the repository at this point in the history
fix(InputField): changed styles for click-through rate
  • Loading branch information
vpsmolina authored Jan 12, 2024
2 parents 461d2c6 + 517023c commit e381d26
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,11 @@ exports[`@lad-tech/mobydick-core/ChatInput renders correctly 1`] = `
"flexDirection": "row",
"justifyContent": "space-between",
"marginVertical": 12,
"paddingLeft": 27,
"paddingRight": 24,
"paddingVertical": 18,
},
{
"minHeight": 120,
},
null,
[
{
"alignItems": "center",
Expand Down Expand Up @@ -97,10 +95,17 @@ exports[`@lad-tech/mobydick-core/ChatInput renders correctly 1`] = `
style={
[
{
"borderRadius": 12,
"flex": 1,
"padding": 0,
"paddingLeft": 27,
"paddingRight": 24,
"paddingVertical": 18,
"textAlignVertical": "top",
},
{
"minHeight": 120,
},
{
"color": "#20242D",
"fontFamily": "Inter-Regular",
Expand Down Expand Up @@ -240,13 +245,11 @@ exports[`@lad-tech/mobydick-core/ChatInput renders correctly android 1`] = `
"flexDirection": "row",
"justifyContent": "space-between",
"marginVertical": 12,
"paddingLeft": 27,
"paddingRight": 24,
"paddingVertical": 18,
},
{
"minHeight": 120,
},
null,
[
{
"alignItems": "center",
Expand Down Expand Up @@ -275,10 +278,17 @@ exports[`@lad-tech/mobydick-core/ChatInput renders correctly android 1`] = `
style={
[
{
"borderRadius": 12,
"flex": 1,
"padding": 0,
"paddingLeft": 27,
"paddingRight": 24,
"paddingVertical": 18,
"textAlignVertical": "top",
},
{
"minHeight": 120,
},
[
{
"color": "#20242D",
Expand Down Expand Up @@ -423,13 +433,11 @@ exports[`@lad-tech/mobydick-core/ChatInput renders correctly with containerStyle
"flexDirection": "row",
"justifyContent": "space-between",
"marginVertical": 12,
"paddingLeft": 27,
"paddingRight": 24,
"paddingVertical": 18,
},
{
"minHeight": 120,
},
null,
[
{
"alignItems": "center",
Expand Down Expand Up @@ -458,10 +466,17 @@ exports[`@lad-tech/mobydick-core/ChatInput renders correctly with containerStyle
style={
[
{
"borderRadius": 12,
"flex": 1,
"padding": 0,
"paddingLeft": 27,
"paddingRight": 24,
"paddingVertical": 18,
"textAlignVertical": "top",
},
{
"minHeight": 120,
},
{
"color": "#20242D",
"fontFamily": "Inter-Regular",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ exports[`@lad-tech/mobydick-core/ChatInputField renders correctly 1`] = `
"flexDirection": "row",
"justifyContent": "space-between",
"marginVertical": 12,
"paddingLeft": 27,
"paddingRight": 24,
"paddingVertical": 18,
},
{
"minHeight": 120,
},
null,
[
{
"alignItems": "center",
Expand Down Expand Up @@ -67,10 +65,17 @@ exports[`@lad-tech/mobydick-core/ChatInputField renders correctly 1`] = `
style={
[
{
"borderRadius": 12,
"flex": 1,
"padding": 0,
"paddingLeft": 27,
"paddingRight": 24,
"paddingVertical": 18,
"textAlignVertical": "top",
},
{
"minHeight": 120,
},
{
"color": "#20242D",
"fontFamily": "Inter-Regular",
Expand Down Expand Up @@ -124,13 +129,11 @@ exports[`@lad-tech/mobydick-core/ChatInputField renders correctly focused/blur 1
"flexDirection": "row",
"justifyContent": "space-between",
"marginVertical": 12,
"paddingLeft": 27,
"paddingRight": 24,
"paddingVertical": 18,
},
{
"minHeight": 120,
},
null,
[
{
"alignItems": "center",
Expand Down Expand Up @@ -159,10 +162,17 @@ exports[`@lad-tech/mobydick-core/ChatInputField renders correctly focused/blur 1
style={
[
{
"borderRadius": 12,
"flex": 1,
"padding": 0,
"paddingLeft": 27,
"paddingRight": 24,
"paddingVertical": 18,
"textAlignVertical": "top",
},
{
"minHeight": 120,
},
{
"color": "#20242D",
"fontFamily": "Inter-Regular",
Expand Down Expand Up @@ -215,13 +225,11 @@ exports[`@lad-tech/mobydick-core/ChatInputField renders correctly focused/blur 2
"flexDirection": "row",
"justifyContent": "space-between",
"marginVertical": 12,
"paddingLeft": 27,
"paddingRight": 24,
"paddingVertical": 18,
},
{
"minHeight": 120,
},
null,
[
{
"alignItems": "center",
Expand Down Expand Up @@ -250,10 +258,17 @@ exports[`@lad-tech/mobydick-core/ChatInputField renders correctly focused/blur 2
style={
[
{
"borderRadius": 12,
"flex": 1,
"padding": 0,
"paddingLeft": 27,
"paddingRight": 24,
"paddingVertical": 18,
"textAlignVertical": "top",
},
{
"minHeight": 120,
},
{
"color": "#20242D",
"fontFamily": "Inter-Regular",
Expand Down Expand Up @@ -306,13 +321,11 @@ exports[`@lad-tech/mobydick-core/ChatInputField renders correctly with props 1`]
"flexDirection": "row",
"justifyContent": "space-between",
"marginVertical": 12,
"paddingLeft": 27,
"paddingRight": 24,
"paddingVertical": 18,
},
{
"minHeight": 120,
},
null,
[
{
"alignItems": "center",
Expand Down Expand Up @@ -344,10 +357,17 @@ exports[`@lad-tech/mobydick-core/ChatInputField renders correctly with props 1`]
style={
[
{
"borderRadius": 12,
"flex": 1,
"padding": 0,
"paddingLeft": 27,
"paddingRight": 24,
"paddingVertical": 18,
"textAlignVertical": "top",
},
{
"minHeight": 120,
},
{
"color": "#20242D",
"fontFamily": "Inter-Regular",
Expand Down
14 changes: 12 additions & 2 deletions packages/core/src/inputs/components/InputField/InputField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,28 @@ const InputField = forwardRef<ITextInput, IInputFieldsProps>((props, ref) => {
const getHeight = () => {
return multiline ? {minHeight: rem(80)} : {height: rem(48)};
};

const getPadding = useCallback(() => {
return rightIcon ? {paddingRight: rem(16)} : null;
}, [rightIcon]);

return (
<View style={[styles.container, containerStyle]}>
{title && (
<InputTitle title={title} titleProps={titleProps} required={required} />
)}

<View
style={[styles.inputContainer, getHeight(), textInputContainerStyle]}>
style={[
styles.inputContainer,
getHeight(),
getPadding(),
textInputContainerStyle,
]}>
<TextInput
ref={ref}
testID={Constants.testID}
style={[styles.textInput, getStyle, style]}
style={[styles.textInput, getHeight(), getStyle, style]}
placeholderTextColor={theme.colors.TextMuted}
editable={!disabled}
numberOfLines={1}
Expand Down
Loading

0 comments on commit e381d26

Please sign in to comment.