{"size": 1443, "ext": "js", "max_stars_repo_path": "HotDays/src/component/common/Processing.js", "max_stars_repo_name": "DevaLee/HotDays", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "HotDays/src/component/common/Processing.js", "max_issues_repo_name": "DevaLee/HotDays", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "HotDays/src/component/common/Processing.js", "max_forks_repo_name": "DevaLee/HotDays", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.3157894737, "max_line_length": 75, "alphanum_fraction": 0.6008316008}
/**
 * Created by ritamashin on 2017/9/19.
 */
import React,{Component} from 'react'
import {StyleSheet, View, Text} from 'react-native'
import * as  Animatable from 'react-native-animatable'
import {bindActionCreators} from 'redux'
import {connect} from 'react-redux'
import {COLOR} from '../../config'
import * as component from '../'

function Processing({processing, containerStyle}) {
    let {task} = processing
    if (!task){
        return null;
    }

    return (
        <View style={[styles.container, containerStyle]}>
            <Animatable.Text
                animation = 'rotate'
                iterationCount = 'infinite'
                easing = 'linear'
            >
                <component.Icon name = 'rotate-right' style={styles.text}/>
            </Animatable.Text>
            <Text style={styles.text}>{task}</Text>
        </View>
    )
}

const styles = StyleSheet.create({
    container : {
        height : 20,
        flexDirection : 'row',
        justifyContent : 'center',
        alignItems : 'center',
        backgroundColor: COLOR.backgroundNotice
    },
    text : {
        fontSize : 12,
        color : COLOR.textEmpha
    }
})

function mapStateToProps(state) {
    let {processing} = state;
    return {
        processing
    }
}

function mapDispatchToProps(dispatch) {
    return bindActionCreators({}, dispatch);
}

export default connect(mapStateToProps, mapDispatchToProps)(Processing)