|
|
|
@ -4,15 +4,9 @@ import React, { Component } from 'react'; |
|
|
|
|
import { TouchableOpacity } from 'react-native'; |
|
|
|
|
|
|
|
|
|
import { Icon } from '../../base/font-icons'; |
|
|
|
|
import { Platform } from '../../base/react'; |
|
|
|
|
|
|
|
|
|
import styles from './styles'; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The icon glyph to be used on a specific platform. |
|
|
|
|
*/ |
|
|
|
|
const BACK_ICON = Platform.OS === 'android' ? 'arrow_back' : 'navigate_before'; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The type of the React {@code Component} props of {@link BackButton} |
|
|
|
|
*/ |
|
|
|
@ -30,7 +24,7 @@ type Props = { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* A component rendering a back button that looks native on both platforms. |
|
|
|
|
* A component rendering a back button. |
|
|
|
|
*/ |
|
|
|
|
export default class BackButton extends Component<Props> { |
|
|
|
|
/** |
|
|
|
@ -45,7 +39,7 @@ export default class BackButton extends Component<Props> { |
|
|
|
|
accessibilityLabel = { 'Back' } |
|
|
|
|
onPress = { this.props.onPress }> |
|
|
|
|
<Icon |
|
|
|
|
name = { BACK_ICON } |
|
|
|
|
name = { 'arrow_back' } |
|
|
|
|
style = { [ |
|
|
|
|
styles.backIcon, |
|
|
|
|
this.props.style |
|
|
|
|