-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathOptionText.js
More file actions
49 lines (45 loc) · 1.34 KB
/
Copy pathOptionText.js
File metadata and controls
49 lines (45 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import React from 'react'
import { View, TextInput, Platform } from 'react-native'
import { ThemeContext } from '~/contexts/theme'
import settingStyles from '~/styles/settings'
import size from '~/styles/size'
const OptionText = ({ placeholder, value, onChangeText, isPassword, autoComplete = 'off', inputMode = undefined, isLast = false, secureTextEntry = undefined }) => {
const theme = React.useContext(ThemeContext)
return (
<View style={[settingStyles.optionItem(theme, isLast), {
flexDirection: 'column',
flex: 1,
height: undefined,
alignItems: 'flex-start',
}]}>
<TextInput
style={{
flex: 1,
color: theme.primaryText,
fontSize: size.text.medium,
maxHeight: 150,
minHeight: 100,
lineHeight: 25,
textAlign: 'left',
width: '100%',
marginVertical: 13,
...Platform.select({
web: { outline: 'none' }
}),
}}
multiline={true}
placeholder={placeholder}
placeholderTextColor={theme.secondaryText}
autoFocus={false}
autoCorrect={false}
autoComplete={autoComplete}
autoCapitalize="none"
value={value}
inputMode={inputMode}
secureTextEntry={secureTextEntry === undefined ? isPassword : secureTextEntry}
onChangeText={value => onChangeText(value)}
/>
</View>
)
}
export default OptionText