Skip to content

Commit 4f47756

Browse files
Merge remote-tracking branch 'origin/dev' into feat/support-app-flows
2 parents a6d13d8 + 9af3812 commit 4f47756

File tree

6 files changed

+395
-79
lines changed

6 files changed

+395
-79
lines changed
Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,48 @@
11
import React, { forwardRef } from 'react';
22

3-
import { KeyboardTypeOptions, StyleSheet, TextInput } from 'react-native';
3+
import { KeyboardTypeOptions, StyleSheet, TextInput, View } from 'react-native';
4+
import { Text } from 'native-base';
45

56
interface InputFieldProps {
67
placeholder?: string;
78
value?: string;
89
onChangeText?: (text: string) => void;
910
keyboardType?: KeyboardTypeOptions;
11+
errorText?: string;
12+
maxLength?: number;
13+
accessibilityLabel?: string;
14+
flex?: number;
1015
}
1116

1217
export const InputField = forwardRef<TextInput, InputFieldProps>(
13-
({ placeholder, value, onChangeText, keyboardType, ...restProps }, ref) => {
18+
(
19+
{
20+
placeholder,
21+
value,
22+
onChangeText,
23+
accessibilityLabel,
24+
maxLength,
25+
keyboardType,
26+
errorText,
27+
...restProps
28+
},
29+
ref,
30+
) => {
1431
return (
15-
<TextInput
16-
ref={ref}
17-
placeholder={placeholder}
18-
style={styles.textInput}
19-
keyboardType={keyboardType}
20-
value={value}
21-
onChangeText={onChangeText}
22-
{...restProps}
23-
/>
32+
<View>
33+
<TextInput
34+
ref={ref}
35+
placeholder={placeholder}
36+
style={styles.textInput}
37+
maxLength={maxLength}
38+
accessibilityLabel={accessibilityLabel}
39+
keyboardType={keyboardType}
40+
value={value}
41+
onChangeText={onChangeText}
42+
{...restProps}
43+
/>
44+
{errorText ? <Text style={styles.errorText}>{errorText}</Text> : null}
45+
</View>
2446
);
2547
},
2648
);
@@ -35,4 +57,7 @@ const styles = StyleSheet.create({
3557
fontSize: 16,
3658
borderRadius: 5,
3759
},
60+
errorText: {
61+
color: '#ff0000',
62+
},
3863
});

examples/default/src/navigation/HomeStack.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import { FlatListScreen } from '../screens/user-steps/FlatListScreen';
1515
import { ComplexViewsScreen } from '../screens/user-steps/ComplexViewsScreen';
1616
import { SectionListScreen } from '../screens/user-steps/SectionListScreen';
1717
import { GesturesScreen } from '../screens/user-steps/GesturesScreen';
18+
import {
19+
BackAndForthScreen,
20+
type BackAndForthScreenProp,
21+
} from '../screens/user-steps/BackAndForthScreen';
1822
import { GoogleMapsScreen } from '../screens/user-steps/GoogleMapsScreen';
1923
import { LargeImageListScreen } from '../screens/user-steps/LargeImageListScreen';
2024
import { SessionReplayScreen } from '../screens/SessionReplayScreen';
@@ -36,6 +40,7 @@ export type HomeStackParamList = {
3640
GoogleMapsScreen: undefined;
3741
LargeImageList: undefined;
3842
SessionReplay: undefined;
43+
BackAndForthScreen: BackAndForthScreenProp;
3944
};
4045

4146
const HomeStack = createNativeStackNavigator<HomeStackParamList>();
@@ -60,6 +65,7 @@ export const HomeStackNavigator: React.FC = () => {
6065
options={{ title: 'Feature Requests' }}
6166
/>
6267
<HomeStack.Screen name="Replies" component={RepliesScreen} />
68+
6369
<HomeStack.Screen name="Surveys" component={SurveysScreen} />
6470
<HomeStack.Screen
6571
name="SessionReplay"
@@ -102,6 +108,11 @@ export const HomeStackNavigator: React.FC = () => {
102108
component={SectionListScreen}
103109
options={{ title: 'Section List' }}
104110
/>
111+
<HomeStack.Screen
112+
name="BackAndForthScreen"
113+
component={BackAndForthScreen}
114+
options={{ title: 'Back And Forth Screen' }}
115+
/>
105116
<HomeStack.Screen
106117
name="LargeImageList"
107118
component={LargeImageListScreen}

examples/default/src/navigation/RootTab.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Icon from 'react-native-vector-icons/Ionicons';
88

99
import { SettingsScreen } from '../screens/SettingsScreen';
1010
import { HomeStackNavigator } from './HomeStack';
11+
import { Platform } from 'react-native';
1112

1213
export type RootTabParamList = {
1314
HomeStack: undefined;
@@ -22,7 +23,7 @@ const createTabBarIcon = (name: string): BottomTabNavigationOptions['tabBarIcon'
2223

2324
export const RootTabNavigator: React.FC = () => {
2425
return (
25-
<RootTab.Navigator>
26+
<RootTab.Navigator screenOptions={{ tabBarHideOnKeyboard: Platform.OS !== 'ios' }}>
2627
<RootTab.Screen
2728
name="HomeStack"
2829
component={HomeStackNavigator}

0 commit comments

Comments
 (0)