PauseResumeButton.js 681 B

123456789101112131415161718192021222324252627282930313233
  1. import React from 'react' // eslint-disable-line no-unused-vars
  2. import { StyleSheet, Text, TouchableHighlight } from 'react-native'
  3. export default function PauseResumeButton (props) {
  4. if (!props.uploadStarted || props.uploadComplete) {
  5. return null
  6. }
  7. return (
  8. <TouchableHighlight
  9. onPress={props.onPress}
  10. style={styles.button}
  11. >
  12. <Text
  13. style={styles.text}
  14. >
  15. {props.isPaused ? 'Resume' : 'Pause'}
  16. </Text>
  17. </TouchableHighlight>
  18. )
  19. }
  20. const styles = StyleSheet.create({
  21. button: {
  22. backgroundColor: '#cc0077',
  23. padding: 10,
  24. },
  25. text: {
  26. color: '#fff',
  27. textAlign: 'center',
  28. fontSize: 17,
  29. },
  30. })