This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
Sphere/app/components/navigation/RouteMapper.js

39 lines
863 B
JavaScript
Raw Permalink Normal View History

2016-02-06 15:07:29 +00:00
import React from 'react-native'; // eslint-disable-line no-unused-vars
2016-05-07 19:32:59 +01:00
import Title from './Title';
import BackButton from './BackButton';
import InfoButton from './InfoButton';
import LogoutButton from './LogoutButton';
import RouteMaster from '../routes/RouteMaster';
2016-02-06 15:07:29 +00:00
import { View } from 'react-native';
export default {
LeftButton(route, nav, index, navState) {
2016-05-07 19:32:59 +01:00
if (route.id === RouteMaster.get('HOME').id) {
return <LogoutButton nav={nav}/>;
2016-02-11 20:45:40 +00:00
}
2016-05-07 19:32:59 +01:00
if (index >= 1) {
return (
<BackButton nav={nav} />
);
}
return <View />;
2016-02-06 15:07:29 +00:00
},
RightButton(route, nav, index, navState) {
2016-05-07 19:32:59 +01:00
if (route.id === RouteMaster.get('LOGIN').id) {
return <InfoButton nav={nav} route={route} />;
2016-02-06 16:46:41 +00:00
}
2016-02-11 20:45:40 +00:00
return <View />;
2016-02-06 15:07:29 +00:00
},
Title(route, nav, index, navState) {
return (
2016-05-07 19:32:59 +01:00
<Title route={route} />
2016-02-06 15:07:29 +00:00
);
},
};