Skip to content

Commit 7f44ea1

Browse files
committed
SmartUrlInput [nfc]: Remove unneeded props navigation and enablesReturnKey…
This and the next several commits prepare to inline the definition of SmartUrlInput at its only caller.
1 parent 513fa89 commit 7f44ea1

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/common/SmartUrlInput.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { TextInput, View } from 'react-native';
55
import { useFocusEffect } from '@react-navigation/native';
66
import type { ViewStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet';
77

8-
import type { AppNavigationProp } from '../nav/AppNavigator';
98
import { ThemeContext, createStyleSheet, HALF_COLOR } from '../styles';
109

1110
const styles = createStyleSheet({
@@ -21,19 +20,13 @@ const styles = createStyleSheet({
2120
});
2221

2322
type Props = $ReadOnly<{|
24-
// TODO: Currently this type is acceptable because the only
25-
// `navigation` prop we pass to a `SmartUrlInput` instance is the
26-
// one from a component on AppNavigator.
27-
navigation: AppNavigationProp<>,
28-
2923
style?: ViewStyleProp,
3024
onChangeText: (value: string) => void,
3125
onSubmitEditing: () => Promise<void>,
32-
enablesReturnKeyAutomatically: boolean,
3326
|}>;
3427

3528
export default function SmartUrlInput(props: Props): Node {
36-
const { style, onChangeText, onSubmitEditing, enablesReturnKeyAutomatically } = props;
29+
const { style, onChangeText, onSubmitEditing } = props;
3730

3831
// We should replace the fixme with
3932
// `React$ElementRef<typeof TextInput>` when we can. Currently, that
@@ -89,7 +82,7 @@ export default function SmartUrlInput(props: Props): Node {
8982
keyboardType="url"
9083
underlineColorAndroid="transparent"
9184
onSubmitEditing={onSubmitEditing}
92-
enablesReturnKeyAutomatically={enablesReturnKeyAutomatically}
85+
enablesReturnKeyAutomatically
9386
ref={textInputRef}
9487
/>
9588
</View>

src/start/RealmInputScreen.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,8 @@ export default function RealmInputScreen(props: Props): Node {
9090
<ZulipTextIntl text="Enter your Zulip server URL:" />
9191
<SmartUrlInput
9292
style={styles.input}
93-
navigation={navigation}
9493
onChangeText={handleRealmChange}
9594
onSubmitEditing={tryRealm}
96-
enablesReturnKeyAutomatically
9795
/>
9896
{error !== null ? (
9997
<ErrorMsg error={error} />

0 commit comments

Comments
 (0)