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-firebase": "file:..",
"react-native-simple-toast": "0.0.5", "react-native-simple-toast": "0.0.5",
"react-native-vector-icons": "^4.0.0", "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", "react-redux": "^5.0.3",
"redux": "^3.6.0", "redux": "^3.6.0",
"redux-logger": "^2.8.2", "redux-logger": "^2.8.2",

View File

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

View File

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

View File

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