diff --git a/packages/react-navigation/examples/NavigationPlayground/.flowconfig b/packages/react-navigation/examples/NavigationPlayground/.flowconfig index 2a71d77b..f71dd12c 100644 --- a/packages/react-navigation/examples/NavigationPlayground/.flowconfig +++ b/packages/react-navigation/examples/NavigationPlayground/.flowconfig @@ -65,11 +65,13 @@ module.file_ext=.jsx module.file_ext=.json module.file_ext=.native.js +suppress_type=$FlowIgnore suppress_type=$FlowIssue suppress_type=$FlowFixMe suppress_type=$FlowFixMeProps suppress_type=$FlowFixMeState +suppress_comment=\\(.\\|\n\\)*\\$FlowIgnore\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy diff --git a/packages/react-navigation/examples/NavigationPlayground/js/App.js b/packages/react-navigation/examples/NavigationPlayground/js/App.js index 0a9f1575..bf27dd5c 100644 --- a/packages/react-navigation/examples/NavigationPlayground/js/App.js +++ b/packages/react-navigation/examples/NavigationPlayground/js/App.js @@ -29,6 +29,7 @@ import StacksOverTabs from './StacksOverTabs'; import StacksWithKeys from './StacksWithKeys'; import SimpleStack from './SimpleStack'; import StackWithHeaderPreset from './StackWithHeaderPreset'; +import StackWithTranslucentHeader from './StackWithTranslucentHeader'; import SimpleTabs from './SimpleTabs'; import TabAnimations from './TabAnimations'; import TabsWithNavigationFocus from './TabsWithNavigationFocus'; @@ -50,6 +51,14 @@ const ExampleInfo = { name: 'UIKit-style Header Transitions', description: 'Masked back button and sliding header items. iOS only.', }, + StackWithHeaderPreset: { + name: 'UIKit-style Header Transitions', + description: 'Masked back button and sliding header items. iOS only.', + }, + StackWithTranslucentHeader: { + name: 'Translucent Header', + description: 'Render arbitrary translucent content in header background.', + }, // MultipleDrawer: { // name: 'Multiple Drawer Example', // description: 'Add any drawer you need', @@ -114,6 +123,7 @@ const ExampleRoutes = { // screen: MultipleDrawer, // }, StackWithHeaderPreset: StackWithHeaderPreset, + StackWithTranslucentHeader: StackWithTranslucentHeader, TabsInDrawer: TabsInDrawer, CustomTabs: CustomTabs, CustomTransitioner: CustomTransitioner, diff --git a/packages/react-navigation/examples/NavigationPlayground/js/SimpleStack.js b/packages/react-navigation/examples/NavigationPlayground/js/SimpleStack.js index 173066ca..7d44f680 100644 --- a/packages/react-navigation/examples/NavigationPlayground/js/SimpleStack.js +++ b/packages/react-navigation/examples/NavigationPlayground/js/SimpleStack.js @@ -178,20 +178,18 @@ MyProfileScreen.navigationOptions = props => { }; }; -const SimpleStack = StackNavigator( - { - Home: { - screen: MyHomeScreen, - }, - Profile: { - path: 'people/:name', - screen: MyProfileScreen, - }, - Photos: { - path: 'photos/:name', - screen: MyPhotosScreen, - }, - } -); +const SimpleStack = StackNavigator({ + Home: { + screen: MyHomeScreen, + }, + Profile: { + path: 'people/:name', + screen: MyProfileScreen, + }, + Photos: { + path: 'photos/:name', + screen: MyPhotosScreen, + }, +}); export default SimpleStack; diff --git a/packages/react-navigation/examples/NavigationPlayground/js/StackWithTranslucentHeader.js b/packages/react-navigation/examples/NavigationPlayground/js/StackWithTranslucentHeader.js new file mode 100644 index 00000000..548ca64e --- /dev/null +++ b/packages/react-navigation/examples/NavigationPlayground/js/StackWithTranslucentHeader.js @@ -0,0 +1,234 @@ +/** + * @flow + */ + +import type { + NavigationScreenProp, + NavigationEventSubscription, +} from 'react-navigation'; + +import { isIphoneX } from 'react-native-iphone-x-helper'; + +import * as React from 'react'; +import { BlurView, Constants } from 'expo'; +import { + Button, + Dimensions, + Platform, + ScrollView, + StatusBar, + View, +} from 'react-native'; +import { Header, StackNavigator } from 'react-navigation'; +import SampleText from './SampleText'; + +type MyNavScreenProps = { + navigation: NavigationScreenProp<*>, + banner: React.Node, +}; + +class MyNavScreen extends React.Component { + render() { + const { navigation, banner } = this.props; + return ( + + {banner} +