Skip to content

Commit e0ba596

Browse files
committed
code-review
1 parent 02bad35 commit e0ba596

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/components/switch/switch.api.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
{"name": "thumbSize", "type": "number", "description": "The Switch's thumb size (width & height)"},
2626
{"name": "thumbStyle", "type": "ViewStyle", "description": "The Switch's thumb style"},
2727
{"name": "style", "type": "ViewStyle", "description": "Custom style"},
28-
{"name": "testID", "type": "string", "description": "Component test id"}
28+
{"name": "testID", "type": "string", "description": "Component test id"},
29+
{"name": "id", "type": "string", "description": "Component id"}
2930
],
3031
"snippet": [
3132
"<Switch value={false$1} onValueChange={() => console.log('value changed')$2}/>"

src/incubator/TextField/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const TextField = (props: InternalTextFieldProps) => {
4646
const {
4747
modifiers,
4848
// General
49-
containerId,
49+
containerProps = {},
5050
fieldStyle: fieldStyleProp,
5151
dynamicFieldStyle,
5252
containerStyle,
@@ -124,7 +124,7 @@ const TextField = (props: InternalTextFieldProps) => {
124124

125125
return (
126126
<FieldContext.Provider value={context}>
127-
<View id={containerId} style={[margins, positionStyle, containerStyle, centeredContainerStyle]}>
127+
<View {...containerProps} style={[margins, positionStyle, containerStyle, centeredContainerStyle]}>
128128
<Label
129129
label={label}
130130
labelColor={labelColor}

src/incubator/TextField/textField.api.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"type": "ViewStyle | (context: FieldContextType, props) => ViewStyle",
5757
"description": "Internal style for the field container to style the field underline, outline and fill color"
5858
},
59+
{"name": "containerProps", "type": "Omit<ViewProps, 'style'>", "description": "Container props of the whole component"},
5960
{"name": "containerStyle", "type": "ViewStyle", "description": "Container style of the whole component"},
6061
{
6162
"name": "preset",

src/incubator/TextField/types.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
} from '../../commons/new';
1111
import {TextProps} from '../../components/text';
1212
import {PropsWithChildren, ReactElement} from 'react';
13+
import {ViewProps} from '../../components/view';
1314

1415
export type ColorType =
1516
| string
@@ -165,9 +166,9 @@ export type TextFieldProps = MarginModifiers &
165166
ValidationMessageProps &
166167
Omit<CharCounterProps, 'maxLength' | 'testID'> & {
167168
/**
168-
* Pass id to the container
169+
* Pass props to the container
169170
*/
170-
containerId?: string;
171+
containerProps?: Omit<ViewProps, 'style'>;
171172
/**
172173
* Pass to render a leading element
173174
*/

0 commit comments

Comments
 (0)