[TestSuite] Upgrade test app navigation Fix invertase/react-native-firebase#83

This commit is contained in:
Aleck Greenham 2017-05-04 18:49:47 +01:00
parent 670dfa2807
commit 1666bc1496
4 changed files with 28 additions and 46 deletions

View File

@ -37,7 +37,7 @@
"react-native-firebase": "file:..",
"react-native-simple-toast": "0.0.5",
"react-native-vector-icons": "^4.0.0",
"react-navigation": "^1.0.0-beta.7",
"react-navigation": "^1.0.0-beta.9",
"react-redux": "^5.0.3",
"redux": "^3.6.0",
"redux-logger": "^2.8.2",

View File

@ -13,17 +13,11 @@ class Overview extends React.Component {
// noinspection JSUnusedGlobalSymbols
static navigationOptions = {
title: 'Test Suites',
header: () => {
return {
style: { backgroundColor: '#0288d1' },
tintColor: '#ffffff',
right: (
<View style={{ marginRight: 8 }}>
<OverviewControlButton />
</View>
),
};
},
headerTintColor: '#ffffff',
headerStyle: { backgroundColor: '#0288d1' },
headerRight: <View style={{ marginRight: 8 }}>
<OverviewControlButton />
</View>
};
/**

View File

@ -11,25 +11,19 @@ import TestSuiteControlButton from '../components/TestSuiteControlButton';
class Suite extends React.Component {
static navigationOptions = {
title: ({ state: { params: { title } } }) => {
return title;
},
header: ({ state: { params: { testSuiteId, onlyShowFailingTests } }, setParams }) => {
return {
style: { backgroundColor: '#0288d1' },
tintColor: '#ffffff',
right: (
<View style={{ flexDirection: 'row', marginRight: 8 }}>
<TestSuiteControlButton
testSuiteId={testSuiteId}
onlyShowFailingTests={onlyShowFailingTests}
onFilterChange={setParams}
/>
</View>
),
};
},
static navigationOptions = ({ navigation: { state: { params: { title, testSuiteId, onlyShowFailingTests } }, setParams } }) => {
return {
title,
headerTintColor: '#ffffff',
headerStyle: { backgroundColor: '#0288d1' },
headerRight: <View style={{ flexDirection: 'row', marginRight: 8 }}>
<TestSuiteControlButton
testSuiteId={testSuiteId}
onlyShowFailingTests={onlyShowFailingTests}
onFilterChange={setParams}
/>
</View>,
};
};
/**

View File

@ -9,21 +9,15 @@ import TestControlButton from '../components/TestControlButton';
class Test extends React.Component {
static navigationOptions = {
title: ({ state: { params: { title } } }) => {
return title;
},
header: ({ state: { params: { testId } } }) => {
return {
style: { backgroundColor: '#0288d1' },
tintColor: '#ffffff',
right: (
<View style={{ marginRight: 8 }}>
<TestControlButton testId={testId} />
</View>
),
};
},
static navigationOptions = ({ navigation: { state: { params: { title, testId } } } }) => {
return {
title,
headerTintColor: '#ffffff',
headerStyle: { backgroundColor: '#0288d1' },
headerRight: <View style={{ marginRight: 8 }}>
<TestControlButton testId={testId} />
</View>,
};
};
static renderBanner({ status, time }) {