PauseResumeButton.js 669 B

1234567891011121314151617181920212223242526272829303132
  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. >{props.isPaused ? 'Resume' : 'Pause'}
  15. </Text>
  16. </TouchableHighlight>
  17. )
  18. }
  19. const styles = StyleSheet.create({
  20. button: {
  21. backgroundColor: '#cc0077',
  22. padding: 10
  23. },
  24. text: {
  25. color: '#fff',
  26. textAlign: 'center',
  27. fontSize: 17
  28. }
  29. })