uppy/examples/react-native-expo/PauseResumeButton.js
2019-04-10 18:24:05 +03:00

29 lines
650 B
JavaScript

import React from 'react' // eslint-disable-line no-unused-vars
import { StyleSheet, Text, TouchableHighlight } from 'react-native'
export default function PauseResumeButton (props) {
if (!props.uploadStarted || props.uploadComplete) {
return null
}
return (
<TouchableHighlight
onPress={props.onPress}
style={styles.button}>
<Text
style={styles.text}>{props.isPaused ? 'Resume' : 'Pause'}</Text>
</TouchableHighlight>
)
}
const styles = StyleSheet.create({
button: {
backgroundColor: '#cc0077',
padding: 10
},
text: {
color: '#fff',
textAlign: 'center',
fontSize: 17
}
})