/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ 'use strict'; var React = require('react-native'); var { Navigator, PixelRatio, ScrollView, StyleSheet, Text, TouchableHighlight, } = React; var BreadcrumbNavSample = require('./BreadcrumbNavSample'); var NavigationBarSample = require('./NavigationBarSample'); var JumpingNavSample = require('./JumpingNavSample'); class NavButton extends React.Component { render() { return ( {this.props.text} ); } } class NavMenu extends React.Component { render() { return ( {this.props.message} { this.props.navigator.push({ message: 'Swipe right to dismiss', sceneConfig: Navigator.SceneConfigs.FloatFromRight, }); }} text="Float in from right" /> { this.props.navigator.push({ message: 'Swipe down to dismiss', sceneConfig: Navigator.SceneConfigs.FloatFromBottom, }); }} text="Float in from bottom" /> { this.props.navigator.pop(); }} text="Pop" /> { this.props.navigator.popToTop(); }} text="Pop to top" /> { this.props.navigator.push({ id: 'navbar' }); }} text="Navbar Example" /> { this.props.navigator.push({ id: 'jumping' }); }} text="Jumping Example" /> { this.props.navigator.push({ id: 'breadcrumbs' }); }} text="Breadcrumbs Example" /> { this.props.onExampleExit(); }} text="Exit Example" /> ); } } var TabBarExample = React.createClass({ statics: { title: '', description: 'JS-implemented navigation', }, renderScene: function(route, nav) { switch (route.id) { case 'navbar': return ; case 'breadcrumbs': return ; case 'jumping': return ; default: return ( ); } }, render: function() { return ( { if (route.sceneConfig) { return route.sceneConfig; } return Navigator.SceneConfigs.FloatFromBottom; }} /> ); }, }); var styles = StyleSheet.create({ messageText: { fontSize: 17, fontWeight: '500', padding: 15, marginTop: 50, marginLeft: 15, }, container: { flex: 1, }, button: { backgroundColor: 'white', padding: 15, borderBottomWidth: 1 / PixelRatio.get(), borderBottomColor: '#CDCDCD', }, buttonText: { fontSize: 17, fontWeight: '500', }, scene: { flex: 1, paddingTop: 20, backgroundColor: '#EAEAEA', } }); module.exports = TabBarExample;