[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-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', <OverviewControlButton />
right: ( </View>
<View style={{ marginRight: 8 }}>
<OverviewControlButton />
</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 {
return title; title,
}, headerTintColor: '#ffffff',
header: ({ state: { params: { testSuiteId, onlyShowFailingTests } }, setParams }) => { headerStyle: { backgroundColor: '#0288d1' },
return { headerRight: <View style={{ flexDirection: 'row', marginRight: 8 }}>
style: { backgroundColor: '#0288d1' }, <TestSuiteControlButton
tintColor: '#ffffff', testSuiteId={testSuiteId}
right: ( onlyShowFailingTests={onlyShowFailingTests}
<View style={{ flexDirection: 'row', marginRight: 8 }}> onFilterChange={setParams}
<TestSuiteControlButton />
testSuiteId={testSuiteId} </View>,
onlyShowFailingTests={onlyShowFailingTests} };
onFilterChange={setParams}
/>
</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 {
return title; title,
}, headerTintColor: '#ffffff',
header: ({ state: { params: { testId } } }) => { headerStyle: { backgroundColor: '#0288d1' },
return { headerRight: <View style={{ marginRight: 8 }}>
style: { backgroundColor: '#0288d1' }, <TestControlButton testId={testId} />
tintColor: '#ffffff', </View>,
right: ( };
<View style={{ marginRight: 8 }}>
<TestControlButton testId={testId} />
</View>
),
};
},
}; };
static renderBanner({ status, time }) { static renderBanner({ status, time }) {