forked from vergnet/application-amicale
Fixed back button not working on some cases
This commit is contained in:
parent
fd8d7e71d6
commit
7ea02bb30f
1 changed files with 6 additions and 2 deletions
|
@ -8,6 +8,7 @@ import Touchable from 'react-native-platform-touchable';
|
||||||
import ThemeManager from "../utils/ThemeManager";
|
import ThemeManager from "../utils/ThemeManager";
|
||||||
import CustomMaterialIcon from "./CustomMaterialIcon";
|
import CustomMaterialIcon from "./CustomMaterialIcon";
|
||||||
import i18n from "i18n-js";
|
import i18n from "i18n-js";
|
||||||
|
import { NavigationActions } from 'react-navigation';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
hasBackButton: boolean,
|
hasBackButton: boolean,
|
||||||
|
@ -75,10 +76,13 @@ export default class CustomHeader extends React.Component<Props> {
|
||||||
button =
|
button =
|
||||||
<Touchable
|
<Touchable
|
||||||
style={{padding: 6}}
|
style={{padding: 6}}
|
||||||
onPress={() => this.props.navigation.goBack()}>
|
onPress={() => {
|
||||||
|
const backAction = NavigationActions.back();
|
||||||
|
this.props.navigation.dispatch(backAction);
|
||||||
|
}}>
|
||||||
<CustomMaterialIcon
|
<CustomMaterialIcon
|
||||||
color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
|
color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
|
||||||
icon="arrow-left"/>
|
icon={Platform.OS === 'chevron-left' ? "" : "arrow-left"}/>
|
||||||
</Touchable>;
|
</Touchable>;
|
||||||
else
|
else
|
||||||
button = this.props.leftButton;
|
button = this.props.leftButton;
|
||||||
|
|
Loading…
Reference in a new issue