Skip to content

Instantly share code, notes, and snippets.

View razorabhu1995's full-sized avatar

Abhishek razorabhu1995

View GitHub Profile
const scaleValue = showCheckmark ? 1 : 0;
this.scaleCheckmark(scaleValue);
const {
labelText,
labelTextSize,
labelColor,
textColor,
borderBottomColor,
inputType,
customStyle,
onChangeText,
showCheckmark
<InputField
labelText="PASSWORD"
onChangeText={this.handlePasswordChange}
labelTextSize={14}
labelColor={colors.white}
textColor={colors.white}
borderBottomColor={colors.white}
inputType="password"
customStyle={{ marginBottom: 30 }}
showCheckmark={password === '12345'}
<InputField
labelText="EMAIL ADDRESS"
onChangeText={this.handleEmailChange}
labelTextSize={14}
labelColor={colors.white}
textColor={colors.white}
borderBottomColor={colors.white}
inputType="email"
customStyle={{ marginBottom: 30 }}
showCheckmark={email === 'test@gmail.com'}
<Animated.View style={[{ transform: [{ scale: iconScale }] }, styles.checkmarkWrapper]}>
<Icon
name="check"
color={colors.white}
size={20}
/>
</Animated.View>
const iconScale = scaleCheckmarkValue.interpolate({
inputRange: [0, 0.5, 1],
outputRange: [0.01, 1.6, 1],
});
const { secureInput, scaleCheckmarkValue } = this.state;
const keyboardType = inputType == 'email' ? 'email-address' : 'default';
scaleCheckmark(value) {
Animated.timing(
this.state.scaleCheckmarkValue,
{
toValue: value,
duration: 400,
easing: Easing.easeOutBack,
},
).start();
}
this.state = {
secureInput: !(props.inputType === "text" || props.inputType === "email"),
scaleCheckmarkValue: new Animated.Value(0),
};
import {
  View,
  Text,
  StyleSheet,
  TextInput,
  TouchableOpacity,
  Animated,
  Easing
} from "react-native";