diff --git a/src/common/SmartUrlInput.js b/src/common/SmartUrlInput.js index 5163d64791c..d2486c59c98 100644 --- a/src/common/SmartUrlInput.js +++ b/src/common/SmartUrlInput.js @@ -8,7 +8,6 @@ import type { ViewStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet import type { AppNavigationProp } from '../nav/AppNavigator'; import { ThemeContext, createStyleSheet } from '../styles'; import { autocompleteRealmPieces, autocompleteRealm, fixRealmUrl } from '../utils/url'; -import type { Protocol } from '../utils/url'; import ZulipText from './ZulipText'; const styles = createStyleSheet({ @@ -29,22 +28,6 @@ const styles = createStyleSheet({ }); type Props = $ReadOnly<{| - /** - * The protocol which will be used if the user doesn't specify one. - * Should almost certainly be "https://". - */ - defaultProtocol: Protocol, - /** - * The example organization name that will be displayed while the - * entry field is empty. Appears, briefly, as the initial (lowest- - * level) component of the realm's domain. - */ - defaultOrganization: string, - /** - * The default domain to which the user's input will be appended, if - * it appears not to contain an explicit domain. - */ - defaultDomain: string, // TODO: Currently this type is acceptable because the only // `navigation` prop we pass to a `SmartUrlInput` instance is the // one from a component on AppNavigator. @@ -99,15 +82,7 @@ function useRn19366Workaround(textInputRef) { } export default function SmartUrlInput(props: Props): Node { - const { - defaultProtocol, - defaultOrganization, - defaultDomain, - style, - onChangeText, - onSubmitEditing, - enablesReturnKeyAutomatically, - } = props; + const { style, onChangeText, onSubmitEditing, enablesReturnKeyAutomatically } = props; // We should replace the fixme with // `React$ElementRef` when we can. Currently, that @@ -140,12 +115,10 @@ export default function SmartUrlInput(props: Props): Node { setValue(_value); onChangeText( - fixRealmUrl( - autocompleteRealm(_value, { protocol: defaultProtocol, domain: defaultDomain }), - ), + fixRealmUrl(autocompleteRealm(_value, { protocol: 'https://', domain: 'zulipchat.com' })), ); }, - [defaultDomain, defaultProtocol, onChangeText], + [onChangeText], ); // When the "placeholder parts" are pressed, i.e., the parts of the URL @@ -178,8 +151,8 @@ export default function SmartUrlInput(props: Props): Node { ); const [prefix, , suffix] = autocompleteRealmPieces(value, { - domain: defaultDomain, - protocol: defaultProtocol, + domain: 'zulipchat.com', + protocol: 'https://', }); return ( @@ -203,7 +176,7 @@ export default function SmartUrlInput(props: Props): Node { enablesReturnKeyAutomatically={enablesReturnKeyAutomatically} ref={textInputRef} /> - {!value && renderPlaceholderPart(defaultOrganization)} + {!value && renderPlaceholderPart('your-org')} {suffix !== null && renderPlaceholderPart(suffix)} ); diff --git a/src/start/RealmInputScreen.js b/src/start/RealmInputScreen.js index 81726e4f312..b0d4d9d1149 100644 --- a/src/start/RealmInputScreen.js +++ b/src/start/RealmInputScreen.js @@ -90,9 +90,6 @@ export default class RealmInputScreen extends PureComponent {