-
Notifications
You must be signed in to change notification settings - Fork 7
/
Custom.js
73 lines (69 loc) · 1.75 KB
/
Custom.js
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import React from 'react'
import { View, Text } from 'react-native'
import TextInputMask from '../lib/text-input-mask'
import { textInputStype, container } from './styles'
export default class Custom extends React.Component {
constructor(props) {
super(props)
this.state = {
custom1: '',
custom2: '',
custom3: ''
}
}
render() {
return (
<View style={container}>
<View style={container}>
<Text>Custom: 999 AAA SSS ***</Text>
<TextInputMask
type={'custom'}
options={{
mask: '999 AAA SSS ***'
}}
value={this.state.custom1}
onChangeText={text => {
this.setState({
custom1: text
})
}}
style={textInputStype}
/>
</View>
<View style={container}>
<Text>Custom: 999 (99) 999 99 99</Text>
<TextInputMask
type={'custom'}
options={{
mask: '999 (99) 999 99 99'
}}
value={this.state.custom2}
onChangeText={text => {
this.setState({
custom2: text
})
}}
style={textInputStype}
/>
</View>
<View style={container}>
<Text>Custom: AA-99-99-99-A</Text>
<TextInputMask
id='custom-AA-99-99-99-A'
type={'custom'}
options={{
mask: 'AA-99-99-99-A'
}}
value={this.state.custom3}
onChangeText={text => {
this.setState({
custom3: text
})
}}
style={textInputStype}
/>
</View>
</View>
)
}
}