您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

BackButton.native.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { TouchableOpacity } from 'react-native';
  4. import { Icon } from '../../base/font-icons';
  5. import styles from './styles';
  6. /**
  7. * The type of the React {@code Component} props of {@link BackButton}
  8. */
  9. type Props = {
  10. /**
  11. * The action to be performed when the button is pressed.
  12. */
  13. onPress: Function,
  14. /**
  15. * An external style object passed to the component.
  16. */
  17. style: Object
  18. };
  19. /**
  20. * A component rendering a back button.
  21. */
  22. export default class BackButton extends Component<Props> {
  23. /**
  24. * Implements React's {@link Component#render()}, renders the button.
  25. *
  26. * @inheritdoc
  27. * @returns {ReactElement}
  28. */
  29. render() {
  30. return (
  31. <TouchableOpacity
  32. accessibilityLabel = { 'Back' }
  33. onPress = { this.props.onPress }>
  34. <Icon
  35. name = { 'arrow_back' }
  36. style = { [
  37. styles.backIcon,
  38. this.props.style
  39. ] } />
  40. </TouchableOpacity>
  41. );
  42. }
  43. }