
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
rc-react-native-countdown
Advanced tools
A component for react-native
Run npm install rc-react-native-countdown --save
// Within your render function. Count down after press it.
<CountDown
onPress={this.sendAgain} //default null
text={'Try again'} //default ''
time={60} //default 60
buttonStyle={{padding:20}}
textStyle={{color:'black'}} //default black
disabledTextStyle={{color:'gray'}} //default gray
/>
static defaultProps = {
isChecked: false
};
static propTypes = {
isChecked: React.PropTypes.bool
};
constructor(props) {
super(props);
this.state = {
isChecked: props.isChecked
}
}
renderCountDown(){
if (this.state.isChecked) {
return(
<CountDown
onPress={this.sendAgain.bind(this)} //default null
text={'重新获取'} //default ''
time={60} //default 60
buttonStyle={{padding:20}}
textStyle={{color:'black'}} //default black
disabledTextStyle={{color:'gray'}} //default gray
/>)
}
else{
return(
<Text style ={styles.tip} onPress={this.sendCode.bind(this)}>获取验证码</Text>
)
}
}
sendAgain(){
}
sendCode(){
this.setState({ isChecked: !this.state.isChecked });
}
render(){
return (
<View style={styles.container}>
<Text style={styles.tip}>{'CountDown in timestamp \n 以日期-时间为单位的倒计时'}</Text>
<View style={styles.row}>
{this.renderCountDown()}
</View>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'space-around',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
row: {
padding: 7,
backgroundColor: 'red',
borderRadius: 7,
},
tip: {
fontSize: 20,
},
cd: {
textAlign: 'center',
color: 'white',
fontSize: 20,
},
});
FAQs
react native countdown button
The npm package rc-react-native-countdown receives a total of 3 weekly downloads. As such, rc-react-native-countdown popularity was classified as not popular.
We found that rc-react-native-countdown demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.