Skip to content

Commit 393dc26

Browse files
committed
SmartUrlInput [nfc]: Remove props that should just be constants
These don't need to be configurable.
1 parent 7703751 commit 393dc26

File tree

2 files changed

+5
-29
lines changed

2 files changed

+5
-29
lines changed

src/common/SmartUrlInput.js

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import type { ViewStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet
88
import type { AppNavigationProp } from '../nav/AppNavigator';
99
import { ThemeContext, createStyleSheet } from '../styles';
1010
import { autocompleteRealmPieces, autocompleteRealm, fixRealmUrl } from '../utils/url';
11-
import type { Protocol } from '../utils/url';
1211
import ZulipText from './ZulipText';
1312

1413
const styles = createStyleSheet({
@@ -29,22 +28,6 @@ const styles = createStyleSheet({
2928
});
3029

3130
type Props = $ReadOnly<{|
32-
/**
33-
* The protocol which will be used if the user doesn't specify one.
34-
* Should almost certainly be "https://".
35-
*/
36-
defaultProtocol: Protocol,
37-
/**
38-
* The example organization name that will be displayed while the
39-
* entry field is empty. Appears, briefly, as the initial (lowest-
40-
* level) component of the realm's domain.
41-
*/
42-
defaultOrganization: string,
43-
/**
44-
* The default domain to which the user's input will be appended, if
45-
* it appears not to contain an explicit domain.
46-
*/
47-
defaultDomain: string,
4831
// TODO: Currently this type is acceptable because the only
4932
// `navigation` prop we pass to a `SmartUrlInput` instance is the
5033
// one from a component on AppNavigator.
@@ -109,15 +92,11 @@ function useRn19366Workaround(textInputRef) {
10992
}
11093

11194
export default function SmartUrlInput(props: Props): Node {
112-
const {
113-
defaultProtocol,
114-
defaultOrganization,
115-
defaultDomain,
116-
style,
117-
onChangeText,
118-
onSubmitEditing,
119-
enablesReturnKeyAutomatically,
120-
} = props;
95+
const { style, onChangeText, onSubmitEditing, enablesReturnKeyAutomatically } = props;
96+
97+
const defaultProtocol = 'https://';
98+
const defaultOrganization = 'your-org';
99+
const defaultDomain = 'zulipchat.com';
121100

122101
// We should replace the fixme with
123102
// `React$ElementRef<typeof TextInput>` when we can. Currently, that

src/start/RealmInputScreen.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@ export default class RealmInputScreen extends PureComponent<Props, State> {
9292
<SmartUrlInput
9393
style={styles.input}
9494
navigation={navigation}
95-
defaultProtocol="https://"
96-
defaultOrganization="your-org"
97-
defaultDomain="zulipchat.com"
9895
onChangeText={this.handleRealmChange}
9996
onSubmitEditing={this.tryRealm}
10097
enablesReturnKeyAutomatically

0 commit comments

Comments
 (0)