File tree Expand file tree Collapse file tree 1 file changed +15
-19
lines changed Expand file tree Collapse file tree 1 file changed +15
-19
lines changed Original file line number Diff line number Diff line change @@ -9,38 +9,34 @@ const PATTERNS = [
99 '1111 1111' ,
1010 '111 111' ,
1111 '11 11' ,
12- '1 1'
12+ '1 1' ,
1313]
1414
1515class App extends React . Component {
16- constructor ( props ) {
17- super ( props )
18-
19- this . state = {
20- card : '' ,
21- expiry : '' ,
22- ccv : '' ,
23- plate : '' ,
24- escaped : '' ,
25- leading : '' ,
26- custom : '' ,
27- changing : '' ,
28- pattern : '1111 1111' ,
29- cardPattern : '1111 1111 1111 1111'
30- }
16+ state = {
17+ card : '' ,
18+ expiry : '' ,
19+ ccv : '' ,
20+ plate : '' ,
21+ escaped : '' ,
22+ leading : '' ,
23+ custom : '' ,
24+ changing : '' ,
25+ pattern : '1111 1111' ,
26+ cardPattern : '1111 1111 1111 1111' ,
3127 }
3228
33- _onChange ( e ) {
29+ _onChange = ( e ) => {
3430 const stateChange = { }
3531 stateChange [ e . target . name ] = e . target . value
3632 this . setState ( stateChange )
3733 }
3834
39- _changePattern ( e ) {
35+ _changePattern = ( e ) => {
4036 this . setState ( { pattern : e . target . value } )
4137 }
4238
43- _onCardChange ( e ) {
39+ _onCardChange = ( e ) => {
4440 if ( / ^ 3 [ 4 7 ] / . test ( e . target . value ) ) {
4541 this . setState ( { cardPattern : '1111 111111 11111' } )
4642 }
You can’t perform that action at this time.
0 commit comments