More code style

This commit is contained in:
Jacob Lauritzen 2019-03-13 11:12:14 +08:00
parent 327cce9a33
commit 07f332cbeb

View File

@ -1,12 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import {
Animated,
AppState,
Easing,
View,
ViewPropTypes
} from 'react-native';
import { Animated, AppState, Easing, View, ViewPropTypes } from 'react-native';
import CircularProgress from './CircularProgress';
const AnimatedProgress = Animated.createAnimatedComponent(CircularProgress);
@ -14,8 +8,8 @@ export default class AnimatedCircularProgress extends React.PureComponent {
constructor(props) {
super(props);
this.state = {
fillAnimation: new Animated.Value(props.prefill)
}
fillAnimation: new Animated.Value(props.prefill),
};
}
componentDidMount() {
@ -29,9 +23,12 @@ export default class AnimatedCircularProgress extends React.PureComponent {
}
reAnimate(prefill, toVal, dur, ease) {
this.setState({
fillAnimation: new Animated.Value(prefill)
}, () => this.animate(toVal, dur, ease));
this.setState(
{
fillAnimation: new Animated.Value(prefill),
},
() => this.animate(toVal, dur, ease)
);
}
animate(toVal, dur, ease) {
@ -52,12 +49,7 @@ export default class AnimatedCircularProgress extends React.PureComponent {
render() {
const { fill, prefill, ...other } = this.props;
return (
<AnimatedProgress
{...other}
fill={this.state.fillAnimation}
/>
);
return <AnimatedProgress {...other} fill={this.state.fillAnimation} />;
}
}