Skip to content

Infra/incubator to2 #1616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 6 additions & 30 deletions demo/src/screens/incubatorScreens/TouchableOpacityScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,6 @@ class TouchableOpacityScreen extends Component {
this.setState({longPressCounter: this.state.longPressCounter + 1});
};

renderExample(title, props) {
return (
<View row marginT-20 centerV>
<Text text70 marginR-20>
{title}
</Text>
<Incubator.TouchableOpacity
onPress={this.onPress}
onLongPress={this.onLongPress}
backgroundColor={Colors.blue30}
style={{alignItems: 'center', paddingHorizontal: 20, paddingVertical: 8, borderRadius: 50}}
activeOpacity={1}
{...props}
>
<Text white>Button</Text>
</Incubator.TouchableOpacity>
</View>
);
}

renderRNTouchableExample = () => {
return (
<View row centerV marginT-20>
Expand Down Expand Up @@ -67,11 +47,7 @@ class TouchableOpacityScreen extends Component {
LONG PRESS COUNTER: {longPressCounter}
</Text>

{this.renderExample('feedbackColor', {backgroundColor: Colors.red30, feedbackColor: Colors.red10})}
{this.renderExample('activeScale', {activeScale: 0.95})}
{this.renderExample('activeOpacity', {activeOpacity: 0.6})}

<Incubator.TouchableOpacity2
<Incubator.TouchableOpacity
marginT-20
onPress={this.onPress}
onLongPress={this.onLongPress}
Expand All @@ -81,9 +57,9 @@ class TouchableOpacityScreen extends Component {
activeOpacity={1}
activeScale={0.98}
>
<Text white>TouchableOpacity2</Text>
</Incubator.TouchableOpacity2>
<Incubator.TouchableOpacity2
<Text white>TouchableOpacity</Text>
</Incubator.TouchableOpacity>
<Incubator.TouchableOpacity
marginT-20
paddingH-20
paddingV-8
Expand All @@ -95,8 +71,8 @@ class TouchableOpacityScreen extends Component {
activeOpacity={1}
activeScale={0.98}
>
<Text white>TouchableOpacity2 (without LongPress)</Text>
</Incubator.TouchableOpacity2>
<Text white>TouchableOpacity (without LongPress)</Text>
</Incubator.TouchableOpacity>
{this.renderRNTouchableExample()}
</View>
);
Expand Down
12 changes: 6 additions & 6 deletions generatedTypes/src/incubator/TextField/usePreset.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
onAccessibilityTap?: (() => void) | undefined;
onMagicTap?: (() => void) | undefined;
accessibilityIgnoresInvertColors?: boolean | undefined;
textAlign?: "left" | "right" | "center" | undefined;
textAlignVertical?: "auto" | "center" | "top" | "bottom" | undefined;
onBlur?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onFocus?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onPressIn?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined;
Expand All @@ -87,8 +89,6 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
maxFontSizeMultiplier?: number | null | undefined;
selectionColor?: import("react-native").ColorValue | undefined;
textBreakStrategy?: "simple" | "highQuality" | "balanced" | undefined;
textAlign?: "left" | "right" | "center" | undefined;
textAlignVertical?: "auto" | "center" | "top" | "bottom" | undefined;
value?: string | undefined;
autoCapitalize?: "none" | "characters" | "sentences" | "words" | undefined;
autoCorrect?: boolean | undefined;
Expand Down Expand Up @@ -404,6 +404,8 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
onAccessibilityTap?: (() => void) | undefined;
onMagicTap?: (() => void) | undefined;
accessibilityIgnoresInvertColors?: boolean | undefined;
textAlign?: "left" | "right" | "center" | undefined;
textAlignVertical?: "auto" | "center" | "top" | "bottom" | undefined;
onBlur?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onFocus?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onPressIn?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined;
Expand All @@ -413,8 +415,6 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
maxFontSizeMultiplier?: number | null | undefined;
selectionColor?: import("react-native").ColorValue | undefined;
textBreakStrategy?: "simple" | "highQuality" | "balanced" | undefined;
textAlign?: "left" | "right" | "center" | undefined;
textAlignVertical?: "auto" | "center" | "top" | "bottom" | undefined;
value?: string | undefined;
autoCapitalize?: "none" | "characters" | "sentences" | "words" | undefined;
autoCorrect?: boolean | undefined;
Expand Down Expand Up @@ -842,6 +842,8 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
onAccessibilityTap?: (() => void) | undefined;
onMagicTap?: (() => void) | undefined;
accessibilityIgnoresInvertColors?: boolean | undefined;
textAlign?: "left" | "right" | "center" | undefined;
textAlignVertical?: "auto" | "center" | "top" | "bottom" | undefined;
onBlur?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onFocus?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onPressIn?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined;
Expand All @@ -851,8 +853,6 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
maxFontSizeMultiplier?: number | null | undefined;
selectionColor?: import("react-native").ColorValue | undefined;
textBreakStrategy?: "simple" | "highQuality" | "balanced" | undefined;
textAlign?: "left" | "right" | "center" | undefined;
textAlignVertical?: "auto" | "center" | "top" | "bottom" | undefined;
value?: string | undefined;
autoCapitalize?: "none" | "characters" | "sentences" | "words" | undefined;
autoCorrect?: boolean | undefined;
Expand Down
4 changes: 4 additions & 0 deletions generatedTypes/src/incubator/TouchableOpacity.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export declare type TouchableOpacityProps = {
* Pass custom style
*/
style?: ViewProps['style'];
/**
* Custom value of any type to pass on to TouchableOpacity and receive back in onPress callback
*/
customValue?: any;
onLayout?: (event: LayoutChangeEvent) => void;
testID?: string;
};
Expand Down
1 change: 0 additions & 1 deletion generatedTypes/src/incubator/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export { default as ExpandableOverlay } from './expandableOverlay';
export { default as TextField, TextFieldProps, FieldContextType } from './TextField';
export { default as TouchableOpacity, TouchableOpacityProps } from './TouchableOpacity';
export { default as TouchableOpacity2 } from './TouchableOpacity2';
export { default as WheelPicker, WheelPickerProps } from './WheelPicker';
export { default as PanView, PanViewProps, PanViewDirections, PanViewDismissThreshold } from './panView';
export { default as TransitionView, TransitionViewProps, Direction, TransitionViewAnimationType } from './TransitionView';
Loading