PauseResumeButton.js 650 B

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