Merge pull request #85 from greena13/dev_test_suite_nav_upgrade

[TestSuite] Upgrade test app navigation Fix invertase/react-native-fi…
This commit is contained in:
Michael Diarmid 2017-05-05 08:24:50 +01:00 committed by GitHub
commit 88833924a5
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 }) {