Skip to content

Commit 7d003af

Browse files
committed
SmartUrlInput [nfc]: Remove style prop
1 parent 7f44ea1 commit 7d003af

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/common/SmartUrlInput.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ import React, { useState, useRef, useCallback, useContext } from 'react';
33
import type { Node } from 'react';
44
import { TextInput, View } from 'react-native';
55
import { useFocusEffect } from '@react-navigation/native';
6-
import type { ViewStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet';
76

87
import { ThemeContext, createStyleSheet, HALF_COLOR } from '../styles';
98

109
const styles = createStyleSheet({
1110
wrapper: {
1211
flexDirection: 'row',
1312
opacity: 0.8,
13+
marginTop: 16,
14+
marginBottom: 8,
1415
},
1516
realmInput: {
1617
flex: 1,
@@ -20,13 +21,12 @@ const styles = createStyleSheet({
2021
});
2122

2223
type Props = $ReadOnly<{|
23-
style?: ViewStyleProp,
2424
onChangeText: (value: string) => void,
2525
onSubmitEditing: () => Promise<void>,
2626
|}>;
2727

2828
export default function SmartUrlInput(props: Props): Node {
29-
const { style, onChangeText, onSubmitEditing } = props;
29+
const { onChangeText, onSubmitEditing } = props;
3030

3131
// We should replace the fixme with
3232
// `React$ElementRef<typeof TextInput>` when we can. Currently, that
@@ -67,7 +67,7 @@ export default function SmartUrlInput(props: Props): Node {
6767
);
6868

6969
return (
70-
<View style={[styles.wrapper, style]}>
70+
<View style={styles.wrapper}>
7171
<TextInput
7272
value={value}
7373
placeholder="your-org.zulipchat.com"

src/start/RealmInputScreen.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ export default function RealmInputScreen(props: Props): Node {
7171
const styles = React.useMemo(
7272
() =>
7373
createStyleSheet({
74-
input: { marginTop: 16, marginBottom: 8 },
7574
hintText: { paddingLeft: 2, fontSize: 12 },
7675
button: { marginTop: 8 },
7776
}),
@@ -88,11 +87,7 @@ export default function RealmInputScreen(props: Props): Node {
8887
shouldShowLoadingBanner={false}
8988
>
9089
<ZulipTextIntl text="Enter your Zulip server URL:" />
91-
<SmartUrlInput
92-
style={styles.input}
93-
onChangeText={handleRealmChange}
94-
onSubmitEditing={tryRealm}
95-
/>
90+
<SmartUrlInput onChangeText={handleRealmChange} onSubmitEditing={tryRealm} />
9691
{error !== null ? (
9792
<ErrorMsg error={error} />
9893
) : (

0 commit comments

Comments
 (0)