Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class PinBox extends React.Component {
  2.     constructor(props) {
  3.         super(props)
  4.     }
  5.  
  6.     componentDidMount() {
  7.         const { setReady, ready } = this.props;
  8.         if (this.props.ready) {
  9.             setReady(false);
  10.         }
  11.     };
  12.  
  13.     componentDidUpdate() {
  14.         const { ready, setReady, activationValid } = this.props;
  15.         if (!ready && activationValid) {
  16.             setReady(true);
  17.         }
  18.     }
  19.    
  20.     render() {
  21.         const { activationCode, onFocus, onBlur, onChange} = this.props;
  22.         return (
  23.             <View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }}>
  24.                 <View style={styles.inletShadowHack}>
  25.                     <LabelWithoutInput
  26.                         containerStyle={{ alignItems: 'center', justifyContent: 'center' }}
  27.                         {...fonts.patrickHand}
  28.                         labelStyle={styles.label}
  29.                         label={VALIDATION_COMMON_PARTS[0]}
  30.                     />
  31.                 </View>
  32.                 <Text style={styles.dash}>{VALIDATION_COMMON_PARTS[1]}</Text>
  33.                 <FormInput
  34.                     underlineColorAndroid="transparent"
  35.                     containerStyle={styles.inletShadowHack}
  36.                     inputStyle={styles.formInput}
  37.                     maxLength={5}
  38.                     value={activationCode}
  39.                     onFocus={onFocus}
  40.                     onBlur={onBlur}
  41.                     onChangeText={onChange}
  42.                     keyboardType="numeric"
  43.                     autoCorrect={false}
  44.                 />
  45.             </View>
  46.         )
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement